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

Inject the K8S_NODE_NAME environment variable when using the kubeletstatsreceiver and serviceAccount authentication #2779

Closed
iblancasa opened this issue Mar 22, 2024 · 2 comments · Fixed by #3389
Labels
enhancement New feature or request needs triage

Comments

@iblancasa
Copy link
Contributor

Component(s)

No response

Is your feature request related to a problem? Please describe.

One of the methods to authenticate with the API for the kubeletstatsreceiver needs the node name. The documentation explains how to do it: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/kubeletstatsreceiver/README.md#service-account-authentication-example

Describe the solution you'd like

It would be nice to inject the environment variable automatically from the operator.

Describe alternatives you've considered

No response

Additional context

No response

@iblancasa iblancasa added enhancement New feature or request needs triage labels Mar 22, 2024
@jvoravong
Copy link
Contributor

You can use the OTEL_RESOURCE_ATTRIBUTES_NODE_NAME environment variable injected by the operator to configure the receiver.

Example:

receivers:
  kubeletstats:
    collection_interval: 20s
    auth_type: "serviceAccount"
    endpoint: "https://${env:OTEL_RESOURCE_ATTRIBUTES_NODE_NAME}:10250"
    insecure_skip_verify: true

@iblancasa
Copy link
Contributor Author

That's a good idea. Maybe we can add that note to the kubeletstatsreceiver doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
2 participants