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

[bug] Custom metrics tags are not exported to InfluxDb #2362

Open
Chuprinenko opened this issue Dec 5, 2024 · 1 comment
Open

[bug] Custom metrics tags are not exported to InfluxDb #2362

Chuprinenko opened this issue Dec 5, 2024 · 1 comment
Labels
bug Something isn't working comp:exporter.influxdb Things related to OpenTelemetry.Exporter.InfluxDB

Comments

@Chuprinenko
Copy link

Component

OpenTelemetry.Exporter.InfluxDB

Package Version

Package Name Version
OpenTelemetry 1.10.0
OpenTelemetry.Exporter.InfluxDB 1.0.0-alpha.4

Runtime Version

net48

Description

I'm adding a tag to a metric, but when exporting it to influx db I can't see it anywhere

Steps to Reproduce

using OpenTelemetry;
using OpenTelemetry.Exporter.InfluxDB;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;
using System;
using System.Diagnostics;
using System.Diagnostics.Metrics;

namespace Telemetry
{
	internal class Program
	{
		static void Main(string[] args)
		{
			const int sendMetricsFrequencyMilliseconds = 1000;
			TagList globalTags = new TagList
			{
				{ "TestTag", "Test tag value" },
			};

			using var meter = new Meter("TestMetric", null, globalTags);
			var counter = meter.CreateCounter<long>("test-counter");

			var metricsProvider = Sdk.CreateMeterProviderBuilder()
									 .AddMeter("TestMetric")
									.AddInfluxDBMetricsExporter(exporterOptions =>
									{
										exporterOptions.MetricExportIntervalMilliseconds = sendMetricsFrequencyMilliseconds;
										exporterOptions.Org = "-";
										exporterOptions.Bucket = "TestMetrics";
										exporterOptions.Token = "";
										exporterOptions.Endpoint = new Uri("http://localhost:8086");
										exporterOptions.MetricsSchema = MetricsSchema.TelegrafPrometheusV2;
									})
									.Build();

			counter.Add(10);
			metricsProvider.Dispose();
		}
	}
}

Expected Result

See added tag "TestTag" with value "Test tag value" in the influx db database.

Actual Result

No tag "TestTag"
image

Additional Context

No response

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

github-actions bot commented Dec 5, 2024

Tagging component owner(s).

@Havret

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

1 participant