Skip to content
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

Add extra trace attributes from downward API #13544

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sfleen
Copy link
Contributor

@sfleen sfleen commented Jan 9, 2025

This allows us to specify extra trace attribute key-value pairs from the downward API without needing to pull from the pods annotations or labels. This lets us keep the proxy decoupled from k8s concepts.

"path": "/spec/{{.ProxyPath}}/env/-",
"value": {
"name": "LINKERD2_PROXY_TRACE_EXTRA_ATTRIBUTES",
"value": "k8s.pod.uid=$(_pod_uid),k8s.container.name=$(_pod_containerName)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are the _pod_uid and _pod_containerName env variables set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're set in the proxy environment here:

@sfleen sfleen force-pushed the trace_args branch 2 times, most recently from a770ed6 to 795a330 Compare January 13, 2025 16:59
@sfleen sfleen marked this pull request as ready for review January 13, 2025 20:00
@sfleen sfleen requested a review from a team as a code owner January 13, 2025 20:00
This allows us to specify extra trace attribute key-value pairs from the downward API without needing to pull from the pods annotations or labels. This lets us keep the proxy decoupled from k8s concepts.

Signed-off-by: Scott Fleener <[email protected]>
sfleen added a commit to sfleen/linkerd2-proxy that referenced this pull request Jan 14, 2025
This allows us to include arbitrary values from the k8s downward API beyond just the pod labels that are included in the trace attributes file.

See linkerd/linkerd2#13544 for the corresponding control plane change.

Signed-off-by: Scott Fleener <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants