elhussienysabry opened a new pull request, #75453:
URL: https://github.com/apache/airflow/pull/75453

   ### Summary
   
   The custom OTLP metrics path requested in #42492 is already supported 
through the signal-specific
   `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` environment variable. Airflow does not 
rewrite that endpoint,
   so a backend path such as VictoriaMetrics' `/opentelemetry/api/v1/push` is 
preserved. `/v1/metrics`
   is only constructed when Airflow falls back to the deprecated 
`otel_host`/`otel_port` settings, and
   the OpenTelemetry SDK also appends it to the generic 
`OTEL_EXPORTER_OTLP_ENDPOINT` base URL.
   
   This PR documents that behavior and adds regression coverage for it. It 
deliberately does not add a
   new `otel_path` key to the deprecated `otel_host`/`otel_port` configuration 
block.
   
   Prior art: #72073 reached the same conclusion but was closed under the 
open-PR limit, not for
   technical reasons. This version keeps the existing gRPC precedence case and 
adds a separate HTTP
   path-preservation case.
   
   ### Changes
   
   - 
`airflow-core/docs/administration-and-deployment/logging-monitoring/metrics.rst`:
 explain how to
     use `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` for a non-default path, with a 
VictoriaMetrics example,
     and clarify why the generic endpoint is not a substitute.
   - `shared/observability/tests/observability/metrics/test_otel_logger.py`: 
add an HTTP case that
     asserts a custom metrics path is preserved exactly. The existing gRPC 
precedence case is kept
     because gRPC targets cannot carry a path.
   
   ### Testing
   
   - `cd shared/observability && uv run --project . pytest 
tests/observability/metrics -q` — 159
     passed, 2 warnings.
   - `prek run --files 
airflow-core/docs/administration-and-deployment/logging-monitoring/metrics.rst 
shared/observability/tests/observability/metrics/test_otel_logger.py` — passed.
   - `ruff format` and `ruff check --fix` on the test file — clean.
   
   closes: #42492
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (OpenCode with DeepSeek V4.1 Flash)
   Generated-by: OpenCode (DeepSeek V4.1 Flash) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
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]

Reply via email to