Skip to content

Commit 27f04b6

Browse files
authored
Add missing ABC for Metric (open-telemetry#391)
Fix open-telemetry#390
1 parent 682ecc2 commit 27f04b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

opentelemetry-api/src/opentelemetry/metrics/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,14 @@ class DefaultLabelSet(LabelSet):
8787
"""
8888

8989

90-
class Metric:
90+
class Metric(abc.ABC):
9191
"""Base class for various types of metrics.
9292
9393
Metric class that inherit from this class are specialized with the type of
9494
handle that the metric holds.
9595
"""
9696

97+
@abc.abstractmethod
9798
def get_handle(self, label_set: LabelSet) -> "object":
9899
"""Gets a handle, used for repeated-use of metrics instruments.
99100

0 commit comments

Comments
 (0)