dsuhinin commented on code in PR #68393:
URL: https://github.com/apache/airflow/pull/68393#discussion_r3429200555
##########
shared/observability/tests/observability/metrics/test_otel_logger.py:
##########
@@ -502,6 +457,59 @@ def
test_get_otel_logger_uses_exponential_histogram_view(self, mock_provider, mo
assert isinstance(view, View)
assert isinstance(view._aggregation,
ExponentialBucketHistogramAggregation)
+ @pytest.mark.parametrize(
+ ("provided_env_vars", "expected_module"),
+ [
+ pytest.param(
+ {},
+ "opentelemetry.exporter.otlp.proto.http.metric_exporter",
+ id="default_otlp_no_protocol_uses_http",
+ ),
+ pytest.param(
+ {"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf"},
+ "opentelemetry.exporter.otlp.proto.http.metric_exporter",
+ id="generic_protocol_http_protobuf_uses_http",
+ ),
+ pytest.param(
+ {"OTEL_EXPORTER_OTLP_PROTOCOL": "grpc"},
+ "opentelemetry.exporter.otlp.proto.grpc.metric_exporter",
+ id="generic_protocol_grpc_uses_grpc",
+ ),
+ pytest.param(
+ {"OTEL_EXPORTER_OTLP_METRICS_PROTOCOL": "grpc"},
+ "opentelemetry.exporter.otlp.proto.grpc.metric_exporter",
+ id="metrics_specific_protocol_grpc_uses_grpc",
+ ),
+ pytest.param(
+ {
+ "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
+ "OTEL_EXPORTER_OTLP_METRICS_PROTOCOL": "grpc",
+ },
+ "opentelemetry.exporter.otlp.proto.grpc.metric_exporter",
+ id="metrics_specific_protocol_overrides_generic",
+ ),
+ pytest.param(
+ {"OTEL_METRICS_EXPORTER": "console"},
Review Comment:
added more tests for both `traces` and `metrics` logic. should be good now.
--
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]