-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[autoinstrumentation] Add node and pod ip env vars automatically #2769
[autoinstrumentation] Add node and pod ip env vars automatically #2769
Conversation
@@ -33,7 +33,9 @@ const ( | |||
|
|||
EnvPodName = "OTEL_RESOURCE_ATTRIBUTES_POD_NAME" | |||
EnvPodUID = "OTEL_RESOURCE_ATTRIBUTES_POD_UID" | |||
EnvPodIP = "OTEL_POD_IP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an attribute name in the spec for the POD and NODE IPs?
we should consider putting these under OTEL_RESOURCE_ATTRIBUTES_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted not to use OTEL_RESOURCE_ATTRIBUTES_
because I wasn't adding these values to the resource attributes. They are being added so that in Instrumentation users can to http://$(OTEL_NODE_IP):4318
or http://$(OTEL_POD_IP):4318
for their endpoints without having to specify any extra env vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For semantic convention, there isn't a k8s.pod.ip
or k8s.node.ip
convention yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
I would add the env vars to the changelog as well
component: instrumentation | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Add node and pod ips as env vars automatically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we list the env vars here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
…n-telemetry#2769) * Add node and pod ip env vars automatically * Fix tests * Fix tests * Fix tests * Fix tests * Fix tests * Update changelog
Description:
Add node IP and pod IP to env vars automatically. This makes them easy to reference in language-specific env vars if needed. Most of the changes are updates to tests.
Link to tracking Issue(s):
Related to #2180
Testing:
Unit and e2e tests
Documentation:
Updated the readme