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

Applnsights GetMetric not working using the telemetry client added by the SDK #2053

Open
stephenschwan opened this issue Dec 10, 2018 · 0 comments

Comments

@stephenschwan
Copy link

Please provide a succinct description of the issue.

Use the TrackMetric via MetricIdentifier. Metrics are not being published / not showing up in the app insights portal.

If you just use the ActiveTelemetry channel for example, it works as expected. But if you use the one registered via the SDK in the ServiceCollection, metrics are not collected.

Traces, dependencies and exceptions work as expected, just not metrics.

Provide the steps required to reproduce the problem

  1. Use the SDK to add App Insights
 .ConfigureLogging(loggingBuilder =>
{
        loggingBuilder.SetMinimumLevel(Extensions.Logging.LogLevel.Debug);
        loggingBuilder.AddApplicationInsights(options =>
        {
              options.InstrumentationKey = "....";
         });
})
  1. Use said telemetry client to track metrics
public virtual void TrackMetric(MetricIdentifier identifier, double value, string dimension1Value, string dimension2Value)
{
       Metric metric = GetClient().GetMetric(identifier);
       metric.TrackValue(value, dimension1Value, dimension2Value);
 }

Expected behavior

Metrics to be tracked

Actual behavior

Nothing is logged or visible in the AI portal

Known workarounds

Use your own telemetry client

Related information

Latest core webjob SDK / AI and latest .net core SDK

@stephenschwan stephenschwan changed the title Applnsights TrackMetric not working using the telemetry client added by the SDK Applnsights GetMetric not working using the telemetry client added by the SDK Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant