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


##########
airflow-core/src/airflow/metrics/otel_logger.py:
##########
@@ -371,25 +371,37 @@ def set_gauge_value(self, name: str, value: int | float, 
delta: bool, tags: Attr
 
 
 def get_otel_logger(cls) -> SafeOtelLogger:
+    # Check Airflow config.
     host = conf.get("metrics", "otel_host")  # ex: "breeze-otel-collector"
     port = conf.getint("metrics", "otel_port")  # ex: 4318
-    prefix = conf.get("metrics", "otel_prefix")  # ex: "airflow"
-    ssl_active = conf.getboolean("metrics", "otel_ssl_active")
-    # PeriodicExportingMetricReader will default to an interval of 60000 
millis.
-    interval = conf.getint("metrics", "otel_interval_milliseconds", 
fallback=None)  # ex: 30000
-    debug = conf.getboolean("metrics", "otel_debugging_on")
-    service_name = conf.get("metrics", "otel_service")
 
-    resource = Resource.create(attributes={HOST_NAME: get_hostname(), 
SERVICE_NAME: service_name})
+    # If the host or the port hasn't been provided, then check the regular 
OTel env vars.
+    if host != "-" and port != "0":

Review Comment:
   I updated the comment so that it's clear what it means.
   
   I know that it was confusing, but it was correct. It was saying `if either 
one doesn't have a value, we are going to execute the else block`.
   
   If both of them have a value, then the condition evaluates to `True`. If at 
least one of them doesn't have a value, then it's `False`.



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