xBis7 commented on code in PR #56150: URL: https://github.com/apache/airflow/pull/56150#discussion_r2384240884
########## airflow-core/src/airflow/utils/otel_config.py: ########## @@ -0,0 +1,181 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +from __future__ import annotations + +import logging +import os +from dataclasses import dataclass +from enum import Enum +from functools import lru_cache + +log = logging.getLogger(__name__) + + +def _parse_kv_str_to_dict(str_var: str) -> dict[str, str]: Review Comment: TBH, I would like to remove that file (`traces/utils.py`) entirely. The code that was using it, isn't called anymore. Generating and assigning a trace ID and a span ID are internal operations of the OTel SDK. The traceparent and the tracestate belong to the span context which is handled by the propagators API. https://github.com/apache/airflow/blob/aa398f353b9a3d5de96abbdcba72659f19c6be42/airflow-core/src/airflow/traces/otel_tracer.py#L286-L294 The `inject` and `extract` methods are taking care of the context processing. These methods are a hacky way of handling spans, just like the Airflow config values that are getting hard-coded into the callers to the OTel SDK. -- 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]
