container_attributes.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. * Copyright The OpenTelemetry Authors
  3. * SPDX-License-Identifier: Apache-2.0
  4. */
  5. /*
  6. * DO NOT EDIT, this is an Auto-generated file from:
  7. * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2
  8. */
  9. #pragma once
  10. #include "opentelemetry/common/macros.h"
  11. #include "opentelemetry/version.h"
  12. OPENTELEMETRY_BEGIN_NAMESPACE
  13. namespace semconv
  14. {
  15. namespace container
  16. {
  17. /**
  18. The command used to run the container (i.e. the command name).
  19. <p>
  20. If using embedded credentials or sensitive data, it is recommended to remove them to prevent
  21. potential leakage.
  22. */
  23. static constexpr const char *kContainerCommand = "container.command";
  24. /**
  25. All the command arguments (including the command/executable itself) run by the container.
  26. */
  27. static constexpr const char *kContainerCommandArgs = "container.command_args";
  28. /**
  29. The full command run by the container as a single string representing the full command.
  30. */
  31. static constexpr const char *kContainerCommandLine = "container.command_line";
  32. /**
  33. Deprecated, use @code cpu.mode @endcode instead.
  34. @deprecated
  35. {"note": "Replaced by @code cpu.mode @endcode.", "reason": "renamed", "renamed_to": "cpu.mode"}
  36. */
  37. OPENTELEMETRY_DEPRECATED static constexpr const char *kContainerCpuState = "container.cpu.state";
  38. /**
  39. The name of the CSI (<a href="https://github.com/container-storage-interface/spec">Container
  40. Storage Interface</a>) plugin used by the volume. <p> This can sometimes be referred to as a
  41. "driver" in CSI implementations. This should represent the @code name @endcode field of the
  42. GetPluginInfo RPC.
  43. */
  44. static constexpr const char *kContainerCsiPluginName = "container.csi.plugin.name";
  45. /**
  46. The unique volume ID returned by the CSI (<a
  47. href="https://github.com/container-storage-interface/spec">Container Storage Interface</a>)
  48. plugin. <p> This can sometimes be referred to as a "volume handle" in CSI implementations. This
  49. should represent the @code Volume.volume_id @endcode field in CSI spec.
  50. */
  51. static constexpr const char *kContainerCsiVolumeId = "container.csi.volume.id";
  52. /**
  53. Container ID. Usually a UUID, as for example used to <a
  54. href="https://docs.docker.com/engine/containers/run/#container-identification">identify Docker
  55. containers</a>. The UUID might be abbreviated.
  56. */
  57. static constexpr const char *kContainerId = "container.id";
  58. /**
  59. Runtime specific image identifier. Usually a hash algorithm followed by a UUID.
  60. <p>
  61. Docker defines a sha256 of the image id; @code container.image.id @endcode corresponds to the
  62. @code Image @endcode field from the Docker container inspect <a
  63. href="https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect">API</a>
  64. endpoint. K8s defines a link to the container registry repository with digest @code "imageID":
  65. "registry.azurecr.io
  66. /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"
  67. @endcode. The ID is assigned by the container runtime and can vary in different environments.
  68. Consider using @code oci.manifest.digest @endcode if it is important to identify the same image in
  69. different environments/runtimes.
  70. */
  71. static constexpr const char *kContainerImageId = "container.image.id";
  72. /**
  73. Name of the image the container was built on.
  74. */
  75. static constexpr const char *kContainerImageName = "container.image.name";
  76. /**
  77. Repo digests of the container image as provided by the container runtime.
  78. <p>
  79. <a href="https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect">Docker</a>
  80. and <a
  81. href="https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238">CRI</a>
  82. report those under the @code RepoDigests @endcode field.
  83. */
  84. static constexpr const char *kContainerImageRepoDigests = "container.image.repo_digests";
  85. /**
  86. Container image tags. An example can be found in <a
  87. href="https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect">Docker Image
  88. Inspect</a>. Should be only the @code <tag> @endcode section of the full name for example from
  89. @code registry.example.com/my-org/my-image:<tag> @endcode.
  90. */
  91. static constexpr const char *kContainerImageTags = "container.image.tags";
  92. /**
  93. Container labels, @code <key> @endcode being the label name, the value being the label value.
  94. <p>
  95. For example, a docker container label @code app @endcode with value @code nginx @endcode SHOULD be
  96. recorded as the @code container.label.app @endcode attribute with value @code "nginx" @endcode.
  97. */
  98. static constexpr const char *kContainerLabel = "container.label";
  99. /**
  100. Deprecated, use @code container.label @endcode instead.
  101. @deprecated
  102. {"note": "Replaced by @code container.label @endcode.", "reason": "renamed", "renamed_to":
  103. "container.label"}
  104. */
  105. OPENTELEMETRY_DEPRECATED static constexpr const char *kContainerLabels = "container.labels";
  106. /**
  107. Container name used by container runtime.
  108. */
  109. static constexpr const char *kContainerName = "container.name";
  110. /**
  111. The container runtime managing this container.
  112. */
  113. static constexpr const char *kContainerRuntime = "container.runtime";
  114. namespace ContainerCpuStateValues
  115. {
  116. /**
  117. When tasks of the cgroup are in user mode (Linux). When all container processes are in user mode
  118. (Windows).
  119. */
  120. static constexpr const char *kUser = "user";
  121. /**
  122. When CPU is used by the system (host OS)
  123. */
  124. static constexpr const char *kSystem = "system";
  125. /**
  126. When tasks of the cgroup are in kernel mode (Linux). When all container processes are in kernel
  127. mode (Windows).
  128. */
  129. static constexpr const char *kKernel = "kernel";
  130. } // namespace ContainerCpuStateValues
  131. } // namespace container
  132. } // namespace semconv
  133. OPENTELEMETRY_END_NAMESPACE