Skip to content

Commit becbfeb

Browse files
Apply suggestions from code review
Co-authored-by: Cyrille Le Clerc <[email protected]>
1 parent 96c8a06 commit becbfeb

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,8 @@ The following resource attributes are calculated from the pod's metadata.
802802

803803
Choose the first value found:
804804

805+
- `pod.annotation[resource.opentelemetry.io/service.name]`
806+
- `if (config[useLabelsForResourceAttributes]) pod.label[app.kubernetes.io/name]`
805807
- `k8s.depleyment.name`
806808
- `k8s.replicaset.name`
807809
- `k8s.statefulset.name`
@@ -813,15 +815,16 @@ Choose the first value found:
813815

814816
#### How service.version is calculated
815817

816-
Take the tag from the docker image name of the container.
817-
If the tag contains a `/`, the tag is ignored (this can happen if the image name contains a port number).
818+
- `pod.annotation[resource.opentelemetry.io/service.version]`
819+
- `if (cfg[useLabelsForResourceAttributes]) pod.label[app.kubernetes.io/version]`
820+
- `if (contains(container.image.tags[0], '/') == false) contains(container.image.tags[0]
818821
819-
#### How service.instance.id is calculated
822+
#### How `service.instance.id` is calculated
820823

821-
Create a unique identifier for the application running in the container.
822-
The identifier is created by concatenating the following values:
823824

824-
`<k8s.namespace.name>.<k8s.pod.name>.<k8s.container.name>`
825+
- `pod.annotation[resource.opentelemetry.io/service.instance.id]`
826+
- `if (config[useLabelsForResourceAttributes]) pod.label[app.kubernetes.io/instance]`
827+
- `concat([k8s.namespace.name, k8s.pod.name, k8s.container.name], '.')`
825828

826829
## Contributing and Developing
827830

0 commit comments

Comments
 (0)