pavankumargp6 opened a new pull request, #77340:
URL: https://github.com/apache/airflow/pull/77340
Closes #42492
Currently the OTEL metrics exporter hardcodes `/v1/metrics` as the endpoint
path. Some collectors like VictoriaMetrics expect metrics at different paths
(e.g. `/opentelemetry/api/v1/push` or `/insert/0/`).
## Changes
1. **`shared/observability/src/airflow_shared/observability/common.py`**
- Added `path: str | None = None` parameter to `get_otel_data_exporter()`
- When constructing the endpoint URL, uses `path` if provided, falling
back to `/v1/{endpoint_suffix}`
2.
**`shared/observability/src/airflow_shared/observability/metrics/otel_logger.py`**
- Added `path: str | None = None` parameter to `get_otel_logger()`
- Passes `path` through to `get_otel_data_exporter()`
3. **`airflow-core/src/airflow/observability/metrics/otel_logger.py`**
- Reads `[metrics] otel_path` config with fallback to `/v1/metrics`
- Passes it through to the shared `get_otel_logger()`
4. **`task-sdk/src/airflow/sdk/observability/metrics/otel_logger.py`**
- Same config read and pass-through as the airflow-core wrapper
5. **`airflow-core/src/airflow/config_templates/config.yml`**
- Added `otel_path` config option in the `[metrics]` section with default
`/v1/metrics`
## Usage
Set in `airflow.cfg`:
[metrics]
otel_path = /opentelemetry/api/v1/push
Or via environment variable (standard OTel):
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://collector:4318/opentelemetry/api/v1/push
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]