Skip to content

Commit

Permalink
Add more semantic conventions for k8s as resource attributes (#1167)
Browse files Browse the repository at this point in the history
* Add more semantic conventions for k8s

* Update CHANGELOG

Co-authored-by: Tyler Yahn <[email protected]>
  • Loading branch information
XSAM and MrAlias authored Sep 11, 2020
1 parent d91de43 commit 6f048eb
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- In the `go.opentelemetry.io/otel/api/trace` package, `NewTracerConfig` was added to construct new `TracerConfig`s.
This addition was made to conform with our project option conventions. (#1155)
- Instrumentation library information was added to the Zipkin exporter. (#1119)
- More semantic conventions for k8s as resource attributes. (#1167)

### Changed

Expand Down
39 changes: 39 additions & 0 deletions semconv/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,50 @@ const (
// The name of the namespace that the pod is running in.
K8SNamespaceNameKey = label.Key("k8s.namespace.name")

// The uid of the Pod.
K8SPodUIDKey = label.Key("k8s.pod.uid")

// The name of the pod.
K8SPodNameKey = label.Key("k8s.pod.name")

// The name of the Container in a Pod template.
K8SContainerNameKey = label.Key("k8s.container.name")

// The uid of the ReplicaSet.
K8SReplicaSetUIDKey = label.Key("k8s.replicaset.uid")

// The name of the ReplicaSet.
K8SReplicaSetNameKey = label.Key("k8s.replicaset.name")

// The uid of the Deployment.
K8SDeploymentUIDKey = label.Key("k8s.deployment.uid")

// The name of the deployment.
K8SDeploymentNameKey = label.Key("k8s.deployment.name")

// The uid of the StatefulSet.
K8SStatefulSetUIDKey = label.Key("k8s.statefulset.uid")

// The name of the StatefulSet.
K8SStatefulSetNameKey = label.Key("k8s.statefulset.name")

// The uid of the DaemonSet.
K8SDaemonSetUIDKey = label.Key("k8s.daemonset.uid")

// The name of the DaemonSet.
K8SDaemonSetNameKey = label.Key("k8s.daemonset.name")

// The uid of the Job.
K8SJobUIDKey = label.Key("k8s.job.uid")

// The name of the Job.
K8SJobNameKey = label.Key("k8s.job.name")

// The uid of the CronJob.
K8SCronJobUIDKey = label.Key("k8s.cronjob.uid")

// The name of the CronJob.
K8SCronJobNameKey = label.Key("k8s.cronjob.name")
)

// Semantic conventions for host resource attribute keys.
Expand Down

0 comments on commit 6f048eb

Please sign in to comment.