diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py index 0b0397a8df..1cce80bde7 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py @@ -15,6 +15,7 @@ import os import threading import urllib.parse +from enum import Enum from re import escape, sub from typing import Dict, Sequence @@ -163,7 +164,7 @@ class _OpenTelemetryStabilitySignalType: HTTP = "http" -class _OpenTelemetryStabilityMode: +class _OpenTelemetryStabilityMode(Enum): # http - emit the new, stable HTTP and networking conventions ONLY HTTP = "http" # http/dup - emit both the old and the stable HTTP and networking conventions @@ -191,9 +192,9 @@ def _initialize(cls): if opt_in_list: # Process http opt-in # http/dup takes priority over http - if _OpenTelemetryStabilityMode.HTTP_DUP in opt_in_list: + if _OpenTelemetryStabilityMode.HTTP_DUP.value in opt_in_list: http_opt_in = _OpenTelemetryStabilityMode.HTTP_DUP - elif _OpenTelemetryStabilityMode.HTTP in opt_in_list: + elif _OpenTelemetryStabilityMode.HTTP.value in opt_in_list: http_opt_in = _OpenTelemetryStabilityMode.HTTP _OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING[ _OpenTelemetryStabilitySignalType.HTTP