-
Notifications
You must be signed in to change notification settings - Fork 906
Closed
Closed
Copy link
Labels
Description
Was trying this example but with this code instead:
from opentelemetry.metrics import set_meter_provider
from opentelemetry.instrumentation.system_metrics import SystemMetricsInstrumentor
from opentelemetry.sdk.metrics import MeterProvider
from opentelemetry.sdk.metrics.export import ConsoleMetricExporter, PeriodicExportingMetricReader
from time import sleep
exporter = ConsoleMetricExporter()
set_meter_provider(MeterProvider([PeriodicExportingMetricReader(exporter)]))
configuration = {
"system.memory.usage": ["used", "free", "cached"],
"system.cpu.time": ["idle", "user", "system", "irq"],
"system.network.io": ["trasmit", "receive"],
"runtime.memory": ["rss", "vms"],
"runtime.cpu.time": ["user", "system"],
}
SystemMetricsInstrumentor().instrument()
SystemMetricsInstrumentor(config=configuration).instrument()
# SystemMetricsInstrumentor().instrument()
sleep(0.1)Got these errors:
Attempting to instrument while already instrumented
Callback failed for instrument system.cpu.utilization.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 343, in _get_system_cpu_utilization
for metric in self._config["system.cpu.utilization"]:
KeyError: 'system.cpu.utilization'
Callback failed for instrument system.memory.utilization.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 371, in _get_system_memory_utilization
for metric in self._config["system.memory.utilization"]:
KeyError: 'system.memory.utilization'
Callback failed for instrument system.swap.usage.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 385, in _get_system_swap_usage
for metric in self._config["system.swap.usage"]:
KeyError: 'system.swap.usage'
Callback failed for instrument system.swap.utilization.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 399, in _get_system_swap_utilization
for metric in self._config["system.swap.utilization"]:
KeyError: 'system.swap.utilization'
Callback failed for instrument system.disk.io.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 412, in _get_system_disk_io
for metric in self._config["system.disk.io"]:
KeyError: 'system.disk.io'
Callback failed for instrument system.disk.operations.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 426, in _get_system_disk_operations
for metric in self._config["system.disk.operations"]:
KeyError: 'system.disk.operations'
Callback failed for instrument system.disk.time.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 440, in _get_system_disk_time
for metric in self._config["system.disk.time"]:
KeyError: 'system.disk.time'
Callback failed for instrument system.network.dropped_packets.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 473, in _get_system_network_dropped_packets
for metric in self._config["system.network.dropped.packets"]:
KeyError: 'system.network.dropped.packets'
Callback failed for instrument system.network.packets.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 493, in _get_system_network_packets
for metric in self._config["system.network.dropped.packets"]:
KeyError: 'system.network.dropped.packets'
Callback failed for instrument system.network.errors.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 508, in _get_system_network_errors
for metric in self._config["system.network.errors"]:
KeyError: 'system.network.errors'
Callback failed for instrument system.network.io.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 524, in _get_system_network_io
for metric in self._config["system.network.dropped.packets"]:
KeyError: 'system.network.dropped.packets'
Callback failed for instrument system.network.connections.
Traceback (most recent call last):
File "/home/ocelotl/github/ocelotl/opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/instrument.py", line 122, in callback
for api_measurement in callback(callback_options):
File "/home/ocelotl/github/ocelotl/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py", line 544, in _get_system_network_connections
for metric in self._config["system.network.connections"]:
KeyError: 'system.network.connections'
Reactions are currently unavailable