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

[AzureMonitorDistro] Add ASP.NET Core and HTTP Client metrics instrumentation #42307

Merged
merged 27 commits into from
Mar 12, 2024

Conversation

rajkumar-rangaraj
Copy link
Contributor

Tested manually, here are the newly created metrics.

{"name":"Metric","time":"2024-03-01T00:05:55.4126545Z","iKey":"4e4f0c04-34e7-482a-afd8-e62965519134","tags":{"ai.cloud.role":"MyContainerName","ai.cloud.roleInstance":"InstanceName","ai.application.ver":"Version","ai.internal.sdkVersion":"dotnet7.0.16:otel1.7.0:ext1.3.0-alpha.20240229-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"http.server.request.duration","value":0.3668032,"count":1,"min":0.3668032,"max":0.3668032}],"properties":{"http.request.method":"GET","http.response.status_code":"200","http.route":"/","network.protocol.version":"2","url.scheme":"https"},"ver":2}}}
{"name":"Metric","time":"2024-03-01T00:05:55.4127852Z","iKey":"4e4f0c04-34e7-482a-afd8-e62965519134","tags":{"ai.cloud.role":"MyContainerName","ai.cloud.roleInstance":"InstanceName","ai.application.ver":"Version","ai.internal.sdkVersion":"dotnet7.0.16:otel1.7.0:ext1.3.0-alpha.20240229-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"http.client.request.duration","value":0.750741,"count":12,"min":0.0326394,"max":0.2660357}],"properties":{"http.request.method":"POST","http.response.status_code":"200","network.protocol.version":"1.1","server.address":"westus2.livediagnostics.monitor.azure.com","url.scheme":"https"},"ver":2}}}
{"name":"Metric","time":"2024-03-01T00:05:55.4127852Z","iKey":"4e4f0c04-34e7-482a-afd8-e62965519134","tags":{"ai.cloud.role":"MyContainerName","ai.cloud.roleInstance":"InstanceName","ai.application.ver":"Version","ai.internal.sdkVersion":"dotnet7.0.16:otel1.7.0:ext1.3.0-alpha.20240229-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"http.client.request.duration","value":0.0255622,"count":1,"min":0.0255622,"max":0.0255622}],"properties":{"http.request.method":"GET","http.response.status_code":"200","network.protocol.version":"1.1","server.address":"localhost","server.port":"58384","url.scheme":"http"},"ver":2}}}
{"name":"Metric","time":"2024-03-01T00:05:55.4127852Z","iKey":"4e4f0c04-34e7-482a-afd8-e62965519134","tags":{"ai.cloud.role":"MyContainerName","ai.cloud.roleInstance":"InstanceName","ai.application.ver":"Version","ai.internal.sdkVersion":"dotnet7.0.16:otel1.7.0:ext1.3.0-alpha.20240229-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"http.client.request.duration","value":0.189538,"count":1,"min":0.189538,"max":0.189538}],"properties":{"http.request.method":"GET","http.response.status_code":"200","network.protocol.version":"1.1","server.address":"www.bing.com","url.scheme":"https"},"ver":2}}}
{"name":"Metric","time":"2024-03-01T00:05:55.4127852Z","iKey":"4e4f0c04-34e7-482a-afd8-e62965519134","tags":{"ai.cloud.role":"MyContainerName","ai.cloud.roleInstance":"InstanceName","ai.application.ver":"Version","ai.internal.sdkVersion":"dotnet7.0.16:otel1.7.0:ext1.3.0-alpha.20240229-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"http.client.request.duration","value":0.2169672,"count":2,"min":0.0424652,"max":0.174502}],"properties":{"http.request.method":"POST","http.response.status_code":"200","network.protocol.version":"1.1","server.address":"westus2-2.in.applicationinsights.azure.com","url.scheme":"https"},"ver":2}}}
{"name":"Metric","time":"2024-03-01T00:05:55.4279697Z","iKey":"4e4f0c04-34e7-482a-afd8-e62965519134","tags":{"ai.cloud.role":"unknown_service:Azure.Monitor.OpenTelemetry.AspNetCore.Demo","ai.cloud.roleInstance":"DESKTOP-FF9NSGP","ai.application.ver":null,"ai.internal.sdkVersion":"dotnet7.0.16:otel1.7.0:ext1.3.0-alpha.20240229-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"requests/duration","value":366.8032,"count":1,"min":366.8032,"max":366.8032}],"properties":{"_MS.IsAutocollected":"True","_MS.MetricId":"requests/duration","cloud/roleInstance":"InstanceName","cloud/roleName":"MyContainerName","Request.Success":"True","request/resultCode":"200"},"ver":2}}}
{"name":"Metric","time":"2024-03-01T00:05:55.4279734Z","iKey":"4e4f0c04-34e7-482a-afd8-e62965519134","tags":{"ai.cloud.role":"unknown_service:Azure.Monitor.OpenTelemetry.AspNetCore.Demo","ai.cloud.roleInstance":"DESKTOP-FF9NSGP","ai.application.ver":null,"ai.internal.sdkVersion":"dotnet7.0.16:otel1.7.0:ext1.3.0-alpha.20240229-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"dependencies/duration","value":25.5622,"count":1,"min":25.5622,"max":25.5622}],"properties":{"_MS.IsAutocollected":"True","_MS.MetricId":"dependencies/duration","cloud/roleInstance":"InstanceName","cloud/roleName":"MyContainerName","Dependency.Success":"True","Dependency.Type":"Http","dependency/resultCode":"200","dependency/target":"localhost:58384"},"ver":2}}}
{"name":"Metric","time":"2024-03-01T00:05:55.4279734Z","iKey":"4e4f0c04-34e7-482a-afd8-e62965519134","tags":{"ai.cloud.role":"unknown_service:Azure.Monitor.OpenTelemetry.AspNetCore.Demo","ai.cloud.roleInstance":"DESKTOP-FF9NSGP","ai.application.ver":null,"ai.internal.sdkVersion":"dotnet7.0.16:otel1.7.0:ext1.3.0-alpha.20240229-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"dependencies/duration","value":189.538,"count":1,"min":189.538,"max":189.538}],"properties":{"_MS.IsAutocollected":"True","_MS.MetricId":"dependencies/duration","cloud/roleInstance":"InstanceName","cloud/roleName":"MyContainerName","Dependency.Success":"True","Dependency.Type":"Http","dependency/resultCode":"200","dependency/target":"www.bing.com"},"ver":2}}}

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

Copy link
Contributor

@TimothyMothra TimothyMothra left a comment

Choose a reason for hiding this comment

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

LGTM. left a comment about fixing formatting of Readme

TimothyMothra and others added 3 commits March 11, 2024 13:35
Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>
TimothyMothra and others added 4 commits March 12, 2024 11:23
Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>
Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>
Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>
Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>
@TimothyMothra TimothyMothra enabled auto-merge (squash) March 12, 2024 18:59
@TimothyMothra TimothyMothra merged commit c7f5717 into Azure:main Mar 12, 2024
16 checks passed
angiurgiu pushed a commit that referenced this pull request Mar 20, 2024
…entation (#42307)

* Add ASP.NET Core and HTTP Client metrics instrumentation

* Changelog update

* Update .NET 8.0 and above to use built-in meter.

* Update readme

* readme - swich doc to use new api.

* Update sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md

* Update sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md

Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>

* Update README.md

* Update README.md

* Update sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md

Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>

* Update README.md

* Update README.md

* Update README.md

* Update OpenTelemetryBuilderExtensions.cs

* Update sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md

Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>

* Update README.md

* Update README.md

* Update sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md

Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>

* Update sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md

Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>

* Update sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md

Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>

* Update sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/README.md

Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>

---------

Co-authored-by: Timothy Mothra <tilee@microsoft.com>
Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Monitor - Distro Monitor OpenTelemetry Distro
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants