Skip to content

Commit e6e8cf3

Browse files
committed
Enum
1 parent 6a39cec commit e6e8cf3

File tree

1 file changed

+7
-3
lines changed
  • opentelemetry-instrumentation/src/opentelemetry/instrumentation

1 file changed

+7
-3
lines changed

opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import os
1616
import threading
1717
import urllib.parse
18+
from enum import Enum
1819
from re import escape, sub
1920
from typing import Dict, Optional, Sequence
2021

@@ -205,7 +206,7 @@ class _OpenTelemetryStabilitySignalType:
205206
HTTP = "http"
206207

207208

208-
class _OpenTelemetryStabilityMode:
209+
class _OpenTelemetryStabilityMode(Enum):
209210
# http - emit the new, stable HTTP and networking conventions ONLY
210211
HTTP = "http"
211212
# http/dup - emit both the old and the stable HTTP and networking conventions
@@ -233,9 +234,12 @@ def _initialize(cls):
233234
if opt_in_list:
234235
# Process http opt-in
235236
# http/dup takes priority over http
236-
if _OpenTelemetryStabilityMode.HTTP_DUP in opt_in_list:
237+
if (
238+
_OpenTelemetryStabilityMode.HTTP_DUP.value
239+
in opt_in_list
240+
):
237241
http_opt_in = _OpenTelemetryStabilityMode.HTTP_DUP
238-
elif _OpenTelemetryStabilityMode.HTTP in opt_in_list:
242+
elif _OpenTelemetryStabilityMode.HTTP.value in opt_in_list:
239243
http_opt_in = _OpenTelemetryStabilityMode.HTTP
240244
_OpenTelemetrySemanticConventionStability._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING[
241245
_OpenTelemetryStabilitySignalType.HTTP

0 commit comments

Comments
 (0)