Skip to content

Bug using CollectorMetricsExporter with Measure metric #704

Closed
@Jasopaum

Description

@Jasopaum

Describe your environment
Using Python 3.7 and opentelemetry-ext-otcollector and opentelemetry-sdk version 0.7b1.

Steps to reproduce

metrics.set_meter_provider(MeterProvider())
meter = metrics.get_meter(__name__, True)
exporter = CollectorMetricsExporter(
    endpoint="localhost:55678",
    service_name="basic-service",
)

PushController(meter, exporter, 1)

time_measure = meter.create_metric(
    name="test",
    description="test descr",
    unit="1",
    value_type=int,
    metric_type=Measure,
    label_keys=("service",),
)

time_measure.record(3, {"service": "timer"})
time.sleep(3)

time_measure.record(5, {"service": "timer"})
time.sleep(3)

What is the actual behavior?
This fails silently in the CollectorMetricsExporter.export() method.
I suspect that is comes from the get_collector_point() function which tries to set point.int64_value = metric_record.aggregator.checkpoint where point.int64_value should be an int (protobuf schema) but metric_record.aggregator.checkpoint is a minmaxsumcount tuple for a Measure metric.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions