@@ -120,11 +120,11 @@ class _StabilityMode(Enum):
120120 DATABASE_DUP = "database/dup"
121121
122122
123- def _report_new (mode ):
123+ def _report_new (mode : _StabilityMode ):
124124 return mode != _StabilityMode .DEFAULT
125125
126126
127- def _report_old (mode ):
127+ def _report_old (mode : _StabilityMode ):
128128 return mode not in (_StabilityMode .HTTP , _StabilityMode .DATABASE )
129129
130130
@@ -138,9 +138,10 @@ def _initialize(cls):
138138 with cls ._lock :
139139 if cls ._initialized :
140140 return
141+
141142 # Users can pass in comma delimited string for opt-in options
142- # Only values for http stability are supported for now
143- opt_in = os .environ .get (OTEL_SEMCONV_STABILITY_OPT_IN , "" )
143+ # Only values for http and database stability are supported for now
144+ opt_in = os .environ .get (OTEL_SEMCONV_STABILITY_OPT_IN )
144145
145146 if not opt_in :
146147 # early return in case of default
@@ -183,7 +184,10 @@ def _filter_mode(opt_in_list, stable_mode, dup_mode):
183184 )
184185
185186 @classmethod
186- def _get_opentelemetry_stability_opt_in_mode (cls , signal_type ):
187+ def _get_opentelemetry_stability_opt_in_mode (
188+ cls , signal_type : _OpenTelemetryStabilitySignalType
189+ ) -> _StabilityMode :
190+ # Get OpenTelemetry opt-in mode based off of signal type (http, messaging, etc.)
187191 return cls ._OTEL_SEMCONV_STABILITY_SIGNAL_MAPPING .get (
188192 signal_type , _StabilityMode .DEFAULT
189193 )
0 commit comments