Skip to content

Add aspnet metric example#3033

Merged
cijothomas merged 6 commits into
open-telemetry:mainfrom
vishweshbankwar:vibankwa/add-aspnet-metrics-example
Mar 12, 2022
Merged

Add aspnet metric example#3033
cijothomas merged 6 commits into
open-telemetry:mainfrom
vishweshbankwar:vibankwa/add-aspnet-metrics-example

Conversation

@vishweshbankwar

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Mar 11, 2022

Copy link
Copy Markdown

Codecov Report

Merging #3033 (7a13bd3) into main (3af5a3b) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3033      +/-   ##
==========================================
+ Coverage   84.70%   84.72%   +0.02%     
==========================================
  Files         258      258              
  Lines        9095     9095              
==========================================
+ Hits         7704     7706       +2     
+ Misses       1391     1389       -2     
Impacted Files Coverage Δ
...tation/OpenTelemetryProtocolExporterEventSource.cs 85.00% <0.00%> (+10.00%) ⬆️

Comment thread examples/AspNet/Global.asax.cs
@vishweshbankwar vishweshbankwar marked this pull request as ready for review March 11, 2022 22:30
@vishweshbankwar vishweshbankwar requested a review from a team March 11, 2022 22:30
exporterOptions.Targets = ConsoleExporterOutputTargets.Debug;

// The ConsoleMetricExporter defaults to a manual collect cycle.
// This configuration causes metrics to be exported to stdout on a 10s interval.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given #2982 is merged, we can simplify the code here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @alanwest, IIRC you plan to remove the MetricReaderType entirely?


var meterBuilder = Sdk.CreateMeterProviderBuilder()
.AddAspNetInstrumentation()
.AddHttpClientInstrumentation();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HttpClient for .NET FW don't produce metrics as of today, so its best to remove this line to avoid confusion. We can add it when httpclient starts having some metrics.

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

Successfully merging this pull request may close these issues.

3 participants