Copilot commented on code in PR #63959:
URL: https://github.com/apache/airflow/pull/63959#discussion_r3025336685
##########
airflow/traces/otel_tracer.py:
##########
@@ -269,7 +269,7 @@ def get_otel_tracer(cls) -> OtelTrace:
endpoint = f"{protocol}://{host}:{port}/v1/traces"
log.info("[OTLPSpanExporter] Connecting to OpenTelemetry Collector at
%s", endpoint)
return OtelTrace(
- span_exporter=OTLPSpanExporter(endpoint=endpoint,
headers={"Content-Type": "application/json"}),
+ span_exporter=OTLPSpanExporter(endpoint=endpoint),
tag_string=tag_string,
Review Comment:
`get_otel_tracer()`’s non-debug branch now instantiates `OTLPSpanExporter`
without explicit headers, but the existing unit tests only exercise the
debug=True path (ConsoleSpanExporter). Please add a test that sets
`otel_debugging_on=False` and asserts `OTLPSpanExporter` is called with
`endpoint=...` and no `headers` argument (so env-based
`OTEL_EXPORTER_OTLP_HEADERS` can take effect).
##########
airflow/metrics/otel_logger.py:
##########
@@ -421,7 +421,6 @@ def get_otel_logger(cls) -> SafeOtelLogger:
PeriodicExportingMetricReader(
OTLPMetricExporter(
endpoint=endpoint,
- headers={"Content-Type": "application/json"},
),
export_interval_millis=interval,
)
Review Comment:
`get_otel_logger()` now builds `OTLPMetricExporter(endpoint=endpoint)`
without the previously hardcoded Content-Type header, but there doesn’t appear
to be a unit test covering exporter construction/arguments (tests focus on
SafeOtelLogger instrument behavior). Please add a test that patches
`airflow.metrics.otel_logger.OTLPMetricExporter` and asserts it’s called with
`endpoint=...` and without a `headers` override, to prevent regressions.
--
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]