Skip to content

Commit

Permalink
Add initial experimental .NET CLR runtime metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejgordon committed Aug 5, 2024
1 parent 18b3555 commit 54833c4
Show file tree
Hide file tree
Showing 8 changed files with 530 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .chloggen/clr-runtime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: new_component

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: clr

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Adds experimental metrics for the Common Language Runtime (CLR)."

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [956]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
1 change: 1 addition & 0 deletions docs/attributes-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Currently, the following namespaces exist:
- [Client](client.md)
- [Cloud](cloud.md)
- [CloudEvents](cloudevents.md)
- [CLR](clr.md)
- [Code](code.md)
- [Container](container.md)
- [CPU](cpu.md)
Expand Down
15 changes: 15 additions & 0 deletions docs/attributes-registry/clr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!--- Hugo front matter used to generate the website version of this page:
--->

<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->

# CLR

## Clr Attributes

This document defines .NET Common Language Runtime (CLR) related attributes.

| Attribute | Type | Description | Examples | Stability |
| ------------------- | ------ | ---------------------------------------------- | ------------------------------------ | ---------------------------------------------------------------- |
| `clr.gc.generation` | string | Name of the garbage collector heap generation. | `gen0`; `gen1`; `gen2`; `loh`; `poh` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
1 change: 1 addition & 0 deletions docs/runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ semantic conventions when instrumenting runtime environments.
- [JVM](jvm-metrics.md)
- [Node.js](nodejs-metrics.md)
- [V8 JS Engine](v8js-metrics.md)
- [.NET](dotnet-metrics.md)

### Attributes

Expand Down
324 changes: 324 additions & 0 deletions docs/runtime/clr-metrics.md

Large diffs are not rendered by default.

154 changes: 154 additions & 0 deletions model/metrics/clr-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
groups:
- id: metric.clr.gc.collections.count
type: metric
metric_name: clr.gc.collections.count
brief: >
Number of garbage collections that have occurred since the process started.
instrument: counter
unit: "{collection}"
stability: experimental
attributes:
- ref: clr.gc.generation
requirement_level: required
- id: metric.clr.gc.objects.size
type: metric
metric_name: clr.gc.objects.size
brief: >
The number of bytes currently allocated on the managed GC heap.
Fragmentation and other GC committed memory pools are excluded.
instrument: updowncounter
unit: "By"
stability: experimental
- id: metric.clr.gc.allocations.size
type: metric
metric_name: clr.gc.allocations.size
brief: >
The number of bytes allocated on the managed GC heap since the process
started. The returned value does not include any native allocations.
instrument: counter
unit: "By"
stability: experimental
- id: metric.clr.gc.committed_memory.size
type: metric
metric_name: clr.gc.committed_memory.size
brief: >
The amount of committed virtual memory for the managed GC heap, as
observed during the latest garbage collection.
note: >
Committed virtual memory may be larger than the heap size because it
includes both memory for storing existing objects (the heap size) and some
extra memory that is ready to handle newly allocated objects in the
future.
instrument: updowncounter
unit: "By"
stability: experimental
- id: metric.clr.gc.heap.size
type: metric
metric_name: clr.gc.heap.size
brief: >
The heap size (including fragmentation), as observed during the latest
garbage collection.
instrument: updowncounter
unit: "By"
stability: experimental
attributes:
- ref: clr.gc.generation
requirement_level: required
- id: metric.clr.gc.heap.fragmentation.size
type: metric
metric_name: clr.gc.heap.fragmentation.size
brief: >
The heap fragmentation, as observed during the latest garbage collection.
instrument: updowncounter
unit: "By"
stability: experimental
attributes:
- ref: clr.gc.generation
requirement_level: required
- id: metric.clr.gc.duration
type: metric
metric_name: clr.gc.duration
brief: "The total amount of time paused in GC since the process started."
instrument: counter
unit: "ns"
stability: experimental
- id: metric.clr.jit.il_compiled.size
type: metric
metric_name: clr.jit.il_compiled.size
brief: "Count of bytes of intermediate language that have been compiled since the process start."
instrument: counter
unit: "By"
stability: experimental
- id: metric.clr.jit.methods_compiled.count
type: metric
metric_name: clr.jit.methods_compiled.count
brief: >
The number of times the JIT compiler (re)compiled methods since the
process start.
instrument: counter
unit: "{method}"
stability: experimental
- id: metric.clr.jit.compilation_time
type: metric
metric_name: clr.jit.compilation_time
brief: >
The amount of time the JIT compiler has spent compiling methods since the
process start.
instrument: counter
unit: "ns"
stability: experimental
- id: metric.clr.monitor.lock_contention.count
type: metric
metric_name: clr.monitor.lock_contention.count
brief: >
The number of times there was contention when trying to acquire a monitor
lock since the process start.
instrument: counter
unit: "{contention}"
stability: experimental
- id: metric.clr.thread_pool.threads.count
type: metric
metric_name: clr.thread_pool.threads.count
brief: "The number of thread pool threads that currently exist."
instrument: updowncounter
unit: "{thread}"
stability: experimental
- id: metric.clr.thread_pool.work_items.count
type: metric
metric_name: clr.thread_pool.work_items.count
brief: >
The number of work items that the thread pool has processed since
the process start.
instrument: counter
unit: "{work_item}"
stability: experimental
- id: metric.clr.thread_pool.queue.length
type: metric
metric_name: clr.thread_pool.queue.length
brief: >
The number of work items that are currently queued to be processed by the
thread pool.
instrument: updowncounter
unit: "{queue}"
stability: experimental
- id: metric.clr.timer.count
type: metric
metric_name: clr.timer.count
brief: "The number of timer instances that are currently active."
instrument: updowncounter
unit: "{timer}"
stability: experimental
- id: metric.clr.assemblies.count
type: metric
metric_name: clr.assemblies.count
brief: "The number of .NET assemblies that are currently loaded."
instrument: updowncounter
unit: "{assembly}"
stability: experimental
- id: metric.clr.exceptions.count
type: metric
metric_name: clr.exceptions.count
brief: "Count of exceptions that have been thrown in managed code."
instrument: counter
unit: "{exception}"
stability: experimental
12 changes: 12 additions & 0 deletions model/registry/clr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
groups:
- id: registry.clr
type: attribute_group
prefix: clr
brief: >
This document defines .NET Common Language Runtime (CLR) related attributes.
attributes:
- id: gc.generation
stability: experimental
type: string
brief: Name of the garbage collector heap generation.
examples: ["gen0", "gen1", "gen2", "loh", "poh"]
1 change: 1 addition & 0 deletions templates/registry/markdown/weaver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ acronyms:
- AWS
- CICD
- CloudEvents
- CLR
- CPU
- CosmosDB
- DynamoDB
Expand Down

0 comments on commit 54833c4

Please sign in to comment.