Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Jul 26, 2024
1 parent a7b49cc commit 128d37f
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
def create_container_cpu_time(meter: Meter) -> Counter:
"""Total CPU time consumed"""
return meter.create_counter(
name="CONTAINER_CPU_TIME",
name=CONTAINER_CPU_TIME,
description="Total CPU time consumed",
unit="s",
)
Expand All @@ -46,7 +46,7 @@ def create_container_cpu_time(meter: Meter) -> Counter:
def create_container_disk_io(meter: Meter) -> Counter:
"""Disk bytes for the container."""
return meter.create_counter(
name="CONTAINER_DISK_IO",
name=CONTAINER_DISK_IO,
description="Disk bytes for the container.",
unit="By",
)
Expand All @@ -64,7 +64,7 @@ def create_container_disk_io(meter: Meter) -> Counter:
def create_container_memory_usage(meter: Meter) -> Counter:
"""Memory usage of the container."""
return meter.create_counter(
name="CONTAINER_MEMORY_USAGE",
name=CONTAINER_MEMORY_USAGE,
description="Memory usage of the container.",
unit="By",
)
Expand All @@ -82,7 +82,7 @@ def create_container_memory_usage(meter: Meter) -> Counter:
def create_container_network_io(meter: Meter) -> Counter:
"""Network bytes for the container."""
return meter.create_counter(
name="CONTAINER_NETWORK_IO",
name=CONTAINER_NETWORK_IO,
description="Network bytes for the container.",
unit="By",
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
def create_db_client_connection_count(meter: Meter) -> UpDownCounter:
"""The number of connections that are currently in state described by the `state` attribute"""
return meter.create_up_down_counter(
name="DB_CLIENT_CONNECTION_COUNT",
name=DB_CLIENT_CONNECTION_COUNT,
description="The number of connections that are currently in state described by the `state` attribute",
unit="{connection}",
)
Expand All @@ -44,7 +44,7 @@ def create_db_client_connection_count(meter: Meter) -> UpDownCounter:
def create_db_client_connection_create_time(meter: Meter) -> Histogram:
"""The time it took to create a new connection"""
return meter.create_histogram(
name="DB_CLIENT_CONNECTION_CREATE_TIME",
name=DB_CLIENT_CONNECTION_CREATE_TIME,
description="The time it took to create a new connection",
unit="s",
)
Expand All @@ -61,7 +61,7 @@ def create_db_client_connection_create_time(meter: Meter) -> Histogram:
def create_db_client_connection_idle_max(meter: Meter) -> UpDownCounter:
"""The maximum number of idle open connections allowed"""
return meter.create_up_down_counter(
name="DB_CLIENT_CONNECTION_IDLE_MAX",
name=DB_CLIENT_CONNECTION_IDLE_MAX,
description="The maximum number of idle open connections allowed",
unit="{connection}",
)
Expand All @@ -78,7 +78,7 @@ def create_db_client_connection_idle_max(meter: Meter) -> UpDownCounter:
def create_db_client_connection_idle_min(meter: Meter) -> UpDownCounter:
"""The minimum number of idle open connections allowed"""
return meter.create_up_down_counter(
name="DB_CLIENT_CONNECTION_IDLE_MIN",
name=DB_CLIENT_CONNECTION_IDLE_MIN,
description="The minimum number of idle open connections allowed",
unit="{connection}",
)
Expand All @@ -95,7 +95,7 @@ def create_db_client_connection_idle_min(meter: Meter) -> UpDownCounter:
def create_db_client_connection_max(meter: Meter) -> UpDownCounter:
"""The maximum number of open connections allowed"""
return meter.create_up_down_counter(
name="DB_CLIENT_CONNECTION_MAX",
name=DB_CLIENT_CONNECTION_MAX,
description="The maximum number of open connections allowed",
unit="{connection}",
)
Expand All @@ -116,7 +116,7 @@ def create_db_client_connection_pending_requests(
) -> UpDownCounter:
"""The number of pending requests for an open connection, cumulative for the entire pool"""
return meter.create_up_down_counter(
name="DB_CLIENT_CONNECTION_PENDING_REQUESTS",
name=DB_CLIENT_CONNECTION_PENDING_REQUESTS,
description="The number of pending requests for an open connection, cumulative for the entire pool",
unit="{request}",
)
Expand All @@ -133,7 +133,7 @@ def create_db_client_connection_pending_requests(
def create_db_client_connection_timeouts(meter: Meter) -> Counter:
"""The number of connection timeouts that have occurred trying to obtain a connection from the pool"""
return meter.create_counter(
name="DB_CLIENT_CONNECTION_TIMEOUTS",
name=DB_CLIENT_CONNECTION_TIMEOUTS,
description="The number of connection timeouts that have occurred trying to obtain a connection from the pool",
unit="{timeout}",
)
Expand All @@ -150,7 +150,7 @@ def create_db_client_connection_timeouts(meter: Meter) -> Counter:
def create_db_client_connection_use_time(meter: Meter) -> Histogram:
"""The time between borrowing a connection and returning it to the pool"""
return meter.create_histogram(
name="DB_CLIENT_CONNECTION_USE_TIME",
name=DB_CLIENT_CONNECTION_USE_TIME,
description="The time between borrowing a connection and returning it to the pool",
unit="s",
)
Expand All @@ -167,7 +167,7 @@ def create_db_client_connection_use_time(meter: Meter) -> Histogram:
def create_db_client_connection_wait_time(meter: Meter) -> Histogram:
"""The time it took to obtain an open connection from the pool"""
return meter.create_histogram(
name="DB_CLIENT_CONNECTION_WAIT_TIME",
name=DB_CLIENT_CONNECTION_WAIT_TIME,
description="The time it took to obtain an open connection from the pool",
unit="s",
)
Expand All @@ -182,7 +182,7 @@ def create_db_client_connection_wait_time(meter: Meter) -> Histogram:
def create_db_client_connections_create_time(meter: Meter) -> Histogram:
"""Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`."""
return meter.create_histogram(
name="DB_CLIENT_CONNECTIONS_CREATE_TIME",
name=DB_CLIENT_CONNECTIONS_CREATE_TIME,
description="Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`.",
unit="ms",
)
Expand All @@ -197,7 +197,7 @@ def create_db_client_connections_create_time(meter: Meter) -> Histogram:
def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter:
"""Deprecated, use `db.client.connection.idle.max` instead."""
return meter.create_up_down_counter(
name="DB_CLIENT_CONNECTIONS_IDLE_MAX",
name=DB_CLIENT_CONNECTIONS_IDLE_MAX,
description="Deprecated, use `db.client.connection.idle.max` instead.",
unit="{connection}",
)
Expand All @@ -212,7 +212,7 @@ def create_db_client_connections_idle_max(meter: Meter) -> UpDownCounter:
def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter:
"""Deprecated, use `db.client.connection.idle.min` instead."""
return meter.create_up_down_counter(
name="DB_CLIENT_CONNECTIONS_IDLE_MIN",
name=DB_CLIENT_CONNECTIONS_IDLE_MIN,
description="Deprecated, use `db.client.connection.idle.min` instead.",
unit="{connection}",
)
Expand All @@ -227,7 +227,7 @@ def create_db_client_connections_idle_min(meter: Meter) -> UpDownCounter:
def create_db_client_connections_max(meter: Meter) -> UpDownCounter:
"""Deprecated, use `db.client.connection.max` instead."""
return meter.create_up_down_counter(
name="DB_CLIENT_CONNECTIONS_MAX",
name=DB_CLIENT_CONNECTIONS_MAX,
description="Deprecated, use `db.client.connection.max` instead.",
unit="{connection}",
)
Expand All @@ -246,7 +246,7 @@ def create_db_client_connections_pending_requests(
) -> UpDownCounter:
"""Deprecated, use `db.client.connection.pending_requests` instead."""
return meter.create_up_down_counter(
name="DB_CLIENT_CONNECTIONS_PENDING_REQUESTS",
name=DB_CLIENT_CONNECTIONS_PENDING_REQUESTS,
description="Deprecated, use `db.client.connection.pending_requests` instead.",
unit="{request}",
)
Expand All @@ -261,7 +261,7 @@ def create_db_client_connections_pending_requests(
def create_db_client_connections_timeouts(meter: Meter) -> Counter:
"""Deprecated, use `db.client.connection.timeouts` instead."""
return meter.create_counter(
name="DB_CLIENT_CONNECTIONS_TIMEOUTS",
name=DB_CLIENT_CONNECTIONS_TIMEOUTS,
description="Deprecated, use `db.client.connection.timeouts` instead.",
unit="{timeout}",
)
Expand All @@ -276,7 +276,7 @@ def create_db_client_connections_timeouts(meter: Meter) -> Counter:
def create_db_client_connections_usage(meter: Meter) -> UpDownCounter:
"""Deprecated, use `db.client.connection.count` instead."""
return meter.create_up_down_counter(
name="DB_CLIENT_CONNECTIONS_USAGE",
name=DB_CLIENT_CONNECTIONS_USAGE,
description="Deprecated, use `db.client.connection.count` instead.",
unit="{connection}",
)
Expand All @@ -291,7 +291,7 @@ def create_db_client_connections_usage(meter: Meter) -> UpDownCounter:
def create_db_client_connections_use_time(meter: Meter) -> Histogram:
"""Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`."""
return meter.create_histogram(
name="DB_CLIENT_CONNECTIONS_USE_TIME",
name=DB_CLIENT_CONNECTIONS_USE_TIME,
description="Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`.",
unit="ms",
)
Expand All @@ -306,7 +306,7 @@ def create_db_client_connections_use_time(meter: Meter) -> Histogram:
def create_db_client_connections_wait_time(meter: Meter) -> Histogram:
"""Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`."""
return meter.create_histogram(
name="DB_CLIENT_CONNECTIONS_WAIT_TIME",
name=DB_CLIENT_CONNECTIONS_WAIT_TIME,
description="Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`.",
unit="ms",
)
Expand All @@ -323,7 +323,7 @@ def create_db_client_connections_wait_time(meter: Meter) -> Histogram:
def create_db_client_operation_duration(meter: Meter) -> Histogram:
"""Duration of database client operations."""
return meter.create_histogram(
name="DB_CLIENT_OPERATION_DURATION",
name=DB_CLIENT_OPERATION_DURATION,
description="Duration of database client operations.",
unit="s",
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
def create_dns_lookup_duration(meter: Meter) -> Histogram:
"""Measures the time taken to perform a DNS lookup."""
return meter.create_histogram(
name="DNS_LOOKUP_DURATION",
name=DNS_LOOKUP_DURATION,
description="Measures the time taken to perform a DNS lookup.",
unit="s",
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
def create_faas_coldstarts(meter: Meter) -> Counter:
"""Number of invocation cold starts"""
return meter.create_counter(
name="FAAS_COLDSTARTS",
name=FAAS_COLDSTARTS,
description="Number of invocation cold starts",
unit="{coldstart}",
)
Expand All @@ -44,7 +44,7 @@ def create_faas_coldstarts(meter: Meter) -> Counter:
def create_faas_cpu_usage(meter: Meter) -> Histogram:
"""Distribution of CPU usage per invocation"""
return meter.create_histogram(
name="FAAS_CPU_USAGE",
name=FAAS_CPU_USAGE,
description="Distribution of CPU usage per invocation",
unit="s",
)
Expand All @@ -61,7 +61,7 @@ def create_faas_cpu_usage(meter: Meter) -> Histogram:
def create_faas_errors(meter: Meter) -> Counter:
"""Number of invocation errors"""
return meter.create_counter(
name="FAAS_ERRORS",
name=FAAS_ERRORS,
description="Number of invocation errors",
unit="{error}",
)
Expand All @@ -78,7 +78,7 @@ def create_faas_errors(meter: Meter) -> Counter:
def create_faas_init_duration(meter: Meter) -> Histogram:
"""Measures the duration of the function's initialization, such as a cold start"""
return meter.create_histogram(
name="FAAS_INIT_DURATION",
name=FAAS_INIT_DURATION,
description="Measures the duration of the function's initialization, such as a cold start",
unit="s",
)
Expand All @@ -95,7 +95,7 @@ def create_faas_init_duration(meter: Meter) -> Histogram:
def create_faas_invocations(meter: Meter) -> Counter:
"""Number of successful invocations"""
return meter.create_counter(
name="FAAS_INVOCATIONS",
name=FAAS_INVOCATIONS,
description="Number of successful invocations",
unit="{invocation}",
)
Expand All @@ -112,7 +112,7 @@ def create_faas_invocations(meter: Meter) -> Counter:
def create_faas_invoke_duration(meter: Meter) -> Histogram:
"""Measures the duration of the function's logic execution"""
return meter.create_histogram(
name="FAAS_INVOKE_DURATION",
name=FAAS_INVOKE_DURATION,
description="Measures the duration of the function's logic execution",
unit="s",
)
Expand All @@ -129,7 +129,7 @@ def create_faas_invoke_duration(meter: Meter) -> Histogram:
def create_faas_mem_usage(meter: Meter) -> Histogram:
"""Distribution of max memory usage per invocation"""
return meter.create_histogram(
name="FAAS_MEM_USAGE",
name=FAAS_MEM_USAGE,
description="Distribution of max memory usage per invocation",
unit="By",
)
Expand All @@ -146,7 +146,7 @@ def create_faas_mem_usage(meter: Meter) -> Histogram:
def create_faas_net_io(meter: Meter) -> Histogram:
"""Distribution of net I/O usage per invocation"""
return meter.create_histogram(
name="FAAS_NET_IO",
name=FAAS_NET_IO,
description="Distribution of net I/O usage per invocation",
unit="By",
)
Expand All @@ -163,7 +163,7 @@ def create_faas_net_io(meter: Meter) -> Histogram:
def create_faas_timeouts(meter: Meter) -> Counter:
"""Number of invocation timeouts"""
return meter.create_counter(
name="FAAS_TIMEOUTS",
name=FAAS_TIMEOUTS,
description="Number of invocation timeouts",
unit="{timeout}",
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
def create_http_client_active_requests(meter: Meter) -> UpDownCounter:
"""Number of active HTTP requests."""
return meter.create_up_down_counter(
name="HTTP_CLIENT_ACTIVE_REQUESTS",
name=HTTP_CLIENT_ACTIVE_REQUESTS,
description="Number of active HTTP requests.",
unit="{request}",
)
Expand All @@ -44,7 +44,7 @@ def create_http_client_active_requests(meter: Meter) -> UpDownCounter:
def create_http_client_connection_duration(meter: Meter) -> Histogram:
"""The duration of the successfully established outbound HTTP connections."""
return meter.create_histogram(
name="HTTP_CLIENT_CONNECTION_DURATION",
name=HTTP_CLIENT_CONNECTION_DURATION,
description="The duration of the successfully established outbound HTTP connections.",
unit="s",
)
Expand All @@ -61,7 +61,7 @@ def create_http_client_connection_duration(meter: Meter) -> Histogram:
def create_http_client_open_connections(meter: Meter) -> UpDownCounter:
"""Number of outbound HTTP connections that are currently active or idle on the client."""
return meter.create_up_down_counter(
name="HTTP_CLIENT_OPEN_CONNECTIONS",
name=HTTP_CLIENT_OPEN_CONNECTIONS,
description="Number of outbound HTTP connections that are currently active or idle on the client.",
unit="{connection}",
)
Expand All @@ -79,7 +79,7 @@ def create_http_client_open_connections(meter: Meter) -> UpDownCounter:
def create_http_client_request_body_size(meter: Meter) -> Histogram:
"""Size of HTTP client request bodies."""
return meter.create_histogram(
name="HTTP_CLIENT_REQUEST_BODY_SIZE",
name=HTTP_CLIENT_REQUEST_BODY_SIZE,
description="Size of HTTP client request bodies.",
unit="By",
)
Expand All @@ -94,7 +94,7 @@ def create_http_client_request_body_size(meter: Meter) -> Histogram:
def create_http_client_request_duration(meter: Meter) -> Histogram:
"""Duration of HTTP client requests."""
return meter.create_histogram(
name="HTTP_CLIENT_REQUEST_DURATION",
name=HTTP_CLIENT_REQUEST_DURATION,
description="Duration of HTTP client requests.",
unit="s",
)
Expand All @@ -112,7 +112,7 @@ def create_http_client_request_duration(meter: Meter) -> Histogram:
def create_http_client_response_body_size(meter: Meter) -> Histogram:
"""Size of HTTP client response bodies."""
return meter.create_histogram(
name="HTTP_CLIENT_RESPONSE_BODY_SIZE",
name=HTTP_CLIENT_RESPONSE_BODY_SIZE,
description="Size of HTTP client response bodies.",
unit="By",
)
Expand All @@ -129,7 +129,7 @@ def create_http_client_response_body_size(meter: Meter) -> Histogram:
def create_http_server_active_requests(meter: Meter) -> UpDownCounter:
"""Number of active HTTP server requests."""
return meter.create_up_down_counter(
name="HTTP_SERVER_ACTIVE_REQUESTS",
name=HTTP_SERVER_ACTIVE_REQUESTS,
description="Number of active HTTP server requests.",
unit="{request}",
)
Expand All @@ -147,7 +147,7 @@ def create_http_server_active_requests(meter: Meter) -> UpDownCounter:
def create_http_server_request_body_size(meter: Meter) -> Histogram:
"""Size of HTTP server request bodies."""
return meter.create_histogram(
name="HTTP_SERVER_REQUEST_BODY_SIZE",
name=HTTP_SERVER_REQUEST_BODY_SIZE,
description="Size of HTTP server request bodies.",
unit="By",
)
Expand All @@ -162,7 +162,7 @@ def create_http_server_request_body_size(meter: Meter) -> Histogram:
def create_http_server_request_duration(meter: Meter) -> Histogram:
"""Duration of HTTP server requests."""
return meter.create_histogram(
name="HTTP_SERVER_REQUEST_DURATION",
name=HTTP_SERVER_REQUEST_DURATION,
description="Duration of HTTP server requests.",
unit="s",
)
Expand All @@ -180,7 +180,7 @@ def create_http_server_request_duration(meter: Meter) -> Histogram:
def create_http_server_response_body_size(meter: Meter) -> Histogram:
"""Size of HTTP server response bodies."""
return meter.create_histogram(
name="HTTP_SERVER_RESPONSE_BODY_SIZE",
name=HTTP_SERVER_RESPONSE_BODY_SIZE,
description="Size of HTTP server response bodies.",
unit="By",
)
Loading

0 comments on commit 128d37f

Please sign in to comment.