Skip to content

Hardcoded Opentelemetry SERVICE_NAME #42210

Description

@nicolasge

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions