Skip to content

failed to translate metric from otel-python histogram using prometheusexporter #13443

@jaronoff97

Description

@jaronoff97

Seeing this error message:

otel-collector_1  | 2022-08-20T22:03:26.430Z	error	[email protected]/accumulator.go:105	failed to translate metric	{"kind": "exporter", "data_type": "metrics", "name": "prometheus", "data_type": "\u0000", "metric_name": "graphql.api.request.time"}
otel-collector_1  | github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*lastValueAccumulator).addMetric
otel-collector_1  | 	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/accumulator.go:105
otel-collector_1  | github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*lastValueAccumulator).Accumulate
otel-collector_1  | 	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/accumulator.go:82
otel-collector_1  | github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*collector).processMetrics
otel-collector_1  | 	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/collector.go:66
otel-collector_1  | github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter.(*prometheusExporter).ConsumeMetrics
otel-collector_1  | 	github.com/open-telemetry/opentelemetry-collector-contrib/exporter/[email protected]/prometheus.go:88

And it looks like this is due to a histogram metric being reported by the PeriodicExportingMetricReader exporting my histogram metric which hasn't had any data reported in the past period. Below is the output from a file exporter for some more debugging information. I believe this will be fixed by #9006 but let me know if that is incorrect.

Metrics dump
[
    {
        "resourceMetrics":
        [
            {
                "resource":
                {
                    "attributes":
                    [
                        {
                            "key": "telemetry.sdk.language",
                            "value":
                            {
                                "stringValue": "python"
                            }
                        },
                        {
                            "key": "telemetry.sdk.name",
                            "value":
                            {
                                "stringValue": "opentelemetry"
                            }
                        },
                        {
                            "key": "telemetry.sdk.version",
                            "value":
                            {
                                "stringValue": "1.12.0"
                            }
                        },
                        {
                            "key": "service.name",
                            "value":
                            {
                                "stringValue": "test"
                            }
                        }
                    ]
                },
                "scopeMetrics":
                [
                    {
                        "scope":
                        {
                            "name": "graphql-api",
                            "version": "1.0.0"
                        },
                        "metrics":
                        [
                            {
                                "name": "graphql.api.request.time",
                                "description": "Request time metrics for GraphQL API.",
                                "unit": "ms",
                                "histogram":
                                {
                                    "dataPoints":
                                    [
                                        {
                                            "attributes":
                                            [
                                                {
                                                    "key": "status",
                                                    "value":
                                                    {
                                                        "stringValue": "Success"
                                                    }
                                                }
                                            ],
                                            "startTimeUnixNano": "1660706168040247000",
                                            "timeUnixNano": "1660706170294892000",
                                            "count": "2",
                                            "sum": 0.0000030994415283203125,
                                            "bucketCounts":
                                            [
                                                "0",
                                                "2",
                                                "0",
                                                "0",
                                                "0",
                                                "0",
                                                "0",
                                                "0",
                                                "0",
                                                "0",
                                                "0"
                                            ],
                                            "explicitBounds":
                                            [
                                                0,
                                                5,
                                                10,
                                                25,
                                                50,
                                                75,
                                                100,
                                                250,
                                                500,
                                                1000
                                            ],
                                            "min": 0.0000011920928955078125,
                                            "max": 0.0000019073486328125
                                        }
                                    ],
                                    "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE"
                                }
                            },
                            {
                                "name": "graphql.api.requests",
                                "description": "Usage metrics for GraphQL API.",
                                "unit": "1",
                                "sum":
                                {
                                    "dataPoints":
                                    [
                                        {
                                            "attributes":
                                            [
                                                {
                                                    "key": "status",
                                                    "value":
                                                    {
                                                        "stringValue": "Success"
                                                    }
                                                }
                                            ],
                                            "startTimeUnixNano": "1660706168040307000",
                                            "timeUnixNano": "1660706170294892000",
                                            "asInt": "2"
                                        }
                                    ],
                                    "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE",
                                    "isMonotonic": true
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    },
    {
        "resourceMetrics":
        [
            {
                "resource":
                {
                    "attributes":
                    [
                        {
                            "key": "telemetry.sdk.language",
                            "value":
                            {
                                "stringValue": "python"
                            }
                        },
                        {
                            "key": "telemetry.sdk.name",
                            "value":
                            {
                                "stringValue": "opentelemetry"
                            }
                        },
                        {
                            "key": "telemetry.sdk.version",
                            "value":
                            {
                                "stringValue": "1.12.0"
                            }
                        },
                        {
                            "key": "service.name",
                            "value":
                            {
                                "stringValue": "test"
                            }
                        }
                    ]
                },
                "scopeMetrics":
                [
                    {
                        "scope":
                        {
                            "name": "graphql-api",
                            "version": "1.0.0"
                        },
                        "metrics":
                        [
                            {
                                "name": "graphql.api.request.time",
                                "description": "Request time metrics for GraphQL API.",
                                "unit": "ms"
                            },
                            {
                                "name": "graphql.api.requests",
                                "description": "Usage metrics for GraphQL API.",
                                "unit": "1",
                                "sum":
                                {
                                    "dataPoints":
                                    [
                                        {
                                            "attributes":
                                            [
                                                {
                                                    "key": "status",
                                                    "value":
                                                    {
                                                        "stringValue": "Success"
                                                    }
                                                }
                                            ],
                                            "startTimeUnixNano": "1660706168040307000",
                                            "timeUnixNano": "1660706185345493000",
                                            "asInt": "2"
                                        }
                                    ],
                                    "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE",
                                    "isMonotonic": true
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexporter/prometheusnever staleIssues marked with this label will be never staled and automatically removedpriority:p2Medium

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions