Skip to content

[Instrumentation.AspNet] Fix metric http.server.duration always being zero - #1425

Merged
Kielek merged 8 commits into
open-telemetry:mainfrom
qhris:bugfix/http-server-duration
Nov 6, 2023
Merged

[Instrumentation.AspNet] Fix metric http.server.duration always being zero#1425
Kielek merged 8 commits into
open-telemetry:mainfrom
qhris:bugfix/http-server-duration

Conversation

@qhris

@qhris qhris commented Nov 3, 2023

Copy link
Copy Markdown
Contributor

Fixes a bug introduced in #1388 as mentioned by @vishweshbankwar.

Changes

  • Explicitly set the end duration of the activity before onRequestStoppedCallback is called.
  • Updated tests to catch this in the future.

For significant contributions please make sure you have completed the following items:

  • Appropriate CHANGELOG.md updated for non-trivial changes

@codecov

codecov Bot commented Nov 3, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1425 (4947b6d) into main (71655ce) will decrease coverage by 2.80%.
Report is 48 commits behind head on main.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1425      +/-   ##
==========================================
- Coverage   73.91%   71.11%   -2.80%     
==========================================
  Files         267       13     -254     
  Lines        9615      277    -9338     
==========================================
- Hits         7107      197    -6910     
+ Misses       2508       80    -2428     
Flag Coverage Δ
unittests-Instrumentation.AspNet 71.11% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ation.AspNet.TelemetryHttpModule/ActivityHelper.cs 85.71% <100.00%> (+0.46%) ⬆️

... and 250 files with indirect coverage changes

@qhris
qhris marked this pull request as ready for review November 3, 2023 10:51
@qhris
qhris requested a review from a team November 3, 2023 10:51
@utpilla utpilla added the comp:instrumentation.aspnet Things related to OpenTelemetry.Instrumentation.AspNet label Nov 3, 2023
Comment thread src/OpenTelemetry.Instrumentation.AspNet/CHANGELOG.md Outdated
Comment thread test/OpenTelemetry.Instrumentation.AspNet.Tests/HttpInMetricsListenerTests.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:instrumentation.aspnet Things related to OpenTelemetry.Instrumentation.AspNet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants