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

Azure Monitor exporter does not export metric attributes #19407

Closed
bastbu opened this issue Mar 8, 2023 · 1 comment · Fixed by #20671
Closed

Azure Monitor exporter does not export metric attributes #19407

bastbu opened this issue Mar 8, 2023 · 1 comment · Fixed by #20671
Labels
bug Something isn't working exporter/azuremonitor

Comments

@bastbu
Copy link
Contributor

bastbu commented Mar 8, 2023

Component(s)

exporter/azuremonitor

What happened?

Description

The Azure Monitor exporter should export metric attributes as customDimensions. Currently it does not export metric attributes (dimensions) to Azure Monitor.

Steps to Reproduce

Run the following sample (slight variation of the getting started section from the OTel .NET docs):

public class Program
{
    private static readonly Meter MyMeter = new("OtelTest", "1.0");
    private static readonly Counter<long> MyFruitCounter = MyMeter.CreateCounter<long>("MyFruitCounter");

    public static void Main()
    {
        using var meterProvider = Sdk.CreateMeterProviderBuilder()
            .AddMeter("OtelTest")
            .AddOtlpExporter()
            .AddConsoleExporter()
            .Build();

        MyFruitCounter.Add(1, new("name", "apple"), new("color", "red"));
    }
}

Expected Result

The console exporter shows the information an expected result could contain:

Resource associated with Metric:
    service.name: unknown_service:oteltest

Export MyFruitCounter, Meter: OtelTest/1.0
(2023-03-08T17:09:25.3912339Z, 2023-03-08T17:09:25.7726745Z] color: red name: apple LongSum
Value: 1

Note the color: red name: apple snippet. Application Insights should contain the same information.

Actual Result

The information about the attributes cannot be found in Application Insights.

Collector version

0.72

Environment information

Environment

OS: WSL on Windows 11

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols: 
      grpc:
processors:
exporters:
  logging:
  azuremonitor:
    instrumentation_key: <redacted>
service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: []
      exporters: [logging,azuremonitor]
    metrics:
      receivers: [otlp]
      processors: []
      exporters: [logging,azuremonitor]
    logs:
      receivers: [otlp]
      processors: []
      exporters: [logging,azuremonitor]

Log output

No response

Additional context

No response

@bastbu bastbu added bug Something isn't working needs triage New item requiring triage labels Mar 8, 2023
@bastbu bastbu changed the title Azure Monitor exporter does not export Metric attributes Azure Monitor exporter does not export metric attributes Mar 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/azuremonitor
Projects
None yet
2 participants