@@ -136,19 +136,33 @@ def schema_url(self):
136
136
137
137
@abstractmethod
138
138
def create_counter (self , name , unit = "" , description = "" ) -> Counter :
139
- pass
139
+ """Creates a `Counter` instrument
140
+
141
+ Args:
142
+ name: The name of the instrument to be created
143
+ unit: The unit for measurements this instrument reports. For
144
+ example, ``By`` for bytes. UCUM units are recommended.
145
+ description: A description for this instrument and what it measures.
146
+ """
140
147
141
148
@abstractmethod
142
149
def create_up_down_counter (
143
150
self , name , unit = "" , description = ""
144
151
) -> UpDownCounter :
145
- pass
152
+ """Creates an `UpDownCounter` instrument
153
+
154
+ Args:
155
+ name: The name of the instrument to be created
156
+ unit: The unit for measurements this instrument reports. For
157
+ example, ``By`` for bytes. UCUM units are recommended.
158
+ description: A description for this instrument and what it measures.
159
+ """
146
160
147
161
@abstractmethod
148
162
def create_observable_counter (
149
163
self , name , callback , unit = "" , description = ""
150
164
) -> ObservableCounter :
151
- """Creates an observable counter instrument
165
+ """Creates an `ObservableCounter` instrument
152
166
153
167
An observable counter observes a monotonically increasing count by
154
168
calling a provided callback which returns multiple
@@ -229,19 +243,48 @@ def cpu_time_callback(states_to_include: set[str]) -> Iterable[Iterable[Measurem
229
243
230
244
@abstractmethod
231
245
def create_histogram (self , name , unit = "" , description = "" ) -> Histogram :
232
- pass
246
+ """Creates a `Histogram` instrument
247
+
248
+ Args:
249
+ name: The name of the instrument to be created
250
+ unit: The unit for measurements this instrument reports. For
251
+ example, ``By`` for bytes. UCUM units are recommended.
252
+ description: A description for this instrument and what it measures.
253
+ """
233
254
234
255
@abstractmethod
235
256
def create_observable_gauge (
236
257
self , name , callback , unit = "" , description = ""
237
258
) -> ObservableGauge :
238
- pass
259
+ """Creates an `ObservableGauge` instrument
260
+
261
+ Args:
262
+ name: The name of the instrument to be created
263
+ callback: A callback that returns an iterable of
264
+ :class:`~opentelemetry._metrics.measurement.Measurement`.
265
+ Alternatively, can be a generator that yields iterables of
266
+ :class:`~opentelemetry._metrics.measurement.Measurement`.
267
+ unit: The unit for measurements this instrument reports. For
268
+ example, ``By`` for bytes. UCUM units are recommended.
269
+ description: A description for this instrument and what it measures.
270
+ """
239
271
240
272
@abstractmethod
241
273
def create_observable_up_down_counter (
242
274
self , name , callback , unit = "" , description = ""
243
275
) -> ObservableUpDownCounter :
244
- pass
276
+ """Creates an `ObservableUpDownCounter` instrument
277
+
278
+ Args:
279
+ name: The name of the instrument to be created
280
+ callback: A callback that returns an iterable of
281
+ :class:`~opentelemetry._metrics.measurement.Measurement`.
282
+ Alternatively, can be a generator that yields iterables of
283
+ :class:`~opentelemetry._metrics.measurement.Measurement`.
284
+ unit: The unit for measurements this instrument reports. For
285
+ example, ``By`` for bytes. UCUM units are recommended.
286
+ description: A description for this instrument and what it measures.
287
+ """
245
288
246
289
247
290
class _ProxyMeter (Meter ):
0 commit comments