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

set resource attributes via env variables in transform statements - duplicate #27585

Closed
ceevaaa opened this issue Oct 10, 2023 · 2 comments
Closed
Labels
bug Something isn't working needs triage New item requiring triage processor/transform Transform processor

Comments

@ceevaaa
Copy link

ceevaaa commented Oct 10, 2023

Component(s)

No response

What happened?

Description

I want to set "service.name" and "service.version" from the env variables, in the transform processor pipeline. I have tried this.

- set(resource.attributes["service.name"], ${env:OTEL_SERVICE_NAME}) where resource.attributes["service.name"] == nil
- set(resource.attributes["service.version"], ${env:OTEL_SERVICE_VERSION}) where resource.attributes["service.version"] == nil

Can someone either point me to a doc mentioning the same or give an example of how to use the env variables inside the set().

Regards

Collector version

v0.83.0

Environment information

Environment

OS: (e.g., "Ubuntu 22.04")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@ceevaaa ceevaaa added bug Something isn't working needs triage New item requiring triage labels Oct 10, 2023
@github-actions github-actions bot added the processor/transform Transform processor label Oct 10, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@ceevaaa
Copy link
Author

ceevaaa commented Oct 10, 2023

/label -bug

@ceevaaa ceevaaa closed this as completed Oct 10, 2023
@ceevaaa ceevaaa changed the title [processor/transform] set resource attributes via env variables in transform statements set resource attributes via env variables in transform statements Oct 10, 2023
@ceevaaa ceevaaa changed the title set resource attributes via env variables in transform statements set resource attributes via env variables in transform statements - duplicate Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage processor/transform Transform processor
Projects
None yet
Development

No branches or pull requests

1 participant