Skip to content

metrics: ints are not recorded #2079

@ajsaclayan

Description

@ajsaclayan

Description

Hi OpenTelemetry community,
I'm seeing weird behavior when generating Int64Counter as well as Int64ValueObservers. When viewing the metrics, the value is not recorded.

Environment

  • OS: Windows
  • Architecture: 64 bit
  • Go Version: 1.16
  • otel/metric: v0.21.0
  • otel/sdk/metric: v0.21.0

Steps To Reproduce

Running a local kind cluster running v0.29.0 of opentelemetry-collector. The collector is configured to write to a file to view metrics.

  1. Initialize a metric provider and OTLP exporter, pointing to the local collector
  2. Generate int counter/gauge metrics to be exported to local collector.
    intcounter example:
intCounter := metric.Must(a.meter).
		NewInt64Counter(
			"IntSumMetric",
			metric.WithDescription("Int sum metric"),
		).Bind(a.commonLabels...)
	
intCounter.Add(a.context, rand.Int63n(10))
  1. Run application
  2. View metric in exporter

Expected behavior

The sum recorded should have a value between 0-10. No value is recorded and the metric has the object doubleSum.

{
    "name": "IntSumMetric",
    "description": "Int sum metric",
    "doubleSum": {
        "dataPoints": [
            {
                "labels": [
                    {
                        "key": "dropped_label_count",
                        "value": "0"
                    }
                ],
                "startTimeUnixNano": "1625085629239312300",
                "timeUnixNano": "1625086409244676700"
            }
        ],
        "aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE",
        "isMonotonic": true
    }
},

I've also viewed the metrics in another exporter (New Relic) where the metric values are not recorded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:metricsPart of OpenTelemetry MetricsbugSomething isn't workingpkg:exporter:otlpRelated to the OTLP exporter package

    Type

    No type

    Projects

    Status

    Closed

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions