Skip to content

Commit eb7ee6d

Browse files
committed
callbacks
1 parent 4ae3cff commit eb7ee6d

File tree

2 files changed

+19
-19
lines changed
  • instrumentation/opentelemetry-instrumentation-system-metrics

2 files changed

+19
-19
lines changed

instrumentation/opentelemetry-instrumentation-system-metrics/setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ package_dir=
4040
=src
4141
packages=find_namespace:
4242
install_requires =
43-
opentelemetry-api ~= 1.10.0
44-
opentelemetry-sdk ~= 1.10.0
43+
opentelemetry-api == 1.10.0
44+
opentelemetry-sdk == 1.10.0
4545

4646
[options.extras_require]
4747
test =

instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -156,42 +156,42 @@ def _instrument(self, **kwargs):
156156
)
157157

158158
self._meter.create_observable_counter(
159-
callback=self._get_system_cpu_time,
159+
callbacks=[self._get_system_cpu_time],
160160
name="system.cpu.time",
161161
description="System CPU time",
162162
unit="seconds",
163163
)
164164

165165
self._meter.create_observable_gauge(
166-
callback=self._get_system_cpu_utilization,
166+
callbacks=[self._get_system_cpu_utilization],
167167
name="system.cpu.utilization",
168168
description="System CPU utilization",
169169
unit="1",
170170
)
171171

172172
self._meter.create_observable_gauge(
173-
callback=self._get_system_memory_usage,
173+
callbacks=[self._get_system_memory_usage],
174174
name="system.memory.usage",
175175
description="System memory usage",
176176
unit="bytes",
177177
)
178178

179179
self._meter.create_observable_gauge(
180-
callback=self._get_system_memory_utilization,
180+
callbacks=[self._get_system_memory_utilization],
181181
name="system.memory.utilization",
182182
description="System memory utilization",
183183
unit="1",
184184
)
185185

186186
self._meter.create_observable_gauge(
187-
callback=self._get_system_swap_usage,
187+
callbacks=[self._get_system_swap_usage],
188188
name="system.swap.usage",
189189
description="System swap usage",
190190
unit="pages",
191191
)
192192

193193
self._meter.create_observable_gauge(
194-
callback=self._get_system_swap_utilization,
194+
callbacks=[self._get_system_swap_utilization],
195195
name="system.swap.utilization",
196196
description="System swap utilization",
197197
unit="1",
@@ -217,21 +217,21 @@ def _instrument(self, **kwargs):
217217
# )
218218

219219
self._meter.create_observable_counter(
220-
callback=self._get_system_disk_io,
220+
callbacks=[self._get_system_disk_io],
221221
name="system.disk.io",
222222
description="System disk IO",
223223
unit="bytes",
224224
)
225225

226226
self._meter.create_observable_counter(
227-
callback=self._get_system_disk_operations,
227+
callbacks=[self._get_system_disk_operations],
228228
name="system.disk.operations",
229229
description="System disk operations",
230230
unit="operations",
231231
)
232232

233233
self._meter.create_observable_counter(
234-
callback=self._get_system_disk_time,
234+
callbacks=[self._get_system_disk_time],
235235
name="system.disk.time",
236236
description="System disk time",
237237
unit="seconds",
@@ -260,56 +260,56 @@ def _instrument(self, **kwargs):
260260
# OSs, how to do the same in Windows?
261261

262262
self._meter.create_observable_counter(
263-
callback=self._get_system_network_dropped_packets,
263+
callbacks=[self._get_system_network_dropped_packets],
264264
name="system.network.dropped_packets",
265265
description="System network dropped_packets",
266266
unit="packets",
267267
)
268268

269269
self._meter.create_observable_counter(
270-
callback=self._get_system_network_packets,
270+
callbacks=[self._get_system_network_packets],
271271
name="system.network.packets",
272272
description="System network packets",
273273
unit="packets",
274274
)
275275

276276
self._meter.create_observable_counter(
277-
callback=self._get_system_network_errors,
277+
callbacks=[self._get_system_network_errors],
278278
name="system.network.errors",
279279
description="System network errors",
280280
unit="errors",
281281
)
282282

283283
self._meter.create_observable_counter(
284-
callback=self._get_system_network_io,
284+
callbacks=[self._get_system_network_io],
285285
name="system.network.io",
286286
description="System network io",
287287
unit="bytes",
288288
)
289289

290290
self._meter.create_observable_up_down_counter(
291-
callback=self._get_system_network_connections,
291+
callbacks=[self._get_system_network_connections],
292292
name="system.network.connections",
293293
description="System network connections",
294294
unit="connections",
295295
)
296296

297297
self._meter.create_observable_counter(
298-
callback=self._get_runtime_memory,
298+
callbacks=[self._get_runtime_memory],
299299
name=f"runtime.{self._python_implementation}.memory",
300300
description=f"Runtime {self._python_implementation} memory",
301301
unit="bytes",
302302
)
303303

304304
self._meter.create_observable_counter(
305-
callback=self._get_runtime_cpu_time,
305+
callbacks=[self._get_runtime_cpu_time],
306306
name=f"runtime.{self._python_implementation}.cpu_time",
307307
description=f"Runtime {self._python_implementation} CPU time",
308308
unit="seconds",
309309
)
310310

311311
self._meter.create_observable_counter(
312-
callback=self._get_runtime_gc_count,
312+
callbacks=[self._get_runtime_gc_count],
313313
name=f"runtime.{self._python_implementation}.gc_count",
314314
description=f"Runtime {self._python_implementation} GC count",
315315
unit="bytes",

0 commit comments

Comments
 (0)