Skip to content

Commit

Permalink
Add TODO to replace ObservableGauge with ObservableUpDownCounter once…
Browse files Browse the repository at this point in the history
… it's available
  • Loading branch information
xiang17 committed Jun 9, 2022
1 parent 0ec7cab commit e3ae6a2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public RuntimeMetrics(RuntimeMetricsOptions options)

if (options.IsGcEnabled)
{
// TODO: Almost all the ObservableGauge should be ObservableUpDownCounter (except for CPU utilization and fragmentation.ratio.
// Replace them once ObservableUpDownCounter is available.
this.meter.CreateObservableGauge($"{metricPrefix}gc.heap", () => GC.GetTotalMemory(false), "By", "GC Heap Size");
this.meter.CreateObservableGauge($"{metricPrefix}gen_0-gc.count", () => GC.CollectionCount(0), description: "Gen 0 GC Count");
this.meter.CreateObservableGauge($"{metricPrefix}gen_1-gc.count", () => GC.CollectionCount(1), description: "Gen 1 GC Count");
Expand Down

0 comments on commit e3ae6a2

Please sign in to comment.