Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InfluxDB exporter: histogram records counts are not monotonic #2022

Open
Kernell opened this issue Aug 26, 2024 · 2 comments
Open

InfluxDB exporter: histogram records counts are not monotonic #2022

Kernell opened this issue Aug 26, 2024 · 2 comments
Assignees
Labels
bug Something isn't working comp:exporter.influxdb Things related to OpenTelemetry.Exporter.InfluxDB

Comments

@Kernell
Copy link

Kernell commented Aug 26, 2024

Component

OpenTelemetry.Exporter.InfluxDB

Package Version

Package Name Version
OpenTelemetry.Exporter.InfluxDB 1.0.0-alpha.3
OpenTelemetry.Extensions.Hosting 1.9.0
OpenTelemetry.Instrumentation.AspNetCore 1.9.0

Runtime Version

net6.0

Description

I'm trying to display data using InfluxDB UI like in this example that was generated using OpenTelemetry.Instrumentation.AspNetCore but I get an error "histogram records counts are not monotonic"

Other data in my database (imported using Scapers from Prometheus) displays correctly.

Steps to Reproduce

A simple application setup is sufficient:

IConfigurationSection section = configuration.GetSection("Metrics");

services.AddOpenTelemetry()
    .WithMetrics(builder => builder
        .AddAspNetCoreInstrumentation()
        .AddInfluxDBMetricsExporter(options =>
        {
            options.Org = section["Org"];
            options.Bucket = section["Bucket"];
            options.Token = section["Token"];
            options.Endpoint = new Uri(section["Endpoint"]);
            options.MetricsSchema = MetricsSchema.TelegrafPrometheusV2;
            options.MetricExportIntervalMilliseconds = 15000;
        }));

And the query that I send to InfluxDB:

import "experimental/prometheus"

from(bucket: "example-bucket")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "prometheus")
  |> filter(fn: (r) => r["_field"] == "http.server.request.duration_bucket")
  |> aggregateWindow(every: 1m, fn: mean, createEmpty: false)
  |> prometheus.histogramQuantile(quantile: 0.90)

Expected Result

I think the problem is in the incorrect saving of data. For example, currently the metrics http.server.request.duration_bucket, http.server.request.duration_sum and http.server.request.duration_count are separate fields, while Scapers in InfluxDB imports sum and count as tags for http_request_duration_seconds

Actual Result

histogram records counts are not monotonic

Additional Context

No response

@Kernell Kernell added the bug Something isn't working label Aug 26, 2024
@github-actions github-actions bot added the comp:exporter.influxdb Things related to OpenTelemetry.Exporter.InfluxDB label Aug 26, 2024
@Kielek
Copy link
Contributor

Kielek commented Aug 26, 2024

@Havret, could you please check?

@Havret
Copy link
Contributor

Havret commented Aug 28, 2024

@Kielek, I will take a look over the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working comp:exporter.influxdb Things related to OpenTelemetry.Exporter.InfluxDB
Projects
None yet
Development

No branches or pull requests

3 participants