ferruzzi commented on code in PR #32524:
URL: https://github.com/apache/airflow/pull/32524#discussion_r1260083730


##########
airflow/metrics/otel_logger.py:
##########
@@ -394,8 +395,11 @@ def get_otel_logger(cls) -> SafeOtelLogger:
     allow_list_validator = AllowListValidator(allow_list)
 
     resource = Resource(attributes={SERVICE_NAME: "Airflow"})
-    # TODO:  figure out https instead of http ??
-    endpoint = f"http://{host}:{port}/v1/metrics";
+
+    if ssl_active:
+        endpoint = f"https://{host}:{port}/v1/metrics";
+    else:
+        endpoint = f"http://{host}:{port}/v1/metrics";

Review Comment:
   I'd either use 
   
   ```suggestion
       endpoint = f"{'https' if ssl_active else 
'http'}://{host}:{port}/v1/metrics"
   ```
   
   
   or
   
   ```suggestion
       protocol = "https" if ssl_active else "http"
       endpoint = f"{protocol}://{host}:{port}/v1/metrics"
   ```
   
   



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