Skip to content

Commit

Permalink
metrics cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Jun 10, 2024
1 parent cd65043 commit 5d15167
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ def create_system_cpu_utilization(


SYSTEM_DISK_IO = "system.disk.io"
"""
Instrument: counter
Unit: By
"""


def create_system_disk_io(meter: Meter) -> Counter:
Expand Down Expand Up @@ -148,6 +152,10 @@ def create_system_disk_io_time(meter: Meter) -> Counter:


SYSTEM_DISK_MERGED = "system.disk.merged"
"""
Instrument: counter
Unit: {operation}
"""


def create_system_disk_merged(meter: Meter) -> Counter:
Expand Down Expand Up @@ -180,6 +188,10 @@ def create_system_disk_operation_time(meter: Meter) -> Counter:


SYSTEM_DISK_OPERATIONS = "system.disk.operations"
"""
Instrument: counter
Unit: {operation}
"""


def create_system_disk_operations(meter: Meter) -> Counter:
Expand All @@ -191,6 +203,10 @@ def create_system_disk_operations(meter: Meter) -> Counter:


SYSTEM_FILESYSTEM_USAGE = "system.filesystem.usage"
"""
Instrument: updowncounter
Unit: By
"""


def create_system_filesystem_usage(meter: Meter) -> UpDownCounter:
Expand All @@ -202,6 +218,10 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter:


SYSTEM_FILESYSTEM_UTILIZATION = "system.filesystem.utilization"
"""
Instrument: gauge
Unit: 1
"""


def create_system_filesystem_utilization(
Expand Down Expand Up @@ -294,6 +314,10 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter:


SYSTEM_MEMORY_UTILIZATION = "system.memory.utilization"
"""
Instrument: gauge
Unit: 1
"""


def create_system_memory_utilization(
Expand All @@ -308,6 +332,10 @@ def create_system_memory_utilization(


SYSTEM_NETWORK_CONNECTIONS = "system.network.connections"
"""
Instrument: updowncounter
Unit: {connection}
"""


def create_system_network_connections(meter: Meter) -> UpDownCounter:
Expand Down Expand Up @@ -363,6 +391,10 @@ def create_system_network_errors(meter: Meter) -> Counter:


SYSTEM_NETWORK_IO = "system.network.io"
"""
Instrument: counter
Unit: By
"""


def create_system_network_io(meter: Meter) -> Counter:
Expand All @@ -374,6 +406,10 @@ def create_system_network_io(meter: Meter) -> Counter:


SYSTEM_NETWORK_PACKETS = "system.network.packets"
"""
Instrument: counter
Unit: {packet}
"""


def create_system_network_packets(meter: Meter) -> Counter:
Expand All @@ -385,6 +421,10 @@ def create_system_network_packets(meter: Meter) -> Counter:


SYSTEM_PAGING_FAULTS = "system.paging.faults"
"""
Instrument: counter
Unit: {fault}
"""


def create_system_paging_faults(meter: Meter) -> Counter:
Expand All @@ -396,6 +436,10 @@ def create_system_paging_faults(meter: Meter) -> Counter:


SYSTEM_PAGING_OPERATIONS = "system.paging.operations"
"""
Instrument: counter
Unit: {operation}
"""


def create_system_paging_operations(meter: Meter) -> Counter:
Expand Down Expand Up @@ -424,6 +468,10 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter:


SYSTEM_PAGING_UTILIZATION = "system.paging.utilization"
"""
Instrument: gauge
Unit: 1
"""


def create_system_paging_utilization(
Expand Down
4 changes: 3 additions & 1 deletion scripts/semconv/templates/registry/semantic_metrics.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
{{prefix}}Deprecated: {{c.to_docstring(metric.deprecated, prefix)}}
{%- elif ctx.filter == "any" and metric.stability == "stable" %}
{{prefix}}Deprecated in favor of stable :py:const:`{{stable_class_ref(metric.metric_name, '.')}}`
{%- elif c.str_or_empty(metric.brief)|length %}
{%- else -%}
{%- if c.str_or_empty(metric.brief)|length %}
{{prefix}}{{c.to_docstring(metric.brief, prefix)}}
{%- endif %}
{{prefix}}Instrument: {{ metric.instrument }}
{{prefix}}Unit: {{ metric.unit }}
{%- if c.str_or_empty(metric.note)|length %}
Expand Down

0 comments on commit 5d15167

Please sign in to comment.