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

Hardcoded Opentelemetry SERVICE_NAME #42210

Closed
1 of 2 tasks
nicolasge opened this issue Sep 13, 2024 · 3 comments · Fixed by #42242
Closed
1 of 2 tasks

Hardcoded Opentelemetry SERVICE_NAME #42210

nicolasge opened this issue Sep 13, 2024 · 3 comments · Fixed by #42242
Labels
area:core kind:bug This is a clearly a bug telemetry Telemetry-related issues

Comments

@nicolasge
Copy link

Apache Airflow version

2.10.1

If "Other Airflow 2 version" selected, which one?

No response

What happened?

When enabled the OTEL in Airflow, the OTEL_SERVICE_NAME is hardcoded to "Airflow". Based on https://opentelemetry.io/docs/languages/sdk-configuration/general/ users should be able to overwrite this to any value via environment variable OTEL_SERVICE_NAME.

Image code path: /home/airflow/.local/lib/python3.12/site-packages/airflow/metrics/otel_logger.py
Bug line: resource = Resource(attributes={SERVICE_NAME: "Airflow"})

What you think should happen instead?

If user specified OTEL_SERVICE_NAME via environment, airflow use should this value instead of hardcoded value which is "Airflow"

How to reproduce

During the installation, inject an extra environment OTEL_SERVICE_NAME and set the value to a value not equal to Airflow

Operating System

Debian 12

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@nicolasge nicolasge added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Sep 13, 2024
Copy link

boring-cyborg bot commented Sep 13, 2024

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@dosubot dosubot bot added the telemetry Telemetry-related issues label Sep 13, 2024
@romsharon98
Copy link
Contributor

Apparently otel configuration already have service_name configuration, I duplicate it to the metrics section and apply it on the service name.

Let me know what you think on the PR

@nathadfield nathadfield removed the needs-triage label for new issues that we didn't triage yet label Sep 19, 2024
@nicolasge
Copy link
Author

It looks good to me. Thanks @romsharon98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core kind:bug This is a clearly a bug telemetry Telemetry-related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants