xBis7 commented on code in PR #68393:
URL: https://github.com/apache/airflow/pull/68393#discussion_r3403956201


##########
shared/observability/src/airflow_shared/observability/metrics/otel_logger.py:
##########
@@ -435,70 +437,113 @@ def atexit_register_metrics_flush():
     atexit.register(flush_otel_metrics)
 
 
-def get_otel_logger(
+def _get_backcompat_config(
+    *,
+    host: str | None,
+    port: str | None,
+    ssl_active: bool,
+    service: str | None,
+    interval_ms: str | None,
+) -> tuple[str | None, float | None, Resource | None]:
+    resource = None
+    if service and not os.environ.get("OTEL_SERVICE_NAME") and not 
os.environ.get("OTEL_RESOURCE_ATTRIBUTES"):
+        resource = Resource.create(attributes={SERVICE_NAME: service})
+
+    endpoint = None
+    if (
+        host
+        and port
+        and not os.environ.get("OTEL_EXPORTER_OTLP_ENDPOINT")
+        and not os.environ.get("OTEL_EXPORTER_OTLP_METRICS_ENDPOINT")
+    ):
+        scheme = "https" if ssl_active else "http"
+        endpoint = f"{scheme}://{_format_url_host(host)}:{port}/v1/metrics"
+
+    parsed_interval_ms: float | None = None
+    if interval_ms and not os.environ.get("OTEL_METRIC_EXPORT_INTERVAL"):
+        try:
+            parsed_interval_ms = float(interval_ms)
+        except (TypeError, ValueError):
+            log.warning("Invalid metrics.otel_interval_milliseconds value: %r; 
ignoring.", interval_ms)
+
+    return endpoint, parsed_interval_ms, resource
+
+
+def _load_exporter_from_env() -> MetricExporter:
+    """
+    Load a metric exporter using the ``OTEL_METRICS_EXPORTER`` env var.
+
+    Mirrors the entry-point mechanism used by the OTEL SDK auto-instrumentation
+    configurator. Supported values (from installed packages):
+      - ``otlp`` (default) -- OTLP/gRPC
+      - ``otlp_proto_http`` -- OTLP/HTTP

Review Comment:
   I can't find `otlp_proto_http`
   
   
https://opentelemetry.io/docs/languages/sdk-configuration/general/#otel_metrics_exporter



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