From 8d3779451b1b70bceb2c4d6b36db236519629aeb Mon Sep 17 00:00:00 2001 From: xiang17 Date: Tue, 7 Jun 2022 12:41:06 -0700 Subject: [PATCH 01/15] Add description doc for .NET Runtime metrics --- .../description.md | 193 ++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 src/OpenTelemetry.Instrumentation.Runtime/description.md diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md new file mode 100644 index 0000000000..318d92179a --- /dev/null +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -0,0 +1,193 @@ +# Runtime metrics description + +Metrics name are prefixed with the `process.runtime.dotnet.` namespace, following +the general guidance for runtime metrics in the +[specs](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/runtime-environment-metrics.md#runtime-environment-specific-metrics---processruntimeenvironment). +Instrument Units [should follow](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/README.md#instrument-units) +the Unified Code for Units of Measure. + +## GC related metrics + +The metrics in this section can be enabled by setting the +`RuntimeMetricsOptions.IsGcEnabled` switch. + +| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | +|-----------------------------------------------|--------------------------|-----------|---------------------------------------------------|------------|------------------|------------------| +| process.runtime.dotnet.**gc.totalmemorysize** | Total allocated bytes | `By` | ObservableGauge | `Int64` | | | +| process.runtime.dotnet.**gc.count** | Garbage Collection count | `{times}` | ObservableCounter | `Int64` | gen | gen0, gen1, gen2 | + +Question for .NET team: is GC.GetTotalMemory(false) always equal to the sum of GC.GetGCMemoryInfo().GenerationInfo[i].SizeAfterBytes (i from 0 to 4)? + +I need to decide whether it makes sense to include both of them in the memory/GC size metrics. + +- [GC.GetTotalMemory](https://docs.microsoft.com/dotnet/api/system.gc.gettotalmemory): +The number of bytes currently thought to be allocated. +It does not wait for garbage collection to occur before returning. + +- [GC.CollectionCount](https://docs.microsoft.com/dotnet/api/system.gc.collectioncount): +The number of times garbage collection has occurred for the specified generation +of objects. + +### Additional GC metrics only available for NETCOREAPP3_1_OR_GREATER + +| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | +|----------------------------------------------------|--------------------------------------------------|-------|---------------------------------------------------|---------------------|------------------|------------------| +| process.runtime.dotnet.**gc.allocated.bytes** | Bytes allocated over the lifetime of the process | `By` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**gc.fragmentation.ratio** | GC fragmentation ratio | `1` | ObservableGauge | `Double` | | | + +- [GC.GetTotalAllocatedBytes](https://docs.microsoft.com/dotnet/api/system.gc.gettotalallocatedbytes): + Gets a count of the bytes allocated over the lifetime of the process. The returned +value does not include any native allocations. The value is an approximate count. + +- GC fragmentation ratio is calculated as: +If `GC.GetGCMemoryInfo().HeapSizeBytes != 0`, +the value is +`GC.GetGCMemoryInfo().FragmentedBytes * 1.0d / GC.GetGCMemoryInfo().HeapSizeBytes`, +otherwise the value is `0`. + + - [GCMemoryInfo.FragmentedBytes](https://docs.microsoft.com/dotnet/api/system.gcmemoryinfo.fragmentedbytes?view=netcore-3.1): + Gets the total fragmentation when the last garbage collection occurred. + - [GCMemoryInfo.HeapSizeBytes](https://docs.microsoft.com/dotnet/api/system.gcmemoryinfo.heapsizebytes?view=netcore-3.1#system-gcmemoryinfo-heapsizebytes): + Gets the total heap size when the last garbage collection occurred. + +### Additional GC metrics only available for NET6_0_OR_GREATER + +| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | +|-----------------------------------------|--------------------|-------|---------------------------------------------------|------------|------------------|----------------------------| +| process.runtime.dotnet.**gc.committed** | GC Committed Bytes | `By` | ObservableGauge | `Int64` | | | +| process.runtime.dotnet.**gc.heapsize** | | `By` | ObservableGauge | `Int64` | gen | gen0, gen1, gen2, loh, poh | + +- [GCMemoryInfo.TotalCommittedBytes](https://docs.microsoft.com/dotnet/api/system.gcmemoryinfo.totalcommittedbytes?view=net-6.0#system-gcmemoryinfo-totalcommittedbytes): +Gets the total committed bytes of the managed heap. + +- [GC.GetGCMemoryInfo().GenerationInfo[i].SizeAfterBytes](https://docs.microsoft.com/dotnet/api/system.gcgenerationinfo): +Represents the size in bytes of a generation on exit of the GC reported in GCMemoryInfo. +(The number of generations `i` is limited by [GC.MaxGeneration](https://docs.microsoft.com/dotnet/api/system.gc.maxgeneration)) + +## JIT Compiler related metrics + +The metrics in this section can be enabled by setting the +`RuntimeMetricsOptions.IsJitEnabled` switch. + +These metrics are only available for NET6_0_OR_GREATER. + +| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | +|-------------------------------------------------|--------------------------|-------------|---------------------------------------------------|------------|------------------|------------------| +| process.runtime.dotnet.**il.bytes.jitted** | IL Bytes Jitted | `By` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**methods.jitted.count** | Number of Methods Jitted | `{methods}` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**time.in.jit** | Time spent in JIT | `ms` | ObservableCounter | `Double` | | | + +[JitInfo.GetCompiledILBytes](https://docs.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompiledilbytes?view=net-6.0#system-runtime-jitinfo-getcompiledilbytes(system-boolean)): +Gets the number of bytes of intermediate language that have been compiled. +The scope of this value is global. + +[JitInfo.GetCompiledMethodCount](https://docs.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompiledmethodcount?view=net-6.0#system-runtime-jitinfo-getcompiledmethodcount(system-boolean)): +Gets the number of methods that have been compiled. +The scope of this value is global. + +[JitInfo.GetCompilationTime](https://docs.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompilationtime?view=net-6.0#system-runtime-jitinfo-getcompilationtime(system-boolean)): +Gets the amount of time the JIT Compiler has spent compiling methods. +The scope of this value is global. + +## Threading related metrics + +The metrics in this section can be enabled by setting the +`RuntimeMetricsOptions.IsThreadingEnabled` switch. + +These metrics are only available for NETCOREAPP3_1_OR_GREATER. + +| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | +|-------------------------------------------------------------|--------------------------------------|-------------|---------------------------------------------------|------------|------------------|------------------| +| process.runtime.dotnet.**monitor.lock.contention.count** | Monitor Lock Contention Count | `{times}` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**threadpool.thread.count** | ThreadPool Thread Count | `{threads}` | ObservableGauge | `Int32` | | | +| process.runtime.dotnet.**threadpool.completed.items.count** | ThreadPool Completed Work Item Count | `{items}` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**threadpool.queue.length** | ThreadPool Queue Length | `{items}` | ObservableGauge | `Int64` | | | +| process.runtime.dotnet.**active.timer.count** | Number of Active Timers | `{timers}` | ObservableGauge | `Int64` | | | + +- [Monitor.LockContentionCount](https://docs.microsoft.com/dotnet/api/system.threading.monitor.lockcontentioncount?view=netcore-3.1): + Gets the number of times there was contention when trying to take the monitor's + lock. +- [ThreadPool.ThreadCount](https://docs.microsoft.com/dotnet/api/system.threading.threadpool.threadcount?view=netcore-3.1): + Gets the number of thread pool threads that currently exist. +- [ThreadPool.CompletedWorkItemCount](https://docs.microsoft.com/dotnet/api/system.threading.threadpool.completedworkitemcount?view=netcore-3.1): + Gets the number of work items that have been processed so far. +- [ThreadPool.PendingWorkItemCount](https://docs.microsoft.com/dotnet/api/system.threading.threadpool.pendingworkitemcount?view=netcore-3.1): + Gets the number of work items that are currently queued to be processed. +- [Timer.ActiveCount](https://docs.microsoft.com/dotnet/api/system.threading.timer.activecount?view=netcore-3.1): + Gets the number of timers that are currently active. An active timer is registered + to tick at some point in the future, and has not yet been canceled. + +## Process related metrics + +The metrics in this section can be enabled by setting the +`RuntimeMetricsOptions.IsProcessEnabled` switch. + +| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | +|-------------------------|----------------------------------------|----------------|---------------------------------------------------|------------|------------------|---------------------------------------------| +| process.cpu.utilization | CPU utilization of this process | `1` | ObservableGauge | `Double` | | | +| process.cpu.time | Processor time of this process | `s` | ObservableCounter | `Int64` | type | TotalProcessorTime, PrivilegedProcessorTime | +| process.cpu.count | The number of available logical CPUs | `{processors}` | ObservableGauge | `Int64` | | | +| process.memory.usage | The amount of physical memory in use | `By` | ObservableGauge | `Int64` | | | +| process.memory.virtual | The amount of committed virtual memory | `By` | ObservableGauge | `Int64` | | | + +- CPU utilization + - [Process.TotalProcessorTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.totalprocessortime) + divided by ([Environment.ProcessorCount](https://docs.microsoft.com/dotnet/api/system.environment.processorcount) + \* ([DateTime.Now](https://docs.microsoft.com/dotnet/api/system.datetime.now) - + [Process.StartTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.starttime))) + +- CPU Time: + - [Process.TotalProcessorTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.totalprocessortime): + Gets the total processor time for this process. + - [Process.PrivilegedProcessorTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.privilegedprocessortime): + Gets the privileged processor time for this process. + +- [Environment.ProcessorCount](https://docs.microsoft.com/dotnet/api/system.environment.processorcount): + Gets the number of processors available to the current process. +- Memory usage: [Process.GetCurrentProcess().WorkingSet64](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.workingset64): + Gets the amount of physical memory, in bytes, allocated for the currently + active process. +- Memory virtual: [Process.GetCurrentProcess().VirtualMemorySize64](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.virtualmemorysize64): + Gets the amount of the virtual memory, in bytes, allocated for the currently + active process. + +Question: EventCounter implementation exposes a metric named `working-set` with +`Environment.WorkingSet`. Compared to `Process.GetCurrentProcess().WorkingSet64` +property, which is more suitable for showing users the memory usage for the process? + +- [Environment.WorkingSet](https://docs.microsoft.com/en-us/dotnet/api/system.environment.workingset?view=net-6.0): + A 64-bit signed integer containing the number of bytes of physical memory mapped to the process context. + +## Assemblies related metrics + +The metrics in this section can be enabled by setting the +`RuntimeMetricsOptions.IsAssembliesEnabled` switch. + +| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | +|-------------------------------------------|-----------------------------|----------------|---------------------------------------------------|------------|------------------|------------------| +| process.runtime.dotnet.**assembly.count** | Number of Assemblies Loaded | `{assemblies}` | ObservableCounter | `Int64` | | | + +- [AppDomain.GetAssemblies](https://docs.microsoft.com/dotnet/api/system.appdomain.getassemblies): + Gets the number of the assemblies that have been loaded into the execution context + of this application domain. + +## Exception counter metric + +The metrics in this section can be enabled by setting the +`RuntimeMetricsOptions.IsExceptionCounterEnabled` switch. + +| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | +|--------------------------------------------|--------------------------------------------|------------|---------------------------------------------------|------------|------------------|------------------| +| process.runtime.dotnet.**exception.count** | Number of exception thrown in managed code | `{timers}` | ObservableCounter | `Int64` | | | + +- [AppDomain.FirstChanceException](https://docs.microsoft.com/dotnet/api/system.appdomain.firstchanceexception) + Occurs when an exception is thrown in managed code, before the runtime searches + the call stack for an exception handler in the application domain. + +## Currently out of scope + +Regarding process.runtime.dotnet.**time-in-gc**: (DisplayName in [EventCounter implementation](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/RuntimeEventSource.cs#L96) +is "% Time in GC since last GC".) A new metric should replace it by calling a new API GC.GetTotalPauseDuration(). +The new API is added in code but not available yet. +It is targeted for 7.0.0 milestone in .NET Runtime repo. +See [dotnet/runtime#65989](https://github.com/dotnet/runtime/issues/65989) From f3c049015c1d97aac3111ee678571e2e07edbe46 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Tue, 7 Jun 2022 12:49:00 -0700 Subject: [PATCH 02/15] Reword question. Wrap lines. --- .../description.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index 318d92179a..c01f6ba2cc 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -16,9 +16,11 @@ The metrics in this section can be enabled by setting the | process.runtime.dotnet.**gc.totalmemorysize** | Total allocated bytes | `By` | ObservableGauge | `Int64` | | | | process.runtime.dotnet.**gc.count** | Garbage Collection count | `{times}` | ObservableCounter | `Int64` | gen | gen0, gen1, gen2 | -Question for .NET team: is GC.GetTotalMemory(false) always equal to the sum of GC.GetGCMemoryInfo().GenerationInfo[i].SizeAfterBytes (i from 0 to 4)? +Question for .NET team: is GC.GetTotalMemory(false) always equal to the sum of +GC.GetGCMemoryInfo().GenerationInfo[i].SizeAfterBytes (i from 0 to 4)? -I need to decide whether it makes sense to include both of them in the memory/GC size metrics. +I need to decide whether it makes sense to include both of them in the memory/GC +size metrics. - [GC.GetTotalMemory](https://docs.microsoft.com/dotnet/api/system.gc.gettotalmemory): The number of bytes currently thought to be allocated. @@ -152,11 +154,13 @@ The metrics in this section can be enabled by setting the active process. Question: EventCounter implementation exposes a metric named `working-set` with -`Environment.WorkingSet`. Compared to `Process.GetCurrentProcess().WorkingSet64` -property, which is more suitable for showing users the memory usage for the process? +`Environment.WorkingSet`. Is it equal to `Process.GetCurrentProcess().WorkingSet64` +property? I need to decide on which is more suitable for showing users the memory +usage for the process, or whether to include both. - [Environment.WorkingSet](https://docs.microsoft.com/en-us/dotnet/api/system.environment.workingset?view=net-6.0): - A 64-bit signed integer containing the number of bytes of physical memory mapped to the process context. + A 64-bit signed integer containing the number of bytes of physical memory mapped + to the process context. ## Assemblies related metrics @@ -187,7 +191,8 @@ The metrics in this section can be enabled by setting the ## Currently out of scope Regarding process.runtime.dotnet.**time-in-gc**: (DisplayName in [EventCounter implementation](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/RuntimeEventSource.cs#L96) -is "% Time in GC since last GC".) A new metric should replace it by calling a new API GC.GetTotalPauseDuration(). +is "% Time in GC since last GC".) A new metric should replace it by calling a new +API GC.GetTotalPauseDuration(). The new API is added in code but not available yet. It is targeted for 7.0.0 milestone in .NET Runtime repo. See [dotnet/runtime#65989](https://github.com/dotnet/runtime/issues/65989) From 6e6c3159be4a0a96cdcceaece7110ae1a38dafff Mon Sep 17 00:00:00 2001 From: xiang17 Date: Tue, 7 Jun 2022 16:33:54 -0700 Subject: [PATCH 03/15] Update table --- .../description.md | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index c01f6ba2cc..68930872a7 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -11,10 +11,10 @@ the Unified Code for Units of Measure. The metrics in this section can be enabled by setting the `RuntimeMetricsOptions.IsGcEnabled` switch. -| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | -|-----------------------------------------------|--------------------------|-----------|---------------------------------------------------|------------|------------------|------------------| -| process.runtime.dotnet.**gc.totalmemorysize** | Total allocated bytes | `By` | ObservableGauge | `Int64` | | | -| process.runtime.dotnet.**gc.count** | Garbage Collection count | `{times}` | ObservableCounter | `Int64` | gen | gen0, gen1, gen2 | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|-----------------------------------------------|--------------------------|-----------|-------------------|------------|------------------|------------------| +| process.runtime.dotnet.**gc.totalmemorysize** | Total allocated bytes | `By` | ObservableGauge | `Int64` | | | +| process.runtime.dotnet.**gc.count** | Garbage Collection count | `{times}` | ObservableCounter | `Int64` | gen | gen0, gen1, gen2 | Question for .NET team: is GC.GetTotalMemory(false) always equal to the sum of GC.GetGCMemoryInfo().GenerationInfo[i].SizeAfterBytes (i from 0 to 4)? @@ -32,10 +32,10 @@ of objects. ### Additional GC metrics only available for NETCOREAPP3_1_OR_GREATER -| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | -|----------------------------------------------------|--------------------------------------------------|-------|---------------------------------------------------|---------------------|------------------|------------------| -| process.runtime.dotnet.**gc.allocated.bytes** | Bytes allocated over the lifetime of the process | `By` | ObservableCounter | `Int64` | | | -| process.runtime.dotnet.**gc.fragmentation.ratio** | GC fragmentation ratio | `1` | ObservableGauge | `Double` | | | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|---------------------------------------------------|--------------------------------------------------|-------|-------------------|------------|------------------|------------------| +| process.runtime.dotnet.**gc.allocated.bytes** | Bytes allocated over the lifetime of the process | `By` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**gc.fragmentation.ratio** | GC fragmentation ratio | `1` | ObservableGauge | `Double` | | | - [GC.GetTotalAllocatedBytes](https://docs.microsoft.com/dotnet/api/system.gc.gettotalallocatedbytes): Gets a count of the bytes allocated over the lifetime of the process. The returned @@ -54,10 +54,10 @@ otherwise the value is `0`. ### Additional GC metrics only available for NET6_0_OR_GREATER -| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | -|-----------------------------------------|--------------------|-------|---------------------------------------------------|------------|------------------|----------------------------| -| process.runtime.dotnet.**gc.committed** | GC Committed Bytes | `By` | ObservableGauge | `Int64` | | | -| process.runtime.dotnet.**gc.heapsize** | | `By` | ObservableGauge | `Int64` | gen | gen0, gen1, gen2, loh, poh | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|-----------------------------------------|--------------------|-------|-----------------|------------|------------------|----------------------------| +| process.runtime.dotnet.**gc.committed** | GC Committed Bytes | `By` | ObservableGauge | `Int64` | | | +| process.runtime.dotnet.**gc.heapsize** | | `By` | ObservableGauge | `Int64` | gen | gen0, gen1, gen2, loh, poh | - [GCMemoryInfo.TotalCommittedBytes](https://docs.microsoft.com/dotnet/api/system.gcmemoryinfo.totalcommittedbytes?view=net-6.0#system-gcmemoryinfo-totalcommittedbytes): Gets the total committed bytes of the managed heap. @@ -73,11 +73,11 @@ The metrics in this section can be enabled by setting the These metrics are only available for NET6_0_OR_GREATER. -| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | -|-------------------------------------------------|--------------------------|-------------|---------------------------------------------------|------------|------------------|------------------| -| process.runtime.dotnet.**il.bytes.jitted** | IL Bytes Jitted | `By` | ObservableCounter | `Int64` | | | -| process.runtime.dotnet.**methods.jitted.count** | Number of Methods Jitted | `{methods}` | ObservableCounter | `Int64` | | | -| process.runtime.dotnet.**time.in.jit** | Time spent in JIT | `ms` | ObservableCounter | `Double` | | | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|-------------------------------------------------|--------------------------|-------------|-------------------|------------|------------------|------------------| +| process.runtime.dotnet.**il.bytes.jitted** | IL Bytes Jitted | `By` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**methods.jitted.count** | Number of Methods Jitted | `{methods}` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**time.in.jit** | Time spent in JIT | `ms` | ObservableCounter | `Double` | | | [JitInfo.GetCompiledILBytes](https://docs.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompiledilbytes?view=net-6.0#system-runtime-jitinfo-getcompiledilbytes(system-boolean)): Gets the number of bytes of intermediate language that have been compiled. @@ -98,13 +98,13 @@ The metrics in this section can be enabled by setting the These metrics are only available for NETCOREAPP3_1_OR_GREATER. -| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | -|-------------------------------------------------------------|--------------------------------------|-------------|---------------------------------------------------|------------|------------------|------------------| -| process.runtime.dotnet.**monitor.lock.contention.count** | Monitor Lock Contention Count | `{times}` | ObservableCounter | `Int64` | | | -| process.runtime.dotnet.**threadpool.thread.count** | ThreadPool Thread Count | `{threads}` | ObservableGauge | `Int32` | | | -| process.runtime.dotnet.**threadpool.completed.items.count** | ThreadPool Completed Work Item Count | `{items}` | ObservableCounter | `Int64` | | | -| process.runtime.dotnet.**threadpool.queue.length** | ThreadPool Queue Length | `{items}` | ObservableGauge | `Int64` | | | -| process.runtime.dotnet.**active.timer.count** | Number of Active Timers | `{timers}` | ObservableGauge | `Int64` | | | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|-------------------------------------------------------------|--------------------------------------|-------------|-------------------|------------|------------------|------------------| +| process.runtime.dotnet.**monitor.lock.contention.count** | Monitor Lock Contention Count | `{times}` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**threadpool.thread.count** | ThreadPool Thread Count | `{threads}` | ObservableGauge | `Int32` | | | +| process.runtime.dotnet.**threadpool.completed.items.count** | ThreadPool Completed Work Item Count | `{items}` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**threadpool.queue.length** | ThreadPool Queue Length | `{items}` | ObservableGauge | `Int64` | | | +| process.runtime.dotnet.**active.timer.count** | Number of Active Timers | `{timers}` | ObservableGauge | `Int64` | | | - [Monitor.LockContentionCount](https://docs.microsoft.com/dotnet/api/system.threading.monitor.lockcontentioncount?view=netcore-3.1): Gets the number of times there was contention when trying to take the monitor's @@ -124,13 +124,13 @@ These metrics are only available for NETCOREAPP3_1_OR_GREATER. The metrics in this section can be enabled by setting the `RuntimeMetricsOptions.IsProcessEnabled` switch. -| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | -|-------------------------|----------------------------------------|----------------|---------------------------------------------------|------------|------------------|---------------------------------------------| -| process.cpu.utilization | CPU utilization of this process | `1` | ObservableGauge | `Double` | | | -| process.cpu.time | Processor time of this process | `s` | ObservableCounter | `Int64` | type | TotalProcessorTime, PrivilegedProcessorTime | -| process.cpu.count | The number of available logical CPUs | `{processors}` | ObservableGauge | `Int64` | | | -| process.memory.usage | The amount of physical memory in use | `By` | ObservableGauge | `Int64` | | | -| process.memory.virtual | The amount of committed virtual memory | `By` | ObservableGauge | `Int64` | | | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|-------------------------|----------------------------------------|----------------|-------------------|------------|------------------|---------------------------------------------| +| process.cpu.utilization | CPU utilization of this process | `1` | ObservableGauge | `Double` | | | +| process.cpu.time | Processor time of this process | `s` | ObservableCounter | `Int64` | type | TotalProcessorTime, PrivilegedProcessorTime | +| process.cpu.count | The number of available logical CPUs | `{processors}` | ObservableGauge | `Int64` | | | +| process.memory.usage | The amount of physical memory in use | `By` | ObservableGauge | `Int64` | | | +| process.memory.virtual | The amount of committed virtual memory | `By` | ObservableGauge | `Int64` | | | - CPU utilization - [Process.TotalProcessorTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.totalprocessortime) @@ -167,9 +167,9 @@ usage for the process, or whether to include both. The metrics in this section can be enabled by setting the `RuntimeMetricsOptions.IsAssembliesEnabled` switch. -| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | -|-------------------------------------------|-----------------------------|----------------|---------------------------------------------------|------------|------------------|------------------| -| process.runtime.dotnet.**assembly.count** | Number of Assemblies Loaded | `{assemblies}` | ObservableCounter | `Int64` | | | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|-------------------------------------------|-----------------------------|----------------|-------------------|------------|------------------|------------------| +| process.runtime.dotnet.**assembly.count** | Number of Assemblies Loaded | `{assemblies}` | ObservableCounter | `Int64` | | | - [AppDomain.GetAssemblies](https://docs.microsoft.com/dotnet/api/system.appdomain.getassemblies): Gets the number of the assemblies that have been loaded into the execution context @@ -180,9 +180,9 @@ The metrics in this section can be enabled by setting the The metrics in this section can be enabled by setting the `RuntimeMetricsOptions.IsExceptionCounterEnabled` switch. -| Name | Description | Units | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | -|--------------------------------------------|--------------------------------------------|------------|---------------------------------------------------|------------|------------------|------------------| -| process.runtime.dotnet.**exception.count** | Number of exception thrown in managed code | `{timers}` | ObservableCounter | `Int64` | | | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|--------------------------------------------|--------------------------------------------|------------|-------------------|------------|------------------|------------------| +| process.runtime.dotnet.**exception.count** | Number of exception thrown in managed code | `{timers}` | ObservableCounter | `Int64` | | | - [AppDomain.FirstChanceException](https://docs.microsoft.com/dotnet/api/system.appdomain.firstchanceexception) Occurs when an exception is thrown in managed code, before the runtime searches From ace08858dd3534502efcb2538485a2ca2c24a9e2 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Tue, 7 Jun 2022 16:49:58 -0700 Subject: [PATCH 04/15] Update unit for `time.in.jit` --- src/OpenTelemetry.Instrumentation.Runtime/description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index 68930872a7..9f6ca9e3cc 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -77,7 +77,7 @@ These metrics are only available for NET6_0_OR_GREATER. |-------------------------------------------------|--------------------------|-------------|-------------------|------------|------------------|------------------| | process.runtime.dotnet.**il.bytes.jitted** | IL Bytes Jitted | `By` | ObservableCounter | `Int64` | | | | process.runtime.dotnet.**methods.jitted.count** | Number of Methods Jitted | `{methods}` | ObservableCounter | `Int64` | | | -| process.runtime.dotnet.**time.in.jit** | Time spent in JIT | `ms` | ObservableCounter | `Double` | | | +| process.runtime.dotnet.**time.in.jit** | Time spent in JIT | `ns` | ObservableCounter | `Double` | | | [JitInfo.GetCompiledILBytes](https://docs.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompiledilbytes?view=net-6.0#system-runtime-jitinfo-getcompiledilbytes(system-boolean)): Gets the number of bytes of intermediate language that have been compiled. From 284cc17f3e8ede0c5acb8a8438126d49d45ecb30 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Wed, 8 Jun 2022 00:12:00 -0700 Subject: [PATCH 05/15] Update attributes for process.cpu.time to user, system --- .../description.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index 9f6ca9e3cc..ece7a29c78 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -124,13 +124,13 @@ These metrics are only available for NETCOREAPP3_1_OR_GREATER. The metrics in this section can be enabled by setting the `RuntimeMetricsOptions.IsProcessEnabled` switch. -| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | -|-------------------------|----------------------------------------|----------------|-------------------|------------|------------------|---------------------------------------------| -| process.cpu.utilization | CPU utilization of this process | `1` | ObservableGauge | `Double` | | | -| process.cpu.time | Processor time of this process | `s` | ObservableCounter | `Int64` | type | TotalProcessorTime, PrivilegedProcessorTime | -| process.cpu.count | The number of available logical CPUs | `{processors}` | ObservableGauge | `Int64` | | | -| process.memory.usage | The amount of physical memory in use | `By` | ObservableGauge | `Int64` | | | -| process.memory.virtual | The amount of committed virtual memory | `By` | ObservableGauge | `Int64` | | | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|-------------------------|----------------------------------------|----------------|-------------------|------------|------------------|------------------| +| process.cpu.utilization | CPU utilization of this process | `1` | ObservableGauge | `Double` | | | +| process.cpu.time | Processor time of this process | `s` | ObservableCounter | `Int64` | type | user, system | +| process.cpu.count | The number of available logical CPUs | `{processors}` | ObservableGauge | `Int64` | | | +| process.memory.usage | The amount of physical memory in use | `By` | ObservableGauge | `Int64` | | | +| process.memory.virtual | The amount of committed virtual memory | `By` | ObservableGauge | `Int64` | | | - CPU utilization - [Process.TotalProcessorTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.totalprocessortime) @@ -139,8 +139,8 @@ The metrics in this section can be enabled by setting the [Process.StartTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.starttime))) - CPU Time: - - [Process.TotalProcessorTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.totalprocessortime): - Gets the total processor time for this process. + - [Process.UserProcessorTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.userprocessortime): + Gets the user processor time for this process. - [Process.PrivilegedProcessorTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.privilegedprocessortime): Gets the privileged processor time for this process. From 0e406289aa48b5a35d4d6cca1bd4fbb2ac635359 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Wed, 8 Jun 2022 00:13:43 -0700 Subject: [PATCH 06/15] Update attribute key for process.cpu.time to state --- src/OpenTelemetry.Instrumentation.Runtime/description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index ece7a29c78..8a0b49e9ed 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -127,7 +127,7 @@ The metrics in this section can be enabled by setting the | Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | |-------------------------|----------------------------------------|----------------|-------------------|------------|------------------|------------------| | process.cpu.utilization | CPU utilization of this process | `1` | ObservableGauge | `Double` | | | -| process.cpu.time | Processor time of this process | `s` | ObservableCounter | `Int64` | type | user, system | +| process.cpu.time | Processor time of this process | `s` | ObservableCounter | `Int64` | state | user, system | | process.cpu.count | The number of available logical CPUs | `{processors}` | ObservableGauge | `Int64` | | | | process.memory.usage | The amount of physical memory in use | `By` | ObservableGauge | `Int64` | | | | process.memory.virtual | The amount of committed virtual memory | `By` | ObservableGauge | `Int64` | | | From d5ff66a7d9b7fa8e032de56ae9ff8c14d6fcfcd9 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Wed, 8 Jun 2022 00:21:07 -0700 Subject: [PATCH 07/15] Update GC fragmentation ratio calculation to clarify that gcMemoryInfo is retrieved once to get the two values. --- src/OpenTelemetry.Instrumentation.Runtime/description.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index 8a0b49e9ed..7bd56c4ad0 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -42,10 +42,10 @@ of objects. value does not include any native allocations. The value is an approximate count. - GC fragmentation ratio is calculated as: -If `GC.GetGCMemoryInfo().HeapSizeBytes != 0`, +If `gcMemoryInfo.HeapSizeBytes != 0`, the value is -`GC.GetGCMemoryInfo().FragmentedBytes * 1.0d / GC.GetGCMemoryInfo().HeapSizeBytes`, -otherwise the value is `0`. +`gcMemoryInfo.FragmentedBytes * 1.0d / gcMemoryInfo.HeapSizeBytes`, +otherwise the value is `0`, where `var gcMemoryInfo = GC.GetGCMemoryInfo()`. - [GCMemoryInfo.FragmentedBytes](https://docs.microsoft.com/dotnet/api/system.gcmemoryinfo.fragmentedbytes?view=netcore-3.1): Gets the total fragmentation when the last garbage collection occurred. From f976606cee520135f9f280001afef3d5a385154d Mon Sep 17 00:00:00 2001 From: xiang17 Date: Wed, 8 Jun 2022 11:54:35 -0700 Subject: [PATCH 08/15] Fix a value type for `time.in.jit` --- src/OpenTelemetry.Instrumentation.Runtime/description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index 7bd56c4ad0..b813fa1322 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -77,7 +77,7 @@ These metrics are only available for NET6_0_OR_GREATER. |-------------------------------------------------|--------------------------|-------------|-------------------|------------|------------------|------------------| | process.runtime.dotnet.**il.bytes.jitted** | IL Bytes Jitted | `By` | ObservableCounter | `Int64` | | | | process.runtime.dotnet.**methods.jitted.count** | Number of Methods Jitted | `{methods}` | ObservableCounter | `Int64` | | | -| process.runtime.dotnet.**time.in.jit** | Time spent in JIT | `ns` | ObservableCounter | `Double` | | | +| process.runtime.dotnet.**time.in.jit** | Time spent in JIT | `ns` | ObservableCounter | `Int64` | | | [JitInfo.GetCompiledILBytes](https://docs.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompiledilbytes?view=net-6.0#system-runtime-jitinfo-getcompiledilbytes(system-boolean)): Gets the number of bytes of intermediate language that have been compiled. From 2c10b72b6f2c2c5bcc50c4e22f2a2d5d1836d01c Mon Sep 17 00:00:00 2001 From: xiang17 Date: Wed, 8 Jun 2022 13:58:12 -0700 Subject: [PATCH 09/15] Update CHANGELOG.md --- src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md index 23727004ed..6a02230d5f 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* Fix some bugs in Runtime metrics +([#409](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/409)) + ## 0.1.0-alpha.1 * This is the first release of `OpenTelemetry.Instrumentation.Runtime` package. From 53628cf34fc04a21428508eb617d9a611d68280d Mon Sep 17 00:00:00 2001 From: xiang17 Date: Wed, 8 Jun 2022 14:07:56 -0700 Subject: [PATCH 10/15] Revert "Update CHANGELOG.md" This reverts commit 2c10b72b6f2c2c5bcc50c4e22f2a2d5d1836d01c. --- src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md index 6a02230d5f..23727004ed 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md @@ -2,9 +2,6 @@ ## Unreleased -* Fix some bugs in Runtime metrics -([#409](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/409)) - ## 0.1.0-alpha.1 * This is the first release of `OpenTelemetry.Instrumentation.Runtime` package. From 8bccfa364f53adda498f12b016ca16b7a807d747 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Tue, 14 Jun 2022 17:02:57 -0700 Subject: [PATCH 11/15] Removing `gc.totalmemorysize` because it is duplicate and can be calculated from gc.heapsize --- .../description.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index b813fa1322..3cde4766b1 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -13,19 +13,8 @@ The metrics in this section can be enabled by setting the | Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | |-----------------------------------------------|--------------------------|-----------|-------------------|------------|------------------|------------------| -| process.runtime.dotnet.**gc.totalmemorysize** | Total allocated bytes | `By` | ObservableGauge | `Int64` | | | | process.runtime.dotnet.**gc.count** | Garbage Collection count | `{times}` | ObservableCounter | `Int64` | gen | gen0, gen1, gen2 | -Question for .NET team: is GC.GetTotalMemory(false) always equal to the sum of -GC.GetGCMemoryInfo().GenerationInfo[i].SizeAfterBytes (i from 0 to 4)? - -I need to decide whether it makes sense to include both of them in the memory/GC -size metrics. - -- [GC.GetTotalMemory](https://docs.microsoft.com/dotnet/api/system.gc.gettotalmemory): -The number of bytes currently thought to be allocated. -It does not wait for garbage collection to occur before returning. - - [GC.CollectionCount](https://docs.microsoft.com/dotnet/api/system.gc.collectioncount): The number of times garbage collection has occurred for the specified generation of objects. From 04a63ef7dc8ee13033d94da6fe21abe2cb65ceab Mon Sep 17 00:00:00 2001 From: xiang17 Date: Tue, 14 Jun 2022 18:00:21 -0700 Subject: [PATCH 12/15] Change `gc.fragmentation.ratio` to `gc.fragmentation.size` --- .../description.md | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index 3cde4766b1..8342993b2d 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -21,25 +21,17 @@ of objects. ### Additional GC metrics only available for NETCOREAPP3_1_OR_GREATER -| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | -|---------------------------------------------------|--------------------------------------------------|-------|-------------------|------------|------------------|------------------| -| process.runtime.dotnet.**gc.allocated.bytes** | Bytes allocated over the lifetime of the process | `By` | ObservableCounter | `Int64` | | | -| process.runtime.dotnet.**gc.fragmentation.ratio** | GC fragmentation ratio | `1` | ObservableGauge | `Double` | | | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|--------------------------------------------------|--------------------------------------------------|-------|-------------------|------------|------------------|----------------------------| +| process.runtime.dotnet.**gc.allocated.bytes** | Bytes allocated over the lifetime of the process | `By` | ObservableCounter | `Int64` | | | +| process.runtime.dotnet.**gc.fragmentation.size** | GC fragmentation size | `By` | ObservableGauge | `Int64` | gen | gen0, gen1, gen2, loh, poh | - [GC.GetTotalAllocatedBytes](https://docs.microsoft.com/dotnet/api/system.gc.gettotalallocatedbytes): Gets a count of the bytes allocated over the lifetime of the process. The returned value does not include any native allocations. The value is an approximate count. -- GC fragmentation ratio is calculated as: -If `gcMemoryInfo.HeapSizeBytes != 0`, -the value is -`gcMemoryInfo.FragmentedBytes * 1.0d / gcMemoryInfo.HeapSizeBytes`, -otherwise the value is `0`, where `var gcMemoryInfo = GC.GetGCMemoryInfo()`. - - - [GCMemoryInfo.FragmentedBytes](https://docs.microsoft.com/dotnet/api/system.gcmemoryinfo.fragmentedbytes?view=netcore-3.1): - Gets the total fragmentation when the last garbage collection occurred. - - [GCMemoryInfo.HeapSizeBytes](https://docs.microsoft.com/dotnet/api/system.gcmemoryinfo.heapsizebytes?view=netcore-3.1#system-gcmemoryinfo-heapsizebytes): - Gets the total heap size when the last garbage collection occurred. + - [GCGenerationInfo.FragmentationAfterBytes Property](https://docs.microsoft.com/dotnet/api/system.gcgenerationinfo.fragmentationafterbytes#system-gcgenerationinfo-fragmentationafterbytes) + Gets the fragmentation in bytes on exit from the reported collection. ### Additional GC metrics only available for NET6_0_OR_GREATER From 1f058c6bbf4b64befc29b2e8798bc5eb50c46687 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Tue, 14 Jun 2022 18:00:47 -0700 Subject: [PATCH 13/15] Remove reference for `GC.MaxGeneration` --- src/OpenTelemetry.Instrumentation.Runtime/description.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index 8342993b2d..2ea4578007 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -45,7 +45,6 @@ Gets the total committed bytes of the managed heap. - [GC.GetGCMemoryInfo().GenerationInfo[i].SizeAfterBytes](https://docs.microsoft.com/dotnet/api/system.gcgenerationinfo): Represents the size in bytes of a generation on exit of the GC reported in GCMemoryInfo. -(The number of generations `i` is limited by [GC.MaxGeneration](https://docs.microsoft.com/dotnet/api/system.gc.maxgeneration)) ## JIT Compiler related metrics From 33c5ee9f8843405c495225a38e17003b369aff24 Mon Sep 17 00:00:00 2001 From: xiang17 Date: Tue, 14 Jun 2022 18:02:42 -0700 Subject: [PATCH 14/15] Remove `process.cpu.count` --- src/OpenTelemetry.Instrumentation.Runtime/description.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index 2ea4578007..4e591c1e6e 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -108,7 +108,6 @@ The metrics in this section can be enabled by setting the |-------------------------|----------------------------------------|----------------|-------------------|------------|------------------|------------------| | process.cpu.utilization | CPU utilization of this process | `1` | ObservableGauge | `Double` | | | | process.cpu.time | Processor time of this process | `s` | ObservableCounter | `Int64` | state | user, system | -| process.cpu.count | The number of available logical CPUs | `{processors}` | ObservableGauge | `Int64` | | | | process.memory.usage | The amount of physical memory in use | `By` | ObservableGauge | `Int64` | | | | process.memory.virtual | The amount of committed virtual memory | `By` | ObservableGauge | `Int64` | | | @@ -124,8 +123,6 @@ The metrics in this section can be enabled by setting the - [Process.PrivilegedProcessorTime](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.privilegedprocessortime): Gets the privileged processor time for this process. -- [Environment.ProcessorCount](https://docs.microsoft.com/dotnet/api/system.environment.processorcount): - Gets the number of processors available to the current process. - Memory usage: [Process.GetCurrentProcess().WorkingSet64](https://docs.microsoft.com/dotnet/api/system.diagnostics.process.workingset64): Gets the amount of physical memory, in bytes, allocated for the currently active process. From c68f86e60166cb04f4291d3af51d4ef5183a780f Mon Sep 17 00:00:00 2001 From: xiang17 Date: Tue, 14 Jun 2022 18:04:32 -0700 Subject: [PATCH 15/15] Update instrument type for `assembly.count` to `ObservableGauge` because it can decrease --- src/OpenTelemetry.Instrumentation.Runtime/description.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Runtime/description.md b/src/OpenTelemetry.Instrumentation.Runtime/description.md index 4e591c1e6e..a7441ac7ec 100644 --- a/src/OpenTelemetry.Instrumentation.Runtime/description.md +++ b/src/OpenTelemetry.Instrumentation.Runtime/description.md @@ -144,9 +144,9 @@ usage for the process, or whether to include both. The metrics in this section can be enabled by setting the `RuntimeMetricsOptions.IsAssembliesEnabled` switch. -| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | -|-------------------------------------------|-----------------------------|----------------|-------------------|------------|------------------|------------------| -| process.runtime.dotnet.**assembly.count** | Number of Assemblies Loaded | `{assemblies}` | ObservableCounter | `Int64` | | | +| Name | Description | Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values | +|-------------------------------------------|-----------------------------|----------------|-----------------|------------|------------------|------------------| +| process.runtime.dotnet.**assembly.count** | Number of Assemblies Loaded | `{assemblies}` | ObservableGauge | `Int64` | | | - [AppDomain.GetAssemblies](https://docs.microsoft.com/dotnet/api/system.appdomain.getassemblies): Gets the number of the assemblies that have been loaded into the execution context