Skip to content

Otel metrics error when using api calls #27

Open
@Umaaz

Description

@Umaaz

Describe the bug
The error below is given when using the api to create tracepoints (_deep.register_tracepoint("simple_test.py", 41, metrics=[MetricDefinition("uuid_length", "histogram")])

2024-02-05 18:19:15,907 - deep - ERROR - Error registering metric histogram deep_uuid_length
Traceback (most recent call last):
  File "/home/bdonnell/repo/github/intergral/test-app-python/venv/lib/python3.10/site-packages/deep/api/plugin/metric/otel_metrics.py", line 107, in histogram
    histogram = self.__check_cache(name, 'histogram',
  File "/home/bdonnell/repo/github/intergral/test-app-python/venv/lib/python3.10/site-packages/deep/api/plugin/metric/otel_metrics.py", line 47, in __check_cache
    default = from_default()
  File "/home/bdonnell/repo/github/intergral/test-app-python/venv/lib/python3.10/site-packages/deep/api/plugin/metric/otel_metrics.py", line 108, in <lambda>
    lambda: get_meter('deep').create_histogram(f'{namespace}_{name}', unit,
  File "/home/bdonnell/repo/github/intergral/test-app-python/venv/lib/python3.10/site-packages/opentelemetry/sdk/metrics/_internal/__init__.py", line 193, in create_histogram
    ) = self._is_instrument_registered(name, _Histogram, unit, description)
  File "/home/bdonnell/repo/github/intergral/test-app-python/venv/lib/python3.10/site-packages/opentelemetry/metrics/_internal/__init__.py", line 225, in _is_instrument_registered
    instrument_id = ",".join(
TypeError: sequence item 2: expected str instance, NoneType found

To Reproduce
Steps to reproduce the behavior:

  1. Use the api deep.register_tracepoint to create a metric with just a name a type.
  2. See error

Expected behavior
A metric should be created with default values.

Desktop (please complete the following information):

  • Python Version [e.g. cpython 3.12] cpython 3.10.12

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions