set service.instance.id and k8s.pod.uid on OTel metrics resource - #448
Open
jaylonmcshan19-x wants to merge 2 commits into
Open
set service.instance.id and k8s.pod.uid on OTel metrics resource#448jaylonmcshan19-x wants to merge 2 commits into
jaylonmcshan19-x wants to merge 2 commits into
Conversation
jrhouston
requested changes
Aug 5, 2026
Comment on lines
+21
to
+22
| ServiceInstanceID string // ServiceInstanceID uniquely identifies this running instance, so replicas don't collapse into one entity | ||
| K8sPodUID string // K8sPodUID links the instance to its Kubernetes pod. Empty when not running in Kubernetes |
Contributor
There was a problem hiding this comment.
Each of these does effectively the same thing: uniquely identify a replica of the server.
I don't think we need to be K8s specific with this. We can just have one env var OTEL_INSTANCE_ID which when running in K8s can be populated like this:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PCI review checklist
This PR adds
service.instance.idto the OTel metrics resource, andk8s.pod.uidwhen we'rerunning in k8s.
right now
resource.NewSchemalessonly setsservice.nameandservice.version, so everyreplica sends an identical resource and Instana collapses them into a single entity.
in prod all 6 pods show up as one entity id. we can't tell replicas apart, and the entity never links to a k8s pod,
which is why none of the
kubernetes.*tags are available when attempting to build dashboard widgets.If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
If applicable, I've documented the impact of any changes to security controls.
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.