Skip to content

Commit f2bb361

Browse files
committed
Make the _Instrument runtime checkable
1 parent a035462 commit f2bb361

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal

opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
Generator,
2323
Iterable,
2424
List,
25+
Protocol,
2526
Sequence,
2627
Union,
2728
cast,
29+
runtime_checkable,
2830
)
2931

3032
# This kind of import is needed to avoid Sphinx errors.
@@ -63,7 +65,8 @@
6365
)
6466

6567

66-
class _Instrument:
68+
@runtime_checkable
69+
class _Instrument(Protocol):
6770
name: str
6871
unit: str
6972
description: str

0 commit comments

Comments
 (0)