Skip to content

Commit

Permalink
Correctly name metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljharvey committed Nov 6, 2023
1 parent 171182d commit c6eb17a
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions crates/query-engine/execution/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,85 +29,85 @@ impl Metrics {
pub fn initialize(metrics_registry: &mut Registry) -> Result<Self, Error> {
let query_total = add_int_counter_metric(
metrics_registry,
"ndc_postgres_query_total",
"ndc_sqlserver_query_total",
"Total successful queries.",
)?;

let explain_total = add_int_counter_metric(
metrics_registry,
"ndc_postgres_explain_total",
"ndc_sqlserver_explain_total",
"Total successful explains.",
)?;

let query_total_time = add_histogram_metric(
metrics_registry,
"ndc_postgres_query_total_time",
"ndc_sqlserver_query_total_time",
"Total time taken to plan and execute a query, in seconds",
)?;

let query_plan_time = add_histogram_metric(
metrics_registry,
"ndc_postgres_query_plan_time",
"ndc_sqlserver_query_plan_time",
"Time taken to plan a query for execution, in seconds.",
)?;

let query_execution_time = add_histogram_metric(
metrics_registry,
"ndc_postgres_query_execution_time",
"ndc_sqlserver_query_execution_time",
"Time taken to execute an already-planned query, in seconds.",
)?;

let connection_acquisition_wait_time = add_histogram_metric(
metrics_registry,
"ndc_postgres_connection_acquisition_wait_time",
"ndc_sqlserver_connection_acquisition_wait_time",
"Time taken to acquire a connection.",
)?;

let pool_size = add_int_gauge_metric(
metrics_registry,
"ndc_postgres_pool_size",
"ndc_sqlserver_pool_size",
"The number of connections currently active. This includes idle connections.",
)?;

let pool_idle_count = add_int_gauge_metric(
metrics_registry,
"ndc_postgres_pool_idle",
"ndc_sqlserver_pool_idle",
"The number of connections active and idle (not in use).",
)?;

let pool_active_count = add_int_gauge_metric(
metrics_registry,
"ndc_postgres_pool_active",
"ndc_sqlserver_pool_active",
"The number of connections current active. This does not include idle connections.",
)?;

let pool_max_connections = add_int_gauge_metric(
metrics_registry,
"ndc_postgres_pool_max_connections",
"ndc_sqlserver_pool_max_connections",
"The maximum number of connections that this pool should maintain.",
)?;

let pool_min_connections = add_int_gauge_metric(
metrics_registry,
"ndc_postgres_pool_min_connections",
"ndc_sqlserver_pool_min_connections",
"The minimum number of connections that this pool should maintain.",
)?;

let pool_acquire_timeout = add_gauge_metric(
metrics_registry,
"ndc_postgres_pool_acquire_timeout",
"ndc_sqlserver_pool_acquire_timeout",
"Get the maximum amount of time to spend waiting for a connection, in seconds.",
)?;

let pool_idle_timeout = add_gauge_metric(
metrics_registry,
"ndc_postgres_pool_idle_timeout",
"ndc_sqlserver_pool_idle_timeout",
"Get the maximum idle duration for individual connections, in seconds.",
)?;

let pool_max_lifetime = add_gauge_metric(
metrics_registry,
"ndc_postgres_pool_max_lifetime",
"ndc_sqlserver_pool_max_lifetime",
"Get the maximum lifetime of individual connections, in seconds.",
)?;

Expand Down Expand Up @@ -312,37 +312,37 @@ impl ErrorMetrics {
pub fn initialize(metrics_registry: &mut prometheus::Registry) -> Result<Self, Error> {
let invalid_request_total = add_int_counter_metric(
metrics_registry,
"ndc_postgres_error_invalid_request_total_count",
"ndc_sqlserver_error_invalid_request_total_count",
"Total number of invalid requests encountered.",
)?;

let unsupported_capability_total = add_int_counter_metric(
metrics_registry,
"ndc_postgres_error_unsupported_capability_total_count",
"ndc_sqlserver_error_unsupported_capability_total_count",
"Total number of invalid requests with unsupported capabilities encountered.",
)?;

let unsupported_feature_total = add_int_counter_metric(
metrics_registry,
"ndc_postgres_error_unsupported_capabilities_total_count",
"ndc_sqlserver_error_unsupported_capabilities_total_count",
"Total number of invalid requests with unsupported capabilities encountered.",
)?;

let connector_error_total = add_int_counter_metric(
metrics_registry,
"ndc_postgres_error_connector_error_total_count",
"ndc_sqlserver_error_connector_error_total_count",
"Total number of requests failed due to an internal conenctor error.",
)?;

let database_error_total = add_int_counter_metric(
metrics_registry,
"ndc_postgres_error_database_error_total_count",
"ndc_sqlserver_error_database_error_total_count",
"Total number of requests failed due to a database error.",
)?;

let connection_acquisition_error_total = add_int_counter_metric(
metrics_registry,
"ndc_postgres_error_connection_acquisition_error_total_count",
"ndc_sqlserver_error_connection_acquisition_error_total_count",
"Total number of failures to acquire a database connection.",
)?;

Expand Down

0 comments on commit c6eb17a

Please sign in to comment.