|
| 1 | +# `.net 5.0` metrics |
| 2 | + |
| 3 | +Each subheading details the metrics produced by calling builder methods with the specified `CaptureLevel`. |
| 4 | + |
| 5 | +## Default metrics |
| 6 | + |
| 7 | +Metrics that are included by default, regardless of what stats collectors are enabled. |
| 8 | + |
| 9 | +| Name | Type | Description | Labels | |
| 10 | +| ------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | |
| 11 | +| `dotnet_build_info` | `Gauge` | Build information about prometheus\-net.DotNetRuntime and the environment | `version`, `target_framework`, `runtime_version`, `os_version`, `process_architecture`, `gc_mode` | |
| 12 | +| `dotnet_internal_recycle_count` | `Counter` | prometheus\-net.DotNetRuntime internal metric. Counts the number of times the underlying event listeners have been recycled | | |
| 13 | +| `process_cpu_count` | `Gauge` | The number of processor cores available to this process. | | |
| 14 | + |
| 15 | +## `.WithJitStats()` |
| 16 | + |
| 17 | +Include metrics summarizing the volume of methods being compiled |
| 18 | + by the Just\-In\-Time compiler. |
| 19 | + |
| 20 | +### `CaptureLevel.Counters` |
| 21 | + |
| 22 | +| Name | Type | Description | Labels | |
| 23 | +| ------------------------- | --------- | ---------------------------------------------------- | ------ | |
| 24 | +| `dotnet_jit_il_bytes` | `Gauge` | Total bytes of IL compiled by the JIT compiler | | |
| 25 | +| `dotnet_jit_method_total` | `Counter` | Total number of methods compiled by the JIT compiler | | |
| 26 | + |
| 27 | +### `CaptureLevel.Verbose` |
| 28 | + |
| 29 | +Includes metrics generated by `CaptureLevel.Counters` plus: |
| 30 | + |
| 31 | +| Name | Type | Description | Labels | |
| 32 | +| --------------------------------- | --------- | ------------------------------------------------------------------------------------------------- | --------- | |
| 33 | +| `dotnet_jit_cpu_ratio` | `Gauge` | The amount of total CPU time consumed spent JIT'ing | | |
| 34 | +| `dotnet_jit_method_total` | `Counter` | Total number of methods compiled by the JIT compiler, broken down by compilation for dynamic code | `dynamic` | |
| 35 | +| `dotnet_jit_method_seconds_total` | `Counter` | Total number of seconds spent in the JIT compiler, broken down by compilation for dynamic code | `dynamic` | |
| 36 | + |
| 37 | +## `.WithGcStats()` |
| 38 | + |
| 39 | +Include metrics recording the frequency and duration of garbage collections\/ pauses, heap sizes and |
| 40 | + volume of allocations. |
| 41 | + |
| 42 | +### `CaptureLevel.Counters` |
| 43 | + |
| 44 | +| Name | Type | Description | Labels | |
| 45 | +| ---------------------------------------- | --------- | ---------------------------------------------------------------------------------------------- | --------------- | |
| 46 | +| `dotnet_gc_allocated_bytes_total` | `Counter` | The total number of bytes allocated on the managed heap | | |
| 47 | +| `dotnet_gc_collection_count_total` | `Counter` | Counts the number of garbage collections that have occurred, broken down by generation number. | `gc_generation` | |
| 48 | +| `dotnet_gc_memory_total_available_bytes` | `Gauge` | The upper limit on the amount of physical memory .NET can allocate to | | |
| 49 | +| `dotnet_gc_pause_ratio` | `Gauge` | The percentage of time the process spent paused for garbage collection | | |
| 50 | +| `dotnet_gc_heap_size_bytes` | `Gauge` | The current size of all heaps (only updated after a garbage collection) | `gc_generation` | |
| 51 | + |
| 52 | +### `CaptureLevel.Informational` |
| 53 | + |
| 54 | +Includes metrics generated by `CaptureLevel.Counters` plus: |
| 55 | + |
| 56 | +| Name | Type | Description | Labels | |
| 57 | +| ------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | |
| 58 | +| `dotnet_gc_pause_seconds` | `Histogram` | The amount of time execution was paused for garbage collection | | |
| 59 | +| `dotnet_gc_cpu_ratio` | `Gauge` | The percentage of process CPU time spent running garbage collections | | |
| 60 | +| `dotnet_gc_collection_count_total` | `Counter` | Counts the number of garbage collections that have occurred, broken down by generation number and the reason for the collection. | `gc_generation`, `gc_reason` | |
| 61 | +| `dotnet_gc_collection_seconds` | `Histogram` | The amount of time spent running garbage collections | `gc_generation`, `gc_type` | |
| 62 | +| `dotnet_gc_finalization_queue_length` | `Gauge` | The number of objects waiting to be finalized | | |
| 63 | +| `dotnet_gc_pinned_objects` | `Gauge` | The number of pinned objects | | |
| 64 | + |
| 65 | +### `CaptureLevel.Verbose` |
| 66 | + |
| 67 | +Includes metrics generated by `CaptureLevel.Counters`, `CaptureLevel.Informational` plus: |
| 68 | + |
| 69 | +| Name | Type | Description | Labels | |
| 70 | +| --------------------------------- | --------- | ------------------------------------------------------- | --------- | |
| 71 | +| `dotnet_gc_allocated_bytes_total` | `Counter` | The total number of bytes allocated on the managed heap | `gc_heap` | |
| 72 | + |
| 73 | +## `.WithExceptionStats()` |
| 74 | + |
| 75 | +Include metrics that measure the number of exceptions thrown. |
| 76 | + |
| 77 | +### `CaptureLevel.Counters` |
| 78 | + |
| 79 | +| Name | Type | Description | Labels | |
| 80 | +| ------------------------- | --------- | -------------------------- | ------ | |
| 81 | +| `dotnet_exceptions_total` | `Counter` | Count of exceptions thrown | | |
| 82 | + |
| 83 | +### `CaptureLevel.Errors` |
| 84 | + |
| 85 | +Includes metrics generated by `CaptureLevel.Counters` plus: |
| 86 | + |
| 87 | +| Name | Type | Description | Labels | |
| 88 | +| ------------------------- | --------- | ----------------------------------------------- | ------ | |
| 89 | +| `dotnet_exceptions_total` | `Counter` | Count of exceptions thrown, broken down by type | `type` | |
| 90 | + |
| 91 | +## `.WithContentionStats()` |
| 92 | + |
| 93 | +Include metrics around volume of locks contended. |
| 94 | + |
| 95 | +### `CaptureLevel.Counters` |
| 96 | + |
| 97 | +| Name | Type | Description | Labels | |
| 98 | +| ------------------------- | --------- | ----------------------------- | ------ | |
| 99 | +| `dotnet_contention_total` | `Counter` | The number of locks contended | | |
| 100 | + |
| 101 | +### `CaptureLevel.Informational` |
| 102 | + |
| 103 | +Includes metrics generated by `CaptureLevel.Counters` plus: |
| 104 | + |
| 105 | +| Name | Type | Description | Labels | |
| 106 | +| --------------------------------- | --------- | ----------------------------------------------- | ------ | |
| 107 | +| `dotnet_contention_seconds_total` | `Counter` | The total amount of time spent contending locks | | |
| 108 | + |
| 109 | +## `.WithThreadPoolStats()` |
| 110 | + |
| 111 | +Include metrics around the size of the worker and IO thread pools and reasons |
| 112 | + for worker thread pool changes. |
| 113 | + |
| 114 | +### `CaptureLevel.Counters` |
| 115 | + |
| 116 | +| Name | Type | Description | Labels | |
| 117 | +| ------------------------------------ | ----------- | ----------------------------------------------------------------------------------------------------------------------------- | ------ | |
| 118 | +| `dotnet_threadpool_queue_length` | `Histogram` | Measures the queue length of the thread pool. Values greater than 0 indicate a backlog of work for the threadpool to process. | | |
| 119 | +| `dotnet_threadpool_timer_count` | `Gauge` | The number of timers active | | |
| 120 | +| `dotnet_threadpool_throughput_total` | `Counter` | The total number of work items that have finished execution in the thread pool | | |
| 121 | +| `dotnet_threadpool_num_threads` | `Gauge` | The number of active threads in the thread pool | | |
| 122 | + |
| 123 | +### `CaptureLevel.Informational` |
| 124 | + |
| 125 | +Includes metrics generated by `CaptureLevel.Counters` plus: |
| 126 | + |
| 127 | +| Name | Type | Description | Labels | |
| 128 | +| ------------------------------------- | --------- | ------------------------------------------------------------------------------------------------- | ------------------- | |
| 129 | +| `dotnet_threadpool_io_num_threads` | `Gauge` | The number of active threads in the IO thread pool | | |
| 130 | +| `dotnet_threadpool_adjustments_total` | `Counter` | The total number of changes made to the size of the thread pool, labeled by the reason for change | `adjustment_reason` | |
0 commit comments