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

[Instrumentation.Runtime] Add a metric for total paused duration in GC for .NET 7 and greater versions #1239

Merged
merged 5 commits into from
Jun 16, 2023

Conversation

xiang17
Copy link
Contributor

@xiang17 xiang17 commented Jun 15, 2023

Fixes #1163.

Changes

Add a new metric for total paused duration in GC process.runtime.dotnet.gc.duration with data from GC.GetTotalPauseDuration Method.

It is recommended over the time-in-gc EventCounter in the Well-known EventCounters in .NET.

The metrics would show in the output of Prometheus Exporter HttpListener (for how to set it up, follow this getting-started guide) like this:

# TYPE process_runtime_dotnet_gc_duration_ns counter
# UNIT process_runtime_dotnet_gc_duration_ns ns
# HELP process_runtime_dotnet_gc_duration_ns The total amount of time paused in GC since the process start.
process_runtime_dotnet_gc_duration_ns 8860000 1686806670504

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

@xiang17 xiang17 requested a review from a team June 15, 2023 05:33
@github-actions github-actions bot requested a review from twenzel June 15, 2023 05:33
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Merging #1239 (3821fba) into main (dbfeaea) will decrease coverage by 0.62%.
The diff coverage is 100.00%.

❗ Current head 3821fba differs from pull request most recent head 2cedbec. Consider uploading reports for the commit 2cedbec to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1239      +/-   ##
==========================================
- Coverage   73.61%   72.99%   -0.62%     
==========================================
  Files         265      265              
  Lines        9346     9287      -59     
==========================================
- Hits         6880     6779     -101     
- Misses       2466     2508      +42     
Impacted Files Coverage Δ
...ry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs 70.03% <ø> (-4.52%) ⬇️
...elemetry.Instrumentation.Runtime/RuntimeMetrics.cs 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@xiang17 xiang17 changed the title [Instrumentation.Runtime] Add a metric for total paused duration in GC [Instrumentation.Runtime] Add a metric for total paused duration in GC for .NET 7 and greater versions Jun 15, 2023
@Kielek Kielek merged commit 326d071 into open-telemetry:main Jun 16, 2023
@xiang17 xiang17 deleted the xiang17/time-in-gc branch September 7, 2023 00:21
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.

Runtime instrumentation: Can time-in-gc metric be published ?
4 participants