diff --git a/config/semconv/README.md b/config/semconv/README.md new file mode 100644 index 0000000000..a04f8b9893 --- /dev/null +++ b/config/semconv/README.md @@ -0,0 +1,31 @@ + + +# Metrics + +This document describes the metrics defined in this semantic convention registry. + +| Metric | Type | Unit | Description | +|--------|------|------|-------------| +| `prometheus_config_last_reload_success_timestamp_seconds` | gauge | s | Timestamp of the last successful configuration reload. | +| `prometheus_config_last_reload_successful` | gauge | 1 | Whether the last configuration reload attempt was successful. | + + +## Metric Details + + +### `prometheus_config_last_reload_success_timestamp_seconds` + +Timestamp of the last successful configuration reload. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + + +### `prometheus_config_last_reload_successful` + +Whether the last configuration reload attempt was successful. + +- **Type:** gauge +- **Unit:** 1 +- **Stability:** development diff --git a/config/semconv/metrics.go b/config/semconv/metrics.go new file mode 100644 index 0000000000..1f5582c048 --- /dev/null +++ b/config/semconv/metrics.go @@ -0,0 +1,77 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package metrics provides Prometheus instrumentation types for metrics +// defined in this semantic convention registry. +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// Attribute is an interface for metric label attributes. +type Attribute interface { + ID() string + Value() string +} + +// PrometheusConfigLastReloadSuccessTimestampSeconds records the timestamp of the last successful configuration reload. +type PrometheusConfigLastReloadSuccessTimestampSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusConfigLastReloadSuccessTimestampSeconds returns a new PrometheusConfigLastReloadSuccessTimestampSeconds instrument. +func NewPrometheusConfigLastReloadSuccessTimestampSeconds() PrometheusConfigLastReloadSuccessTimestampSeconds { + labels := []string{} + return PrometheusConfigLastReloadSuccessTimestampSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_config_last_reload_success_timestamp_seconds", + Help: "Timestamp of the last successful configuration reload.", + }, labels), + } +} + +type PrometheusConfigLastReloadSuccessTimestampSecondsAttr interface { + Attribute + implPrometheusConfigLastReloadSuccessTimestampSeconds() +} + +func (m PrometheusConfigLastReloadSuccessTimestampSeconds) With( + extra ...PrometheusConfigLastReloadSuccessTimestampSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusConfigLastReloadSuccessful records the whether the last configuration reload attempt was successful. +type PrometheusConfigLastReloadSuccessful struct { + *prometheus.GaugeVec +} + +// NewPrometheusConfigLastReloadSuccessful returns a new PrometheusConfigLastReloadSuccessful instrument. +func NewPrometheusConfigLastReloadSuccessful() PrometheusConfigLastReloadSuccessful { + labels := []string{} + return PrometheusConfigLastReloadSuccessful{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_config_last_reload_successful", + Help: "Whether the last configuration reload attempt was successful.", + }, labels), + } +} + +type PrometheusConfigLastReloadSuccessfulAttr interface { + Attribute + implPrometheusConfigLastReloadSuccessful() +} + +func (m PrometheusConfigLastReloadSuccessful) With( + extra ...PrometheusConfigLastReloadSuccessfulAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} diff --git a/discovery/semconv/README.md b/discovery/semconv/README.md new file mode 100644 index 0000000000..615ccaaef5 --- /dev/null +++ b/discovery/semconv/README.md @@ -0,0 +1,357 @@ + + +# Metrics + +This document describes the metrics defined in this semantic convention registry. + +| Metric | Type | Unit | Description | +|--------|------|------|-------------| +| `prometheus_sd_azure_cache_hit_total` | counter | {hit} | Number of cache hits during Azure SD. | +| `prometheus_sd_azure_failures_total` | counter | {failure} | Number of Azure SD failures. | +| `prometheus_sd_consul_rpc_duration_seconds` | histogram | s | The duration of a Consul RPC call. | +| `prometheus_sd_consul_rpc_failures_total` | counter | {failure} | Number of Consul RPC call failures. | +| `prometheus_sd_discovered_targets` | gauge | {target} | Current number of discovered targets. | +| `prometheus_sd_dns_lookup_failures_total` | counter | {failure} | Number of DNS SD lookup failures. | +| `prometheus_sd_dns_lookups_total` | counter | {lookup} | Number of DNS SD lookups. | +| `prometheus_sd_failed_configs` | gauge | {config} | Current number of service discovery configurations that failed to load. | +| `prometheus_sd_file_mtime_seconds` | gauge | s | The modification time of the SD file. | +| `prometheus_sd_file_read_errors_total` | counter | {error} | Number of file SD read errors. | +| `prometheus_sd_file_scan_duration_seconds` | histogram | s | The duration of the file SD scan. | +| `prometheus_sd_file_watcher_errors_total` | counter | {error} | Number of file SD watcher errors. | +| `prometheus_sd_http_failures_total` | counter | {failure} | Number of HTTP SD failures. | +| `prometheus_sd_kubernetes_events_total` | counter | {event} | Number of Kubernetes events processed. | +| `prometheus_sd_kubernetes_failures_total` | counter | {failure} | Number of Kubernetes SD failures. | +| `prometheus_sd_kuma_fetch_duration_seconds` | histogram | s | The duration of a Kuma MADS fetch call. | +| `prometheus_sd_kuma_fetch_failures_total` | counter | {failure} | Number of Kuma SD fetch failures. | +| `prometheus_sd_kuma_fetch_skipped_updates_total` | counter | {update} | Number of Kuma SD updates skipped due to no changes. | +| `prometheus_sd_linode_failures_total` | counter | {failure} | Number of Linode SD failures. | +| `prometheus_sd_nomad_failures_total` | counter | {failure} | Number of Nomad SD failures. | +| `prometheus_sd_received_updates_total` | counter | {update} | Total number of update events received from the SD providers. | +| `prometheus_sd_refresh_duration_histogram_seconds` | histogram | s | The duration of a SD refresh cycle as a histogram. | +| `prometheus_sd_refresh_duration_seconds` | histogram | s | The duration of a SD refresh cycle. | +| `prometheus_sd_refresh_failures_total` | counter | {failure} | Number of SD refresh failures. | +| `prometheus_sd_updates_delayed_total` | counter | {update} | Total number of update events that couldn't be sent immediately. | +| `prometheus_sd_updates_total` | counter | {update} | Total number of update events sent to the SD consumers. | +| `prometheus_treecache_watcher_goroutines` | gauge | {goroutine} | The current number of treecache watcher goroutines. | +| `prometheus_treecache_zookeeper_failures_total` | counter | {failure} | Total number of ZooKeeper failures. | + + +## Metric Details + + +### `prometheus_sd_azure_cache_hit_total` + +Number of cache hits during Azure SD. + +- **Type:** counter +- **Unit:** {hit} +- **Stability:** development + + +### `prometheus_sd_azure_failures_total` + +Number of Azure SD failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + + +### `prometheus_sd_consul_rpc_duration_seconds` + +The duration of a Consul RPC call. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_sd_consul_rpc_failures_total` + +Number of Consul RPC call failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + + +### `prometheus_sd_discovered_targets` + +Current number of discovered targets. + +- **Type:** gauge +- **Unit:** {target} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `config` | string | The scrape config name. | prometheus, node_exporter | +| `name` | string | The discovery manager name. | scrape, notify | + + + +### `prometheus_sd_dns_lookup_failures_total` + +Number of DNS SD lookup failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + + +### `prometheus_sd_dns_lookups_total` + +Number of DNS SD lookups. + +- **Type:** counter +- **Unit:** {lookup} +- **Stability:** development + + +### `prometheus_sd_failed_configs` + +Current number of service discovery configurations that failed to load. + +- **Type:** gauge +- **Unit:** {config} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `name` | string | The discovery manager name. | scrape, notify | + + + +### `prometheus_sd_file_mtime_seconds` + +The modification time of the SD file. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `filename` | string | The file path. | /etc/prometheus/file_sd/targets.json | + + + +### `prometheus_sd_file_read_errors_total` + +Number of file SD read errors. + +- **Type:** counter +- **Unit:** {error} +- **Stability:** development + + +### `prometheus_sd_file_scan_duration_seconds` + +The duration of the file SD scan. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_sd_file_watcher_errors_total` + +Number of file SD watcher errors. + +- **Type:** counter +- **Unit:** {error} +- **Stability:** development + + +### `prometheus_sd_http_failures_total` + +Number of HTTP SD failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + + +### `prometheus_sd_kubernetes_events_total` + +Number of Kubernetes events processed. + +- **Type:** counter +- **Unit:** {event} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `event` | string | The event type. | add, update, delete | +| `role` | string | The Kubernetes role. | pod, node, service, endpoints | + + + +### `prometheus_sd_kubernetes_failures_total` + +Number of Kubernetes SD failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + + +### `prometheus_sd_kuma_fetch_duration_seconds` + +The duration of a Kuma MADS fetch call. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_sd_kuma_fetch_failures_total` + +Number of Kuma SD fetch failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + + +### `prometheus_sd_kuma_fetch_skipped_updates_total` + +Number of Kuma SD updates skipped due to no changes. + +- **Type:** counter +- **Unit:** {update} +- **Stability:** development + + +### `prometheus_sd_linode_failures_total` + +Number of Linode SD failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + + +### `prometheus_sd_nomad_failures_total` + +Number of Nomad SD failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + + +### `prometheus_sd_received_updates_total` + +Total number of update events received from the SD providers. + +- **Type:** counter +- **Unit:** {update} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `name` | string | The discovery manager name. | scrape, notify | + + + +### `prometheus_sd_refresh_duration_histogram_seconds` + +The duration of a SD refresh cycle as a histogram. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `mechanism` | string | The service discovery mechanism. | dns, kubernetes, consul | + + + +### `prometheus_sd_refresh_duration_seconds` + +The duration of a SD refresh cycle. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_sd_refresh_failures_total` + +Number of SD refresh failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `config` | string | The scrape config name. | prometheus | +| `mechanism` | string | The service discovery mechanism. | dns, kubernetes | + + + +### `prometheus_sd_updates_delayed_total` + +Total number of update events that couldn't be sent immediately. + +- **Type:** counter +- **Unit:** {update} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `name` | string | The discovery manager name. | scrape, notify | + + + +### `prometheus_sd_updates_total` + +Total number of update events sent to the SD consumers. + +- **Type:** counter +- **Unit:** {update} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `name` | string | The discovery manager name. | scrape, notify | + + + +### `prometheus_treecache_watcher_goroutines` + +The current number of treecache watcher goroutines. + +- **Type:** gauge +- **Unit:** {goroutine} +- **Stability:** development + + +### `prometheus_treecache_zookeeper_failures_total` + +Total number of ZooKeeper failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development diff --git a/discovery/semconv/metrics.go b/discovery/semconv/metrics.go new file mode 100644 index 0000000000..e01211ab58 --- /dev/null +++ b/discovery/semconv/metrics.go @@ -0,0 +1,1005 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package metrics provides Prometheus instrumentation types for metrics +// defined in this semantic convention registry. +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// Attribute is an interface for metric label attributes. +type Attribute interface { + ID() string + Value() string +} +type ConfigAttr string + +func (a ConfigAttr) ID() string { + return "config" +} + +func (a ConfigAttr) Value() string { + return string(a) +} + +type EventAttr string + +func (a EventAttr) ID() string { + return "event" +} + +func (a EventAttr) Value() string { + return string(a) +} + +type FilenameAttr string + +func (a FilenameAttr) ID() string { + return "filename" +} + +func (a FilenameAttr) Value() string { + return string(a) +} + +type MechanismAttr string + +func (a MechanismAttr) ID() string { + return "mechanism" +} + +func (a MechanismAttr) Value() string { + return string(a) +} + +type NameAttr string + +func (a NameAttr) ID() string { + return "name" +} + +func (a NameAttr) Value() string { + return string(a) +} + +type RoleAttr string + +func (a RoleAttr) ID() string { + return "role" +} + +func (a RoleAttr) Value() string { + return string(a) +} + +// PrometheusSDAzureCacheHitTotal records the number of cache hits during Azure SD. +type PrometheusSDAzureCacheHitTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDAzureCacheHitTotal returns a new PrometheusSDAzureCacheHitTotal instrument. +func NewPrometheusSDAzureCacheHitTotal() PrometheusSDAzureCacheHitTotal { + labels := []string{} + return PrometheusSDAzureCacheHitTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_azure_cache_hit_total", + Help: "Number of cache hits during Azure SD.", + }, labels), + } +} + +type PrometheusSDAzureCacheHitTotalAttr interface { + Attribute + implPrometheusSDAzureCacheHitTotal() +} + +func (m PrometheusSDAzureCacheHitTotal) With( + extra ...PrometheusSDAzureCacheHitTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDAzureFailuresTotal records the number of Azure SD failures. +type PrometheusSDAzureFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDAzureFailuresTotal returns a new PrometheusSDAzureFailuresTotal instrument. +func NewPrometheusSDAzureFailuresTotal() PrometheusSDAzureFailuresTotal { + labels := []string{} + return PrometheusSDAzureFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_azure_failures_total", + Help: "Number of Azure SD failures.", + }, labels), + } +} + +type PrometheusSDAzureFailuresTotalAttr interface { + Attribute + implPrometheusSDAzureFailuresTotal() +} + +func (m PrometheusSDAzureFailuresTotal) With( + extra ...PrometheusSDAzureFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDConsulRpcDurationSeconds records the duration of a Consul RPC call. +type PrometheusSDConsulRpcDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusSDConsulRpcDurationSeconds returns a new PrometheusSDConsulRpcDurationSeconds instrument. +func NewPrometheusSDConsulRpcDurationSeconds() PrometheusSDConsulRpcDurationSeconds { + labels := []string{} + return PrometheusSDConsulRpcDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_sd_consul_rpc_duration_seconds", + Help: "The duration of a Consul RPC call.", + }, labels), + } +} + +type PrometheusSDConsulRpcDurationSecondsAttr interface { + Attribute + implPrometheusSDConsulRpcDurationSeconds() +} + +func (m PrometheusSDConsulRpcDurationSeconds) With( + extra ...PrometheusSDConsulRpcDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusSDConsulRpcFailuresTotal records the number of Consul RPC call failures. +type PrometheusSDConsulRpcFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDConsulRpcFailuresTotal returns a new PrometheusSDConsulRpcFailuresTotal instrument. +func NewPrometheusSDConsulRpcFailuresTotal() PrometheusSDConsulRpcFailuresTotal { + labels := []string{} + return PrometheusSDConsulRpcFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_consul_rpc_failures_total", + Help: "Number of Consul RPC call failures.", + }, labels), + } +} + +type PrometheusSDConsulRpcFailuresTotalAttr interface { + Attribute + implPrometheusSDConsulRpcFailuresTotal() +} + +func (m PrometheusSDConsulRpcFailuresTotal) With( + extra ...PrometheusSDConsulRpcFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDDiscoveredTargets records the current number of discovered targets. +type PrometheusSDDiscoveredTargets struct { + *prometheus.GaugeVec +} + +// NewPrometheusSDDiscoveredTargets returns a new PrometheusSDDiscoveredTargets instrument. +func NewPrometheusSDDiscoveredTargets() PrometheusSDDiscoveredTargets { + labels := []string{ + "name", + "config", + } + return PrometheusSDDiscoveredTargets{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_sd_discovered_targets", + Help: "Current number of discovered targets.", + }, labels), + } +} + +type PrometheusSDDiscoveredTargetsAttr interface { + Attribute + implPrometheusSDDiscoveredTargets() +} + +func (a NameAttr) implPrometheusSDDiscoveredTargets() {} +func (a ConfigAttr) implPrometheusSDDiscoveredTargets() {} + +func (m PrometheusSDDiscoveredTargets) With( + extra ...PrometheusSDDiscoveredTargetsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "name": "", + "config": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusSDDNSLookupFailuresTotal records the number of DNS SD lookup failures. +type PrometheusSDDNSLookupFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDDNSLookupFailuresTotal returns a new PrometheusSDDNSLookupFailuresTotal instrument. +func NewPrometheusSDDNSLookupFailuresTotal() PrometheusSDDNSLookupFailuresTotal { + labels := []string{} + return PrometheusSDDNSLookupFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_dns_lookup_failures_total", + Help: "Number of DNS SD lookup failures.", + }, labels), + } +} + +type PrometheusSDDNSLookupFailuresTotalAttr interface { + Attribute + implPrometheusSDDNSLookupFailuresTotal() +} + +func (m PrometheusSDDNSLookupFailuresTotal) With( + extra ...PrometheusSDDNSLookupFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDDNSLookupsTotal records the number of DNS SD lookups. +type PrometheusSDDNSLookupsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDDNSLookupsTotal returns a new PrometheusSDDNSLookupsTotal instrument. +func NewPrometheusSDDNSLookupsTotal() PrometheusSDDNSLookupsTotal { + labels := []string{} + return PrometheusSDDNSLookupsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_dns_lookups_total", + Help: "Number of DNS SD lookups.", + }, labels), + } +} + +type PrometheusSDDNSLookupsTotalAttr interface { + Attribute + implPrometheusSDDNSLookupsTotal() +} + +func (m PrometheusSDDNSLookupsTotal) With( + extra ...PrometheusSDDNSLookupsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDFailedConfigs records the current number of service discovery configurations that failed to load. +type PrometheusSDFailedConfigs struct { + *prometheus.GaugeVec +} + +// NewPrometheusSDFailedConfigs returns a new PrometheusSDFailedConfigs instrument. +func NewPrometheusSDFailedConfigs() PrometheusSDFailedConfigs { + labels := []string{ + "name", + } + return PrometheusSDFailedConfigs{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_sd_failed_configs", + Help: "Current number of service discovery configurations that failed to load.", + }, labels), + } +} + +type PrometheusSDFailedConfigsAttr interface { + Attribute + implPrometheusSDFailedConfigs() +} + +func (a NameAttr) implPrometheusSDFailedConfigs() {} + +func (m PrometheusSDFailedConfigs) With( + extra ...PrometheusSDFailedConfigsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "name": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusSDFileMtimeSeconds records the modification time of the SD file. +type PrometheusSDFileMtimeSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusSDFileMtimeSeconds returns a new PrometheusSDFileMtimeSeconds instrument. +func NewPrometheusSDFileMtimeSeconds() PrometheusSDFileMtimeSeconds { + labels := []string{ + "filename", + } + return PrometheusSDFileMtimeSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_sd_file_mtime_seconds", + Help: "The modification time of the SD file.", + }, labels), + } +} + +type PrometheusSDFileMtimeSecondsAttr interface { + Attribute + implPrometheusSDFileMtimeSeconds() +} + +func (a FilenameAttr) implPrometheusSDFileMtimeSeconds() {} + +func (m PrometheusSDFileMtimeSeconds) With( + extra ...PrometheusSDFileMtimeSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "filename": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusSDFileReadErrorsTotal records the number of file SD read errors. +type PrometheusSDFileReadErrorsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDFileReadErrorsTotal returns a new PrometheusSDFileReadErrorsTotal instrument. +func NewPrometheusSDFileReadErrorsTotal() PrometheusSDFileReadErrorsTotal { + labels := []string{} + return PrometheusSDFileReadErrorsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_file_read_errors_total", + Help: "Number of file SD read errors.", + }, labels), + } +} + +type PrometheusSDFileReadErrorsTotalAttr interface { + Attribute + implPrometheusSDFileReadErrorsTotal() +} + +func (m PrometheusSDFileReadErrorsTotal) With( + extra ...PrometheusSDFileReadErrorsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDFileScanDurationSeconds records the duration of the file SD scan. +type PrometheusSDFileScanDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusSDFileScanDurationSeconds returns a new PrometheusSDFileScanDurationSeconds instrument. +func NewPrometheusSDFileScanDurationSeconds() PrometheusSDFileScanDurationSeconds { + labels := []string{} + return PrometheusSDFileScanDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_sd_file_scan_duration_seconds", + Help: "The duration of the file SD scan.", + }, labels), + } +} + +type PrometheusSDFileScanDurationSecondsAttr interface { + Attribute + implPrometheusSDFileScanDurationSeconds() +} + +func (m PrometheusSDFileScanDurationSeconds) With( + extra ...PrometheusSDFileScanDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusSDFileWatcherErrorsTotal records the number of file SD watcher errors. +type PrometheusSDFileWatcherErrorsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDFileWatcherErrorsTotal returns a new PrometheusSDFileWatcherErrorsTotal instrument. +func NewPrometheusSDFileWatcherErrorsTotal() PrometheusSDFileWatcherErrorsTotal { + labels := []string{} + return PrometheusSDFileWatcherErrorsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_file_watcher_errors_total", + Help: "Number of file SD watcher errors.", + }, labels), + } +} + +type PrometheusSDFileWatcherErrorsTotalAttr interface { + Attribute + implPrometheusSDFileWatcherErrorsTotal() +} + +func (m PrometheusSDFileWatcherErrorsTotal) With( + extra ...PrometheusSDFileWatcherErrorsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDHTTPFailuresTotal records the number of HTTP SD failures. +type PrometheusSDHTTPFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDHTTPFailuresTotal returns a new PrometheusSDHTTPFailuresTotal instrument. +func NewPrometheusSDHTTPFailuresTotal() PrometheusSDHTTPFailuresTotal { + labels := []string{} + return PrometheusSDHTTPFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_http_failures_total", + Help: "Number of HTTP SD failures.", + }, labels), + } +} + +type PrometheusSDHTTPFailuresTotalAttr interface { + Attribute + implPrometheusSDHTTPFailuresTotal() +} + +func (m PrometheusSDHTTPFailuresTotal) With( + extra ...PrometheusSDHTTPFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDKubernetesEventsTotal records the number of Kubernetes events processed. +type PrometheusSDKubernetesEventsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDKubernetesEventsTotal returns a new PrometheusSDKubernetesEventsTotal instrument. +func NewPrometheusSDKubernetesEventsTotal() PrometheusSDKubernetesEventsTotal { + labels := []string{ + "role", + "event", + } + return PrometheusSDKubernetesEventsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_kubernetes_events_total", + Help: "Number of Kubernetes events processed.", + }, labels), + } +} + +type PrometheusSDKubernetesEventsTotalAttr interface { + Attribute + implPrometheusSDKubernetesEventsTotal() +} + +func (a RoleAttr) implPrometheusSDKubernetesEventsTotal() {} +func (a EventAttr) implPrometheusSDKubernetesEventsTotal() {} + +func (m PrometheusSDKubernetesEventsTotal) With( + extra ...PrometheusSDKubernetesEventsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "role": "", + "event": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDKubernetesFailuresTotal records the number of Kubernetes SD failures. +type PrometheusSDKubernetesFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDKubernetesFailuresTotal returns a new PrometheusSDKubernetesFailuresTotal instrument. +func NewPrometheusSDKubernetesFailuresTotal() PrometheusSDKubernetesFailuresTotal { + labels := []string{} + return PrometheusSDKubernetesFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_kubernetes_failures_total", + Help: "Number of Kubernetes SD failures.", + }, labels), + } +} + +type PrometheusSDKubernetesFailuresTotalAttr interface { + Attribute + implPrometheusSDKubernetesFailuresTotal() +} + +func (m PrometheusSDKubernetesFailuresTotal) With( + extra ...PrometheusSDKubernetesFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDKumaFetchDurationSeconds records the duration of a Kuma MADS fetch call. +type PrometheusSDKumaFetchDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusSDKumaFetchDurationSeconds returns a new PrometheusSDKumaFetchDurationSeconds instrument. +func NewPrometheusSDKumaFetchDurationSeconds() PrometheusSDKumaFetchDurationSeconds { + labels := []string{} + return PrometheusSDKumaFetchDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_sd_kuma_fetch_duration_seconds", + Help: "The duration of a Kuma MADS fetch call.", + }, labels), + } +} + +type PrometheusSDKumaFetchDurationSecondsAttr interface { + Attribute + implPrometheusSDKumaFetchDurationSeconds() +} + +func (m PrometheusSDKumaFetchDurationSeconds) With( + extra ...PrometheusSDKumaFetchDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusSDKumaFetchFailuresTotal records the number of Kuma SD fetch failures. +type PrometheusSDKumaFetchFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDKumaFetchFailuresTotal returns a new PrometheusSDKumaFetchFailuresTotal instrument. +func NewPrometheusSDKumaFetchFailuresTotal() PrometheusSDKumaFetchFailuresTotal { + labels := []string{} + return PrometheusSDKumaFetchFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_kuma_fetch_failures_total", + Help: "Number of Kuma SD fetch failures.", + }, labels), + } +} + +type PrometheusSDKumaFetchFailuresTotalAttr interface { + Attribute + implPrometheusSDKumaFetchFailuresTotal() +} + +func (m PrometheusSDKumaFetchFailuresTotal) With( + extra ...PrometheusSDKumaFetchFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDKumaFetchSkippedUpdatesTotal records the number of Kuma SD updates skipped due to no changes. +type PrometheusSDKumaFetchSkippedUpdatesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDKumaFetchSkippedUpdatesTotal returns a new PrometheusSDKumaFetchSkippedUpdatesTotal instrument. +func NewPrometheusSDKumaFetchSkippedUpdatesTotal() PrometheusSDKumaFetchSkippedUpdatesTotal { + labels := []string{} + return PrometheusSDKumaFetchSkippedUpdatesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_kuma_fetch_skipped_updates_total", + Help: "Number of Kuma SD updates skipped due to no changes.", + }, labels), + } +} + +type PrometheusSDKumaFetchSkippedUpdatesTotalAttr interface { + Attribute + implPrometheusSDKumaFetchSkippedUpdatesTotal() +} + +func (m PrometheusSDKumaFetchSkippedUpdatesTotal) With( + extra ...PrometheusSDKumaFetchSkippedUpdatesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDLinodeFailuresTotal records the number of Linode SD failures. +type PrometheusSDLinodeFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDLinodeFailuresTotal returns a new PrometheusSDLinodeFailuresTotal instrument. +func NewPrometheusSDLinodeFailuresTotal() PrometheusSDLinodeFailuresTotal { + labels := []string{} + return PrometheusSDLinodeFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_linode_failures_total", + Help: "Number of Linode SD failures.", + }, labels), + } +} + +type PrometheusSDLinodeFailuresTotalAttr interface { + Attribute + implPrometheusSDLinodeFailuresTotal() +} + +func (m PrometheusSDLinodeFailuresTotal) With( + extra ...PrometheusSDLinodeFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDNomadFailuresTotal records the number of Nomad SD failures. +type PrometheusSDNomadFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDNomadFailuresTotal returns a new PrometheusSDNomadFailuresTotal instrument. +func NewPrometheusSDNomadFailuresTotal() PrometheusSDNomadFailuresTotal { + labels := []string{} + return PrometheusSDNomadFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_nomad_failures_total", + Help: "Number of Nomad SD failures.", + }, labels), + } +} + +type PrometheusSDNomadFailuresTotalAttr interface { + Attribute + implPrometheusSDNomadFailuresTotal() +} + +func (m PrometheusSDNomadFailuresTotal) With( + extra ...PrometheusSDNomadFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDReceivedUpdatesTotal records the total number of update events received from the SD providers. +type PrometheusSDReceivedUpdatesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDReceivedUpdatesTotal returns a new PrometheusSDReceivedUpdatesTotal instrument. +func NewPrometheusSDReceivedUpdatesTotal() PrometheusSDReceivedUpdatesTotal { + labels := []string{ + "name", + } + return PrometheusSDReceivedUpdatesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_received_updates_total", + Help: "Total number of update events received from the SD providers.", + }, labels), + } +} + +type PrometheusSDReceivedUpdatesTotalAttr interface { + Attribute + implPrometheusSDReceivedUpdatesTotal() +} + +func (a NameAttr) implPrometheusSDReceivedUpdatesTotal() {} + +func (m PrometheusSDReceivedUpdatesTotal) With( + extra ...PrometheusSDReceivedUpdatesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "name": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDRefreshDurationHistogramSeconds records the duration of a SD refresh cycle as a histogram. +type PrometheusSDRefreshDurationHistogramSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusSDRefreshDurationHistogramSeconds returns a new PrometheusSDRefreshDurationHistogramSeconds instrument. +func NewPrometheusSDRefreshDurationHistogramSeconds() PrometheusSDRefreshDurationHistogramSeconds { + labels := []string{ + "mechanism", + } + return PrometheusSDRefreshDurationHistogramSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_sd_refresh_duration_histogram_seconds", + Help: "The duration of a SD refresh cycle as a histogram.", + }, labels), + } +} + +type PrometheusSDRefreshDurationHistogramSecondsAttr interface { + Attribute + implPrometheusSDRefreshDurationHistogramSeconds() +} + +func (a MechanismAttr) implPrometheusSDRefreshDurationHistogramSeconds() {} + +func (m PrometheusSDRefreshDurationHistogramSeconds) With( + extra ...PrometheusSDRefreshDurationHistogramSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{ + "mechanism": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusSDRefreshDurationSeconds records the duration of a SD refresh cycle. +type PrometheusSDRefreshDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusSDRefreshDurationSeconds returns a new PrometheusSDRefreshDurationSeconds instrument. +func NewPrometheusSDRefreshDurationSeconds() PrometheusSDRefreshDurationSeconds { + labels := []string{} + return PrometheusSDRefreshDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_sd_refresh_duration_seconds", + Help: "The duration of a SD refresh cycle.", + }, labels), + } +} + +type PrometheusSDRefreshDurationSecondsAttr interface { + Attribute + implPrometheusSDRefreshDurationSeconds() +} + +func (m PrometheusSDRefreshDurationSeconds) With( + extra ...PrometheusSDRefreshDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusSDRefreshFailuresTotal records the number of SD refresh failures. +type PrometheusSDRefreshFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDRefreshFailuresTotal returns a new PrometheusSDRefreshFailuresTotal instrument. +func NewPrometheusSDRefreshFailuresTotal() PrometheusSDRefreshFailuresTotal { + labels := []string{ + "config", + "mechanism", + } + return PrometheusSDRefreshFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_refresh_failures_total", + Help: "Number of SD refresh failures.", + }, labels), + } +} + +type PrometheusSDRefreshFailuresTotalAttr interface { + Attribute + implPrometheusSDRefreshFailuresTotal() +} + +func (a ConfigAttr) implPrometheusSDRefreshFailuresTotal() {} +func (a MechanismAttr) implPrometheusSDRefreshFailuresTotal() {} + +func (m PrometheusSDRefreshFailuresTotal) With( + extra ...PrometheusSDRefreshFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "config": "", + "mechanism": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDUpdatesDelayedTotal records the total number of update events that couldn't be sent immediately. +type PrometheusSDUpdatesDelayedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDUpdatesDelayedTotal returns a new PrometheusSDUpdatesDelayedTotal instrument. +func NewPrometheusSDUpdatesDelayedTotal() PrometheusSDUpdatesDelayedTotal { + labels := []string{ + "name", + } + return PrometheusSDUpdatesDelayedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_updates_delayed_total", + Help: "Total number of update events that couldn't be sent immediately.", + }, labels), + } +} + +type PrometheusSDUpdatesDelayedTotalAttr interface { + Attribute + implPrometheusSDUpdatesDelayedTotal() +} + +func (a NameAttr) implPrometheusSDUpdatesDelayedTotal() {} + +func (m PrometheusSDUpdatesDelayedTotal) With( + extra ...PrometheusSDUpdatesDelayedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "name": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusSDUpdatesTotal records the total number of update events sent to the SD consumers. +type PrometheusSDUpdatesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusSDUpdatesTotal returns a new PrometheusSDUpdatesTotal instrument. +func NewPrometheusSDUpdatesTotal() PrometheusSDUpdatesTotal { + labels := []string{ + "name", + } + return PrometheusSDUpdatesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_sd_updates_total", + Help: "Total number of update events sent to the SD consumers.", + }, labels), + } +} + +type PrometheusSDUpdatesTotalAttr interface { + Attribute + implPrometheusSDUpdatesTotal() +} + +func (a NameAttr) implPrometheusSDUpdatesTotal() {} + +func (m PrometheusSDUpdatesTotal) With( + extra ...PrometheusSDUpdatesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "name": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTreecacheWatcherGoroutines records the current number of treecache watcher goroutines. +type PrometheusTreecacheWatcherGoroutines struct { + *prometheus.GaugeVec +} + +// NewPrometheusTreecacheWatcherGoroutines returns a new PrometheusTreecacheWatcherGoroutines instrument. +func NewPrometheusTreecacheWatcherGoroutines() PrometheusTreecacheWatcherGoroutines { + labels := []string{} + return PrometheusTreecacheWatcherGoroutines{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_treecache_watcher_goroutines", + Help: "The current number of treecache watcher goroutines.", + }, labels), + } +} + +type PrometheusTreecacheWatcherGoroutinesAttr interface { + Attribute + implPrometheusTreecacheWatcherGoroutines() +} + +func (m PrometheusTreecacheWatcherGoroutines) With( + extra ...PrometheusTreecacheWatcherGoroutinesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTreecacheZookeeperFailuresTotal records the total number of ZooKeeper failures. +type PrometheusTreecacheZookeeperFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTreecacheZookeeperFailuresTotal returns a new PrometheusTreecacheZookeeperFailuresTotal instrument. +func NewPrometheusTreecacheZookeeperFailuresTotal() PrometheusTreecacheZookeeperFailuresTotal { + labels := []string{} + return PrometheusTreecacheZookeeperFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_treecache_zookeeper_failures_total", + Help: "Total number of ZooKeeper failures.", + }, labels), + } +} + +type PrometheusTreecacheZookeeperFailuresTotalAttr interface { + Attribute + implPrometheusTreecacheZookeeperFailuresTotal() +} + +func (m PrometheusTreecacheZookeeperFailuresTotal) With( + extra ...PrometheusTreecacheZookeeperFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} diff --git a/notifier/semconv/README.md b/notifier/semconv/README.md new file mode 100644 index 0000000000..626097bb8c --- /dev/null +++ b/notifier/semconv/README.md @@ -0,0 +1,51 @@ + + +# Metrics + +This document describes the metrics defined in this semantic convention registry. + +| Metric | Type | Unit | Description | +|--------|------|------|-------------| +| `prometheus_notifications_alertmanagers_discovered` | gauge | {alertmanager} | The number of alertmanagers discovered and active. | +| `prometheus_notifications_dropped_total` | counter | {notification} | Total number of alerts dropped due to errors when sending to Alertmanager. | +| `prometheus_notifications_queue_capacity` | gauge | {notification} | The capacity of the alert notifications queue. | +| `prometheus_notifications_queue_length` | gauge | {notification} | The number of alert notifications in the queue. | + + +## Metric Details + + +### `prometheus_notifications_alertmanagers_discovered` + +The number of alertmanagers discovered and active. + +- **Type:** gauge +- **Unit:** {alertmanager} +- **Stability:** development + + +### `prometheus_notifications_dropped_total` + +Total number of alerts dropped due to errors when sending to Alertmanager. + +- **Type:** counter +- **Unit:** {notification} +- **Stability:** development + + +### `prometheus_notifications_queue_capacity` + +The capacity of the alert notifications queue. + +- **Type:** gauge +- **Unit:** {notification} +- **Stability:** development + + +### `prometheus_notifications_queue_length` + +The number of alert notifications in the queue. + +- **Type:** gauge +- **Unit:** {notification} +- **Stability:** development diff --git a/notifier/semconv/metrics.go b/notifier/semconv/metrics.go new file mode 100644 index 0000000000..30481f41ba --- /dev/null +++ b/notifier/semconv/metrics.go @@ -0,0 +1,139 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package metrics provides Prometheus instrumentation types for metrics +// defined in this semantic convention registry. +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// Attribute is an interface for metric label attributes. +type Attribute interface { + ID() string + Value() string +} + +// PrometheusNotificationsAlertmanagersDiscovered records the number of alertmanagers discovered and active. +type PrometheusNotificationsAlertmanagersDiscovered struct { + *prometheus.GaugeVec +} + +// NewPrometheusNotificationsAlertmanagersDiscovered returns a new PrometheusNotificationsAlertmanagersDiscovered instrument. +func NewPrometheusNotificationsAlertmanagersDiscovered() PrometheusNotificationsAlertmanagersDiscovered { + labels := []string{} + return PrometheusNotificationsAlertmanagersDiscovered{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_notifications_alertmanagers_discovered", + Help: "The number of alertmanagers discovered and active.", + }, labels), + } +} + +type PrometheusNotificationsAlertmanagersDiscoveredAttr interface { + Attribute + implPrometheusNotificationsAlertmanagersDiscovered() +} + +func (m PrometheusNotificationsAlertmanagersDiscovered) With( + extra ...PrometheusNotificationsAlertmanagersDiscoveredAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusNotificationsDroppedTotal records the total number of alerts dropped due to errors when sending to Alertmanager. +type PrometheusNotificationsDroppedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusNotificationsDroppedTotal returns a new PrometheusNotificationsDroppedTotal instrument. +func NewPrometheusNotificationsDroppedTotal() PrometheusNotificationsDroppedTotal { + labels := []string{} + return PrometheusNotificationsDroppedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_notifications_dropped_total", + Help: "Total number of alerts dropped due to errors when sending to Alertmanager.", + }, labels), + } +} + +type PrometheusNotificationsDroppedTotalAttr interface { + Attribute + implPrometheusNotificationsDroppedTotal() +} + +func (m PrometheusNotificationsDroppedTotal) With( + extra ...PrometheusNotificationsDroppedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusNotificationsQueueCapacity records the capacity of the alert notifications queue. +type PrometheusNotificationsQueueCapacity struct { + *prometheus.GaugeVec +} + +// NewPrometheusNotificationsQueueCapacity returns a new PrometheusNotificationsQueueCapacity instrument. +func NewPrometheusNotificationsQueueCapacity() PrometheusNotificationsQueueCapacity { + labels := []string{} + return PrometheusNotificationsQueueCapacity{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_notifications_queue_capacity", + Help: "The capacity of the alert notifications queue.", + }, labels), + } +} + +type PrometheusNotificationsQueueCapacityAttr interface { + Attribute + implPrometheusNotificationsQueueCapacity() +} + +func (m PrometheusNotificationsQueueCapacity) With( + extra ...PrometheusNotificationsQueueCapacityAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusNotificationsQueueLength records the number of alert notifications in the queue. +type PrometheusNotificationsQueueLength struct { + *prometheus.GaugeVec +} + +// NewPrometheusNotificationsQueueLength returns a new PrometheusNotificationsQueueLength instrument. +func NewPrometheusNotificationsQueueLength() PrometheusNotificationsQueueLength { + labels := []string{} + return PrometheusNotificationsQueueLength{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_notifications_queue_length", + Help: "The number of alert notifications in the queue.", + }, labels), + } +} + +type PrometheusNotificationsQueueLengthAttr interface { + Attribute + implPrometheusNotificationsQueueLength() +} + +func (m PrometheusNotificationsQueueLength) With( + extra ...PrometheusNotificationsQueueLengthAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} diff --git a/promql/semconv/README.md b/promql/semconv/README.md new file mode 100644 index 0000000000..d6b8c813dd --- /dev/null +++ b/promql/semconv/README.md @@ -0,0 +1,88 @@ + + +# Metrics + +This document describes the metrics defined in this semantic convention registry. + +| Metric | Type | Unit | Description | +|--------|------|------|-------------| +| `prometheus_engine_queries` | gauge | {query} | The current number of queries being executed or waiting. | +| `prometheus_engine_queries_concurrent_max` | gauge | {query} | The max number of concurrent queries. | +| `prometheus_engine_query_duration_histogram_seconds` | histogram | s | Histogram of query timings. | +| `prometheus_engine_query_duration_seconds` | histogram | s | Query timings. | +| `prometheus_engine_query_log_enabled` | gauge | 1 | State of the query log. | +| `prometheus_engine_query_log_failures_total` | counter | {failure} | The number of query log failures. | +| `prometheus_engine_query_samples_total` | counter | {sample} | The total number of samples loaded by all queries. | + + +## Metric Details + + +### `prometheus_engine_queries` + +The current number of queries being executed or waiting. + +- **Type:** gauge +- **Unit:** {query} +- **Stability:** development + + +### `prometheus_engine_queries_concurrent_max` + +The max number of concurrent queries. + +- **Type:** gauge +- **Unit:** {query} +- **Stability:** development + + +### `prometheus_engine_query_duration_histogram_seconds` + +Histogram of query timings. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `slice` | string | The query execution phase. | inner_eval, prepare_time, queue_time, result_sort | + + + +### `prometheus_engine_query_duration_seconds` + +Query timings. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_engine_query_log_enabled` + +State of the query log. + +- **Type:** gauge +- **Unit:** 1 +- **Stability:** development + + +### `prometheus_engine_query_log_failures_total` + +The number of query log failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + + +### `prometheus_engine_query_samples_total` + +The total number of samples loaded by all queries. + +- **Type:** counter +- **Unit:** {sample} +- **Stability:** development diff --git a/promql/semconv/metrics.go b/promql/semconv/metrics.go new file mode 100644 index 0000000000..e852c3a575 --- /dev/null +++ b/promql/semconv/metrics.go @@ -0,0 +1,247 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package metrics provides Prometheus instrumentation types for metrics +// defined in this semantic convention registry. +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// Attribute is an interface for metric label attributes. +type Attribute interface { + ID() string + Value() string +} +type SliceAttr string + +func (a SliceAttr) ID() string { + return "slice" +} + +func (a SliceAttr) Value() string { + return string(a) +} + +// PrometheusEngineQueries records the current number of queries being executed or waiting. +type PrometheusEngineQueries struct { + *prometheus.GaugeVec +} + +// NewPrometheusEngineQueries returns a new PrometheusEngineQueries instrument. +func NewPrometheusEngineQueries() PrometheusEngineQueries { + labels := []string{} + return PrometheusEngineQueries{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_engine_queries", + Help: "The current number of queries being executed or waiting.", + }, labels), + } +} + +type PrometheusEngineQueriesAttr interface { + Attribute + implPrometheusEngineQueries() +} + +func (m PrometheusEngineQueries) With( + extra ...PrometheusEngineQueriesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusEngineQueriesConcurrentMax records the max number of concurrent queries. +type PrometheusEngineQueriesConcurrentMax struct { + *prometheus.GaugeVec +} + +// NewPrometheusEngineQueriesConcurrentMax returns a new PrometheusEngineQueriesConcurrentMax instrument. +func NewPrometheusEngineQueriesConcurrentMax() PrometheusEngineQueriesConcurrentMax { + labels := []string{} + return PrometheusEngineQueriesConcurrentMax{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_engine_queries_concurrent_max", + Help: "The max number of concurrent queries.", + }, labels), + } +} + +type PrometheusEngineQueriesConcurrentMaxAttr interface { + Attribute + implPrometheusEngineQueriesConcurrentMax() +} + +func (m PrometheusEngineQueriesConcurrentMax) With( + extra ...PrometheusEngineQueriesConcurrentMaxAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusEngineQueryDurationHistogramSeconds records the histogram of query timings. +type PrometheusEngineQueryDurationHistogramSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusEngineQueryDurationHistogramSeconds returns a new PrometheusEngineQueryDurationHistogramSeconds instrument. +func NewPrometheusEngineQueryDurationHistogramSeconds() PrometheusEngineQueryDurationHistogramSeconds { + labels := []string{ + "slice", + } + return PrometheusEngineQueryDurationHistogramSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_engine_query_duration_histogram_seconds", + Help: "Histogram of query timings.", + }, labels), + } +} + +type PrometheusEngineQueryDurationHistogramSecondsAttr interface { + Attribute + implPrometheusEngineQueryDurationHistogramSeconds() +} + +func (a SliceAttr) implPrometheusEngineQueryDurationHistogramSeconds() {} + +func (m PrometheusEngineQueryDurationHistogramSeconds) With( + extra ...PrometheusEngineQueryDurationHistogramSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{ + "slice": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusEngineQueryDurationSeconds records the query timings. +type PrometheusEngineQueryDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusEngineQueryDurationSeconds returns a new PrometheusEngineQueryDurationSeconds instrument. +func NewPrometheusEngineQueryDurationSeconds() PrometheusEngineQueryDurationSeconds { + labels := []string{} + return PrometheusEngineQueryDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_engine_query_duration_seconds", + Help: "Query timings.", + }, labels), + } +} + +type PrometheusEngineQueryDurationSecondsAttr interface { + Attribute + implPrometheusEngineQueryDurationSeconds() +} + +func (m PrometheusEngineQueryDurationSeconds) With( + extra ...PrometheusEngineQueryDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusEngineQueryLogEnabled records the state of the query log. +type PrometheusEngineQueryLogEnabled struct { + *prometheus.GaugeVec +} + +// NewPrometheusEngineQueryLogEnabled returns a new PrometheusEngineQueryLogEnabled instrument. +func NewPrometheusEngineQueryLogEnabled() PrometheusEngineQueryLogEnabled { + labels := []string{} + return PrometheusEngineQueryLogEnabled{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_engine_query_log_enabled", + Help: "State of the query log.", + }, labels), + } +} + +type PrometheusEngineQueryLogEnabledAttr interface { + Attribute + implPrometheusEngineQueryLogEnabled() +} + +func (m PrometheusEngineQueryLogEnabled) With( + extra ...PrometheusEngineQueryLogEnabledAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusEngineQueryLogFailuresTotal records the number of query log failures. +type PrometheusEngineQueryLogFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusEngineQueryLogFailuresTotal returns a new PrometheusEngineQueryLogFailuresTotal instrument. +func NewPrometheusEngineQueryLogFailuresTotal() PrometheusEngineQueryLogFailuresTotal { + labels := []string{} + return PrometheusEngineQueryLogFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_engine_query_log_failures_total", + Help: "The number of query log failures.", + }, labels), + } +} + +type PrometheusEngineQueryLogFailuresTotalAttr interface { + Attribute + implPrometheusEngineQueryLogFailuresTotal() +} + +func (m PrometheusEngineQueryLogFailuresTotal) With( + extra ...PrometheusEngineQueryLogFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusEngineQuerySamplesTotal records the total number of samples loaded by all queries. +type PrometheusEngineQuerySamplesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusEngineQuerySamplesTotal returns a new PrometheusEngineQuerySamplesTotal instrument. +func NewPrometheusEngineQuerySamplesTotal() PrometheusEngineQuerySamplesTotal { + labels := []string{} + return PrometheusEngineQuerySamplesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_engine_query_samples_total", + Help: "The total number of samples loaded by all queries.", + }, labels), + } +} + +type PrometheusEngineQuerySamplesTotalAttr interface { + Attribute + implPrometheusEngineQuerySamplesTotal() +} + +func (m PrometheusEngineQuerySamplesTotal) With( + extra ...PrometheusEngineQuerySamplesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} diff --git a/rules/semconv/README.md b/rules/semconv/README.md new file mode 100644 index 0000000000..6afb7665f0 --- /dev/null +++ b/rules/semconv/README.md @@ -0,0 +1,238 @@ + + +# Metrics + +This document describes the metrics defined in this semantic convention registry. + +| Metric | Type | Unit | Description | +|--------|------|------|-------------| +| `prometheus_rule_evaluation_duration_histogram_seconds` | histogram | s | The duration of rule evaluations as a histogram. | +| `prometheus_rule_evaluation_duration_seconds` | histogram | s | The duration of rule group evaluations. | +| `prometheus_rule_evaluation_failures_total` | counter | {failure} | The total number of rule evaluation failures. | +| `prometheus_rule_evaluations_total` | counter | {evaluation} | The total number of rule evaluations. | +| `prometheus_rule_group_duration_histogram_seconds` | histogram | s | The duration of rule group evaluations as a histogram. | +| `prometheus_rule_group_duration_seconds` | histogram | s | The duration of rule group evaluations. | +| `prometheus_rule_group_interval_seconds` | gauge | s | The interval of a rule group. | +| `prometheus_rule_group_iterations_missed_total` | counter | {iteration} | The total number of rule group evaluations missed due to slow rule group evaluation. | +| `prometheus_rule_group_iterations_total` | counter | {iteration} | The total number of scheduled rule group evaluations. | +| `prometheus_rule_group_last_duration_seconds` | gauge | s | The duration of the last rule group evaluation. | +| `prometheus_rule_group_last_evaluation_samples` | gauge | {sample} | The number of samples returned during the last rule group evaluation. | +| `prometheus_rule_group_last_evaluation_timestamp_seconds` | gauge | s | The timestamp of the last rule group evaluation. | +| `prometheus_rule_group_last_restore_duration_seconds` | gauge | s | The duration of the last alert restoration from the ALERTS_FOR_STATE series. | +| `prometheus_rule_group_last_rule_duration_sum_seconds` | gauge | s | The sum of the durations of all rules in the last rule group evaluation. | +| `prometheus_rule_group_rules` | gauge | {rule} | The number of rules in a rule group. | + + +## Metric Details + + +### `prometheus_rule_evaluation_duration_histogram_seconds` + +The duration of rule evaluations as a histogram. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_rule_evaluation_duration_seconds` + +The duration of rule group evaluations. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_rule_evaluation_failures_total` + +The total number of rule evaluation failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + + + +### `prometheus_rule_evaluations_total` + +The total number of rule evaluations. + +- **Type:** counter +- **Unit:** {evaluation} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + + + +### `prometheus_rule_group_duration_histogram_seconds` + +The duration of rule group evaluations as a histogram. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_rule_group_duration_seconds` + +The duration of rule group evaluations. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_rule_group_interval_seconds` + +The interval of a rule group. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + + + +### `prometheus_rule_group_iterations_missed_total` + +The total number of rule group evaluations missed due to slow rule group evaluation. + +- **Type:** counter +- **Unit:** {iteration} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + + + +### `prometheus_rule_group_iterations_total` + +The total number of scheduled rule group evaluations. + +- **Type:** counter +- **Unit:** {iteration} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + + + +### `prometheus_rule_group_last_duration_seconds` + +The duration of the last rule group evaluation. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + + + +### `prometheus_rule_group_last_evaluation_samples` + +The number of samples returned during the last rule group evaluation. + +- **Type:** gauge +- **Unit:** {sample} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + + + +### `prometheus_rule_group_last_evaluation_timestamp_seconds` + +The timestamp of the last rule group evaluation. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + + + +### `prometheus_rule_group_last_restore_duration_seconds` + +The duration of the last alert restoration from the ALERTS_FOR_STATE series. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + + + +### `prometheus_rule_group_last_rule_duration_sum_seconds` + +The sum of the durations of all rules in the last rule group evaluation. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + + + +### `prometheus_rule_group_rules` + +The number of rules in a rule group. + +- **Type:** gauge +- **Unit:** {rule} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `rule_group` | string | The rule group name. | alerting_rules.yml;my_group | + diff --git a/rules/semconv/metrics.go b/rules/semconv/metrics.go new file mode 100644 index 0000000000..5d9c921d80 --- /dev/null +++ b/rules/semconv/metrics.go @@ -0,0 +1,555 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package metrics provides Prometheus instrumentation types for metrics +// defined in this semantic convention registry. +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// Attribute is an interface for metric label attributes. +type Attribute interface { + ID() string + Value() string +} +type RuleGroupAttr string + +func (a RuleGroupAttr) ID() string { + return "rule_group" +} + +func (a RuleGroupAttr) Value() string { + return string(a) +} + +// PrometheusRuleEvaluationDurationHistogramSeconds records the duration of rule evaluations as a histogram. +type PrometheusRuleEvaluationDurationHistogramSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusRuleEvaluationDurationHistogramSeconds returns a new PrometheusRuleEvaluationDurationHistogramSeconds instrument. +func NewPrometheusRuleEvaluationDurationHistogramSeconds() PrometheusRuleEvaluationDurationHistogramSeconds { + labels := []string{} + return PrometheusRuleEvaluationDurationHistogramSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_rule_evaluation_duration_histogram_seconds", + Help: "The duration of rule evaluations as a histogram.", + }, labels), + } +} + +type PrometheusRuleEvaluationDurationHistogramSecondsAttr interface { + Attribute + implPrometheusRuleEvaluationDurationHistogramSeconds() +} + +func (m PrometheusRuleEvaluationDurationHistogramSeconds) With( + extra ...PrometheusRuleEvaluationDurationHistogramSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusRuleEvaluationDurationSeconds records the duration of rule group evaluations. +type PrometheusRuleEvaluationDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusRuleEvaluationDurationSeconds returns a new PrometheusRuleEvaluationDurationSeconds instrument. +func NewPrometheusRuleEvaluationDurationSeconds() PrometheusRuleEvaluationDurationSeconds { + labels := []string{} + return PrometheusRuleEvaluationDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_rule_evaluation_duration_seconds", + Help: "The duration of rule group evaluations.", + }, labels), + } +} + +type PrometheusRuleEvaluationDurationSecondsAttr interface { + Attribute + implPrometheusRuleEvaluationDurationSeconds() +} + +func (m PrometheusRuleEvaluationDurationSeconds) With( + extra ...PrometheusRuleEvaluationDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusRuleEvaluationFailuresTotal records the total number of rule evaluation failures. +type PrometheusRuleEvaluationFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusRuleEvaluationFailuresTotal returns a new PrometheusRuleEvaluationFailuresTotal instrument. +func NewPrometheusRuleEvaluationFailuresTotal() PrometheusRuleEvaluationFailuresTotal { + labels := []string{ + "rule_group", + } + return PrometheusRuleEvaluationFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_rule_evaluation_failures_total", + Help: "The total number of rule evaluation failures.", + }, labels), + } +} + +type PrometheusRuleEvaluationFailuresTotalAttr interface { + Attribute + implPrometheusRuleEvaluationFailuresTotal() +} + +func (a RuleGroupAttr) implPrometheusRuleEvaluationFailuresTotal() {} + +func (m PrometheusRuleEvaluationFailuresTotal) With( + extra ...PrometheusRuleEvaluationFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusRuleEvaluationsTotal records the total number of rule evaluations. +type PrometheusRuleEvaluationsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusRuleEvaluationsTotal returns a new PrometheusRuleEvaluationsTotal instrument. +func NewPrometheusRuleEvaluationsTotal() PrometheusRuleEvaluationsTotal { + labels := []string{ + "rule_group", + } + return PrometheusRuleEvaluationsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_rule_evaluations_total", + Help: "The total number of rule evaluations.", + }, labels), + } +} + +type PrometheusRuleEvaluationsTotalAttr interface { + Attribute + implPrometheusRuleEvaluationsTotal() +} + +func (a RuleGroupAttr) implPrometheusRuleEvaluationsTotal() {} + +func (m PrometheusRuleEvaluationsTotal) With( + extra ...PrometheusRuleEvaluationsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusRuleGroupDurationHistogramSeconds records the duration of rule group evaluations as a histogram. +type PrometheusRuleGroupDurationHistogramSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusRuleGroupDurationHistogramSeconds returns a new PrometheusRuleGroupDurationHistogramSeconds instrument. +func NewPrometheusRuleGroupDurationHistogramSeconds() PrometheusRuleGroupDurationHistogramSeconds { + labels := []string{} + return PrometheusRuleGroupDurationHistogramSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_rule_group_duration_histogram_seconds", + Help: "The duration of rule group evaluations as a histogram.", + }, labels), + } +} + +type PrometheusRuleGroupDurationHistogramSecondsAttr interface { + Attribute + implPrometheusRuleGroupDurationHistogramSeconds() +} + +func (m PrometheusRuleGroupDurationHistogramSeconds) With( + extra ...PrometheusRuleGroupDurationHistogramSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusRuleGroupDurationSeconds records the duration of rule group evaluations. +type PrometheusRuleGroupDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusRuleGroupDurationSeconds returns a new PrometheusRuleGroupDurationSeconds instrument. +func NewPrometheusRuleGroupDurationSeconds() PrometheusRuleGroupDurationSeconds { + labels := []string{} + return PrometheusRuleGroupDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_rule_group_duration_seconds", + Help: "The duration of rule group evaluations.", + }, labels), + } +} + +type PrometheusRuleGroupDurationSecondsAttr interface { + Attribute + implPrometheusRuleGroupDurationSeconds() +} + +func (m PrometheusRuleGroupDurationSeconds) With( + extra ...PrometheusRuleGroupDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusRuleGroupIntervalSeconds records the interval of a rule group. +type PrometheusRuleGroupIntervalSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusRuleGroupIntervalSeconds returns a new PrometheusRuleGroupIntervalSeconds instrument. +func NewPrometheusRuleGroupIntervalSeconds() PrometheusRuleGroupIntervalSeconds { + labels := []string{ + "rule_group", + } + return PrometheusRuleGroupIntervalSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_rule_group_interval_seconds", + Help: "The interval of a rule group.", + }, labels), + } +} + +type PrometheusRuleGroupIntervalSecondsAttr interface { + Attribute + implPrometheusRuleGroupIntervalSeconds() +} + +func (a RuleGroupAttr) implPrometheusRuleGroupIntervalSeconds() {} + +func (m PrometheusRuleGroupIntervalSeconds) With( + extra ...PrometheusRuleGroupIntervalSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusRuleGroupIterationsMissedTotal records the total number of rule group evaluations missed due to slow rule group evaluation. +type PrometheusRuleGroupIterationsMissedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusRuleGroupIterationsMissedTotal returns a new PrometheusRuleGroupIterationsMissedTotal instrument. +func NewPrometheusRuleGroupIterationsMissedTotal() PrometheusRuleGroupIterationsMissedTotal { + labels := []string{ + "rule_group", + } + return PrometheusRuleGroupIterationsMissedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_rule_group_iterations_missed_total", + Help: "The total number of rule group evaluations missed due to slow rule group evaluation.", + }, labels), + } +} + +type PrometheusRuleGroupIterationsMissedTotalAttr interface { + Attribute + implPrometheusRuleGroupIterationsMissedTotal() +} + +func (a RuleGroupAttr) implPrometheusRuleGroupIterationsMissedTotal() {} + +func (m PrometheusRuleGroupIterationsMissedTotal) With( + extra ...PrometheusRuleGroupIterationsMissedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusRuleGroupIterationsTotal records the total number of scheduled rule group evaluations. +type PrometheusRuleGroupIterationsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusRuleGroupIterationsTotal returns a new PrometheusRuleGroupIterationsTotal instrument. +func NewPrometheusRuleGroupIterationsTotal() PrometheusRuleGroupIterationsTotal { + labels := []string{ + "rule_group", + } + return PrometheusRuleGroupIterationsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_rule_group_iterations_total", + Help: "The total number of scheduled rule group evaluations.", + }, labels), + } +} + +type PrometheusRuleGroupIterationsTotalAttr interface { + Attribute + implPrometheusRuleGroupIterationsTotal() +} + +func (a RuleGroupAttr) implPrometheusRuleGroupIterationsTotal() {} + +func (m PrometheusRuleGroupIterationsTotal) With( + extra ...PrometheusRuleGroupIterationsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusRuleGroupLastDurationSeconds records the duration of the last rule group evaluation. +type PrometheusRuleGroupLastDurationSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusRuleGroupLastDurationSeconds returns a new PrometheusRuleGroupLastDurationSeconds instrument. +func NewPrometheusRuleGroupLastDurationSeconds() PrometheusRuleGroupLastDurationSeconds { + labels := []string{ + "rule_group", + } + return PrometheusRuleGroupLastDurationSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_rule_group_last_duration_seconds", + Help: "The duration of the last rule group evaluation.", + }, labels), + } +} + +type PrometheusRuleGroupLastDurationSecondsAttr interface { + Attribute + implPrometheusRuleGroupLastDurationSeconds() +} + +func (a RuleGroupAttr) implPrometheusRuleGroupLastDurationSeconds() {} + +func (m PrometheusRuleGroupLastDurationSeconds) With( + extra ...PrometheusRuleGroupLastDurationSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusRuleGroupLastEvaluationSamples records the number of samples returned during the last rule group evaluation. +type PrometheusRuleGroupLastEvaluationSamples struct { + *prometheus.GaugeVec +} + +// NewPrometheusRuleGroupLastEvaluationSamples returns a new PrometheusRuleGroupLastEvaluationSamples instrument. +func NewPrometheusRuleGroupLastEvaluationSamples() PrometheusRuleGroupLastEvaluationSamples { + labels := []string{ + "rule_group", + } + return PrometheusRuleGroupLastEvaluationSamples{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_rule_group_last_evaluation_samples", + Help: "The number of samples returned during the last rule group evaluation.", + }, labels), + } +} + +type PrometheusRuleGroupLastEvaluationSamplesAttr interface { + Attribute + implPrometheusRuleGroupLastEvaluationSamples() +} + +func (a RuleGroupAttr) implPrometheusRuleGroupLastEvaluationSamples() {} + +func (m PrometheusRuleGroupLastEvaluationSamples) With( + extra ...PrometheusRuleGroupLastEvaluationSamplesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusRuleGroupLastEvaluationTimestampSeconds records the timestamp of the last rule group evaluation. +type PrometheusRuleGroupLastEvaluationTimestampSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusRuleGroupLastEvaluationTimestampSeconds returns a new PrometheusRuleGroupLastEvaluationTimestampSeconds instrument. +func NewPrometheusRuleGroupLastEvaluationTimestampSeconds() PrometheusRuleGroupLastEvaluationTimestampSeconds { + labels := []string{ + "rule_group", + } + return PrometheusRuleGroupLastEvaluationTimestampSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_rule_group_last_evaluation_timestamp_seconds", + Help: "The timestamp of the last rule group evaluation.", + }, labels), + } +} + +type PrometheusRuleGroupLastEvaluationTimestampSecondsAttr interface { + Attribute + implPrometheusRuleGroupLastEvaluationTimestampSeconds() +} + +func (a RuleGroupAttr) implPrometheusRuleGroupLastEvaluationTimestampSeconds() {} + +func (m PrometheusRuleGroupLastEvaluationTimestampSeconds) With( + extra ...PrometheusRuleGroupLastEvaluationTimestampSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusRuleGroupLastRestoreDurationSeconds records the duration of the last alert restoration from the ALERTS_FOR_STATE series. +type PrometheusRuleGroupLastRestoreDurationSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusRuleGroupLastRestoreDurationSeconds returns a new PrometheusRuleGroupLastRestoreDurationSeconds instrument. +func NewPrometheusRuleGroupLastRestoreDurationSeconds() PrometheusRuleGroupLastRestoreDurationSeconds { + labels := []string{ + "rule_group", + } + return PrometheusRuleGroupLastRestoreDurationSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_rule_group_last_restore_duration_seconds", + Help: "The duration of the last alert restoration from the ALERTS_FOR_STATE series.", + }, labels), + } +} + +type PrometheusRuleGroupLastRestoreDurationSecondsAttr interface { + Attribute + implPrometheusRuleGroupLastRestoreDurationSeconds() +} + +func (a RuleGroupAttr) implPrometheusRuleGroupLastRestoreDurationSeconds() {} + +func (m PrometheusRuleGroupLastRestoreDurationSeconds) With( + extra ...PrometheusRuleGroupLastRestoreDurationSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusRuleGroupLastRuleDurationSumSeconds records the sum of the durations of all rules in the last rule group evaluation. +type PrometheusRuleGroupLastRuleDurationSumSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusRuleGroupLastRuleDurationSumSeconds returns a new PrometheusRuleGroupLastRuleDurationSumSeconds instrument. +func NewPrometheusRuleGroupLastRuleDurationSumSeconds() PrometheusRuleGroupLastRuleDurationSumSeconds { + labels := []string{ + "rule_group", + } + return PrometheusRuleGroupLastRuleDurationSumSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_rule_group_last_rule_duration_sum_seconds", + Help: "The sum of the durations of all rules in the last rule group evaluation.", + }, labels), + } +} + +type PrometheusRuleGroupLastRuleDurationSumSecondsAttr interface { + Attribute + implPrometheusRuleGroupLastRuleDurationSumSeconds() +} + +func (a RuleGroupAttr) implPrometheusRuleGroupLastRuleDurationSumSeconds() {} + +func (m PrometheusRuleGroupLastRuleDurationSumSeconds) With( + extra ...PrometheusRuleGroupLastRuleDurationSumSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusRuleGroupRules records the number of rules in a rule group. +type PrometheusRuleGroupRules struct { + *prometheus.GaugeVec +} + +// NewPrometheusRuleGroupRules returns a new PrometheusRuleGroupRules instrument. +func NewPrometheusRuleGroupRules() PrometheusRuleGroupRules { + labels := []string{ + "rule_group", + } + return PrometheusRuleGroupRules{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_rule_group_rules", + Help: "The number of rules in a rule group.", + }, labels), + } +} + +type PrometheusRuleGroupRulesAttr interface { + Attribute + implPrometheusRuleGroupRules() +} + +func (a RuleGroupAttr) implPrometheusRuleGroupRules() {} + +func (m PrometheusRuleGroupRules) With( + extra ...PrometheusRuleGroupRulesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "rule_group": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} diff --git a/scrape/semconv/README.md b/scrape/semconv/README.md new file mode 100644 index 0000000000..e39e3d324e --- /dev/null +++ b/scrape/semconv/README.md @@ -0,0 +1,334 @@ + + +# Metrics + +This document describes the metrics defined in this semantic convention registry. + +| Metric | Type | Unit | Description | +|--------|------|------|-------------| +| `prometheus_target_interval_length_histogram_seconds` | histogram | s | Actual intervals between scrapes as a histogram. | +| `prometheus_target_interval_length_seconds` | histogram | s | Actual intervals between scrapes. | +| `prometheus_target_metadata_cache_bytes` | gauge | By | The number of bytes that are currently used for storing metric metadata in the cache. | +| `prometheus_target_metadata_cache_entries` | gauge | {entry} | Total number of metric metadata entries in the cache. | +| `prometheus_target_scrape_duration_seconds` | histogram | s | Scrape request latency histogram. | +| `prometheus_target_scrape_pool_exceeded_label_limits_total` | counter | {occurrence} | Total number of times scrape pools hit the label limits. | +| `prometheus_target_scrape_pool_exceeded_target_limit_total` | counter | {occurrence} | Total number of times scrape pools hit the target limit. | +| `prometheus_target_scrape_pool_reloads_failed_total` | counter | {reload} | Total number of failed scrape pool reloads. | +| `prometheus_target_scrape_pool_reloads_total` | counter | {reload} | Total number of scrape pool reloads. | +| `prometheus_target_scrape_pool_symboltable_items` | gauge | {symbol} | Current number of symbols in the scrape pool symbol table. | +| `prometheus_target_scrape_pool_sync_total` | counter | {sync} | Total number of syncs that were executed on a scrape pool. | +| `prometheus_target_scrape_pool_target_limit` | gauge | {target} | Maximum number of targets allowed in this scrape pool. | +| `prometheus_target_scrape_pool_targets` | gauge | {target} | Current number of targets in this scrape pool. | +| `prometheus_target_scrape_pools_failed_total` | counter | {pool} | Total number of scrape pool creations that failed. | +| `prometheus_target_scrape_pools_total` | counter | {pool} | Total number of scrape pool creation attempts. | +| `prometheus_target_scrapes_cache_flush_forced_total` | counter | {scrape} | Total number of scrapes that forced a complete label cache flush. | +| `prometheus_target_scrapes_exceeded_body_size_limit_total` | counter | {scrape} | Total number of scrapes that hit the body size limit. | +| `prometheus_target_scrapes_exceeded_native_histogram_bucket_limit_total` | counter | {scrape} | Total number of scrapes that hit the native histogram bucket limit. | +| `prometheus_target_scrapes_exceeded_sample_limit_total` | counter | {scrape} | Total number of scrapes that hit the sample limit. | +| `prometheus_target_scrapes_exemplar_out_of_order_total` | counter | {exemplar} | Total number of exemplar rejected due to not being out of the expected order. | +| `prometheus_target_scrapes_sample_duplicate_timestamp_total` | counter | {sample} | Total number of samples rejected due to duplicate timestamps but different values. | +| `prometheus_target_scrapes_sample_out_of_bounds_total` | counter | {sample} | Total number of samples rejected due to timestamp falling outside of the time bounds. | +| `prometheus_target_scrapes_sample_out_of_order_total` | counter | {sample} | Total number of samples rejected due to not being out of the expected order. | +| `prometheus_target_sync_failed_total` | counter | {sync} | Total number of target sync failures. | +| `prometheus_target_sync_length_histogram_seconds` | histogram | s | Actual interval to sync the scrape pool as a histogram. | +| `prometheus_target_sync_length_seconds` | histogram | s | Actual interval to sync the scrape pool. | + + +## Metric Details + + +### `prometheus_target_interval_length_histogram_seconds` + +Actual intervals between scrapes as a histogram. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `interval` | string | The configured scrape interval. | 15s, 30s | + + + +### `prometheus_target_interval_length_seconds` + +Actual intervals between scrapes. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_target_metadata_cache_bytes` + +The number of bytes that are currently used for storing metric metadata in the cache. + +- **Type:** gauge +- **Unit:** By +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `scrape_job` | string | The scrape job name. | prometheus, node_exporter | + + + +### `prometheus_target_metadata_cache_entries` + +Total number of metric metadata entries in the cache. + +- **Type:** gauge +- **Unit:** {entry} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `scrape_job` | string | The scrape job name. | prometheus, node_exporter | + + + +### `prometheus_target_scrape_duration_seconds` + +Scrape request latency histogram. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_target_scrape_pool_exceeded_label_limits_total` + +Total number of times scrape pools hit the label limits. + +- **Type:** counter +- **Unit:** {occurrence} +- **Stability:** development + + +### `prometheus_target_scrape_pool_exceeded_target_limit_total` + +Total number of times scrape pools hit the target limit. + +- **Type:** counter +- **Unit:** {occurrence} +- **Stability:** development + + +### `prometheus_target_scrape_pool_reloads_failed_total` + +Total number of failed scrape pool reloads. + +- **Type:** counter +- **Unit:** {reload} +- **Stability:** development + + +### `prometheus_target_scrape_pool_reloads_total` + +Total number of scrape pool reloads. + +- **Type:** counter +- **Unit:** {reload} +- **Stability:** development + + +### `prometheus_target_scrape_pool_symboltable_items` + +Current number of symbols in the scrape pool symbol table. + +- **Type:** gauge +- **Unit:** {symbol} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `scrape_job` | string | The scrape job name. | prometheus, node_exporter | + + + +### `prometheus_target_scrape_pool_sync_total` + +Total number of syncs that were executed on a scrape pool. + +- **Type:** counter +- **Unit:** {sync} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `scrape_job` | string | The scrape job name. | prometheus, node_exporter | + + + +### `prometheus_target_scrape_pool_target_limit` + +Maximum number of targets allowed in this scrape pool. + +- **Type:** gauge +- **Unit:** {target} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `scrape_job` | string | The scrape job name. | prometheus, node_exporter | + + + +### `prometheus_target_scrape_pool_targets` + +Current number of targets in this scrape pool. + +- **Type:** gauge +- **Unit:** {target} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `scrape_job` | string | The scrape job name. | prometheus, node_exporter | + + + +### `prometheus_target_scrape_pools_failed_total` + +Total number of scrape pool creations that failed. + +- **Type:** counter +- **Unit:** {pool} +- **Stability:** development + + +### `prometheus_target_scrape_pools_total` + +Total number of scrape pool creation attempts. + +- **Type:** counter +- **Unit:** {pool} +- **Stability:** development + + +### `prometheus_target_scrapes_cache_flush_forced_total` + +Total number of scrapes that forced a complete label cache flush. + +- **Type:** counter +- **Unit:** {scrape} +- **Stability:** development + + +### `prometheus_target_scrapes_exceeded_body_size_limit_total` + +Total number of scrapes that hit the body size limit. + +- **Type:** counter +- **Unit:** {scrape} +- **Stability:** development + + +### `prometheus_target_scrapes_exceeded_native_histogram_bucket_limit_total` + +Total number of scrapes that hit the native histogram bucket limit. + +- **Type:** counter +- **Unit:** {scrape} +- **Stability:** development + + +### `prometheus_target_scrapes_exceeded_sample_limit_total` + +Total number of scrapes that hit the sample limit. + +- **Type:** counter +- **Unit:** {scrape} +- **Stability:** development + + +### `prometheus_target_scrapes_exemplar_out_of_order_total` + +Total number of exemplar rejected due to not being out of the expected order. + +- **Type:** counter +- **Unit:** {exemplar} +- **Stability:** development + + +### `prometheus_target_scrapes_sample_duplicate_timestamp_total` + +Total number of samples rejected due to duplicate timestamps but different values. + +- **Type:** counter +- **Unit:** {sample} +- **Stability:** development + + +### `prometheus_target_scrapes_sample_out_of_bounds_total` + +Total number of samples rejected due to timestamp falling outside of the time bounds. + +- **Type:** counter +- **Unit:** {sample} +- **Stability:** development + + +### `prometheus_target_scrapes_sample_out_of_order_total` + +Total number of samples rejected due to not being out of the expected order. + +- **Type:** counter +- **Unit:** {sample} +- **Stability:** development + + +### `prometheus_target_sync_failed_total` + +Total number of target sync failures. + +- **Type:** counter +- **Unit:** {sync} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `scrape_job` | string | The scrape job name. | prometheus, node_exporter | + + + +### `prometheus_target_sync_length_histogram_seconds` + +Actual interval to sync the scrape pool as a histogram. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `scrape_job` | string | The scrape job name. | prometheus, node_exporter | + + + +### `prometheus_target_sync_length_seconds` + +Actual interval to sync the scrape pool. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development diff --git a/scrape/semconv/metrics.go b/scrape/semconv/metrics.go new file mode 100644 index 0000000000..b7a958b35c --- /dev/null +++ b/scrape/semconv/metrics.go @@ -0,0 +1,894 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package metrics provides Prometheus instrumentation types for metrics +// defined in this semantic convention registry. +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// Attribute is an interface for metric label attributes. +type Attribute interface { + ID() string + Value() string +} +type IntervalAttr string + +func (a IntervalAttr) ID() string { + return "interval" +} + +func (a IntervalAttr) Value() string { + return string(a) +} + +type ScrapeJobAttr string + +func (a ScrapeJobAttr) ID() string { + return "scrape_job" +} + +func (a ScrapeJobAttr) Value() string { + return string(a) +} + +// PrometheusTargetIntervalLengthHistogramSeconds records the actual intervals between scrapes as a histogram. +type PrometheusTargetIntervalLengthHistogramSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTargetIntervalLengthHistogramSeconds returns a new PrometheusTargetIntervalLengthHistogramSeconds instrument. +func NewPrometheusTargetIntervalLengthHistogramSeconds() PrometheusTargetIntervalLengthHistogramSeconds { + labels := []string{ + "interval", + } + return PrometheusTargetIntervalLengthHistogramSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_target_interval_length_histogram_seconds", + Help: "Actual intervals between scrapes as a histogram.", + }, labels), + } +} + +type PrometheusTargetIntervalLengthHistogramSecondsAttr interface { + Attribute + implPrometheusTargetIntervalLengthHistogramSeconds() +} + +func (a IntervalAttr) implPrometheusTargetIntervalLengthHistogramSeconds() {} + +func (m PrometheusTargetIntervalLengthHistogramSeconds) With( + extra ...PrometheusTargetIntervalLengthHistogramSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{ + "interval": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTargetIntervalLengthSeconds records the actual intervals between scrapes. +type PrometheusTargetIntervalLengthSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTargetIntervalLengthSeconds returns a new PrometheusTargetIntervalLengthSeconds instrument. +func NewPrometheusTargetIntervalLengthSeconds() PrometheusTargetIntervalLengthSeconds { + labels := []string{} + return PrometheusTargetIntervalLengthSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_target_interval_length_seconds", + Help: "Actual intervals between scrapes.", + }, labels), + } +} + +type PrometheusTargetIntervalLengthSecondsAttr interface { + Attribute + implPrometheusTargetIntervalLengthSeconds() +} + +func (m PrometheusTargetIntervalLengthSeconds) With( + extra ...PrometheusTargetIntervalLengthSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTargetMetadataCacheBytes records the number of bytes that are currently used for storing metric metadata in the cache. +type PrometheusTargetMetadataCacheBytes struct { + *prometheus.GaugeVec +} + +// NewPrometheusTargetMetadataCacheBytes returns a new PrometheusTargetMetadataCacheBytes instrument. +func NewPrometheusTargetMetadataCacheBytes() PrometheusTargetMetadataCacheBytes { + labels := []string{ + "scrape_job", + } + return PrometheusTargetMetadataCacheBytes{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_target_metadata_cache_bytes", + Help: "The number of bytes that are currently used for storing metric metadata in the cache.", + }, labels), + } +} + +type PrometheusTargetMetadataCacheBytesAttr interface { + Attribute + implPrometheusTargetMetadataCacheBytes() +} + +func (a ScrapeJobAttr) implPrometheusTargetMetadataCacheBytes() {} + +func (m PrometheusTargetMetadataCacheBytes) With( + extra ...PrometheusTargetMetadataCacheBytesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "scrape_job": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTargetMetadataCacheEntries records the total number of metric metadata entries in the cache. +type PrometheusTargetMetadataCacheEntries struct { + *prometheus.GaugeVec +} + +// NewPrometheusTargetMetadataCacheEntries returns a new PrometheusTargetMetadataCacheEntries instrument. +func NewPrometheusTargetMetadataCacheEntries() PrometheusTargetMetadataCacheEntries { + labels := []string{ + "scrape_job", + } + return PrometheusTargetMetadataCacheEntries{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_target_metadata_cache_entries", + Help: "Total number of metric metadata entries in the cache.", + }, labels), + } +} + +type PrometheusTargetMetadataCacheEntriesAttr interface { + Attribute + implPrometheusTargetMetadataCacheEntries() +} + +func (a ScrapeJobAttr) implPrometheusTargetMetadataCacheEntries() {} + +func (m PrometheusTargetMetadataCacheEntries) With( + extra ...PrometheusTargetMetadataCacheEntriesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "scrape_job": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTargetScrapeDurationSeconds records the scrape request latency histogram. +type PrometheusTargetScrapeDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTargetScrapeDurationSeconds returns a new PrometheusTargetScrapeDurationSeconds instrument. +func NewPrometheusTargetScrapeDurationSeconds() PrometheusTargetScrapeDurationSeconds { + labels := []string{} + return PrometheusTargetScrapeDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_target_scrape_duration_seconds", + Help: "Scrape request latency histogram.", + }, labels), + } +} + +type PrometheusTargetScrapeDurationSecondsAttr interface { + Attribute + implPrometheusTargetScrapeDurationSeconds() +} + +func (m PrometheusTargetScrapeDurationSeconds) With( + extra ...PrometheusTargetScrapeDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTargetScrapePoolExceededLabelLimitsTotal records the total number of times scrape pools hit the label limits. +type PrometheusTargetScrapePoolExceededLabelLimitsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapePoolExceededLabelLimitsTotal returns a new PrometheusTargetScrapePoolExceededLabelLimitsTotal instrument. +func NewPrometheusTargetScrapePoolExceededLabelLimitsTotal() PrometheusTargetScrapePoolExceededLabelLimitsTotal { + labels := []string{} + return PrometheusTargetScrapePoolExceededLabelLimitsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrape_pool_exceeded_label_limits_total", + Help: "Total number of times scrape pools hit the label limits.", + }, labels), + } +} + +type PrometheusTargetScrapePoolExceededLabelLimitsTotalAttr interface { + Attribute + implPrometheusTargetScrapePoolExceededLabelLimitsTotal() +} + +func (m PrometheusTargetScrapePoolExceededLabelLimitsTotal) With( + extra ...PrometheusTargetScrapePoolExceededLabelLimitsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapePoolExceededTargetLimitTotal records the total number of times scrape pools hit the target limit. +type PrometheusTargetScrapePoolExceededTargetLimitTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapePoolExceededTargetLimitTotal returns a new PrometheusTargetScrapePoolExceededTargetLimitTotal instrument. +func NewPrometheusTargetScrapePoolExceededTargetLimitTotal() PrometheusTargetScrapePoolExceededTargetLimitTotal { + labels := []string{} + return PrometheusTargetScrapePoolExceededTargetLimitTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrape_pool_exceeded_target_limit_total", + Help: "Total number of times scrape pools hit the target limit.", + }, labels), + } +} + +type PrometheusTargetScrapePoolExceededTargetLimitTotalAttr interface { + Attribute + implPrometheusTargetScrapePoolExceededTargetLimitTotal() +} + +func (m PrometheusTargetScrapePoolExceededTargetLimitTotal) With( + extra ...PrometheusTargetScrapePoolExceededTargetLimitTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapePoolReloadsFailedTotal records the total number of failed scrape pool reloads. +type PrometheusTargetScrapePoolReloadsFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapePoolReloadsFailedTotal returns a new PrometheusTargetScrapePoolReloadsFailedTotal instrument. +func NewPrometheusTargetScrapePoolReloadsFailedTotal() PrometheusTargetScrapePoolReloadsFailedTotal { + labels := []string{} + return PrometheusTargetScrapePoolReloadsFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrape_pool_reloads_failed_total", + Help: "Total number of failed scrape pool reloads.", + }, labels), + } +} + +type PrometheusTargetScrapePoolReloadsFailedTotalAttr interface { + Attribute + implPrometheusTargetScrapePoolReloadsFailedTotal() +} + +func (m PrometheusTargetScrapePoolReloadsFailedTotal) With( + extra ...PrometheusTargetScrapePoolReloadsFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapePoolReloadsTotal records the total number of scrape pool reloads. +type PrometheusTargetScrapePoolReloadsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapePoolReloadsTotal returns a new PrometheusTargetScrapePoolReloadsTotal instrument. +func NewPrometheusTargetScrapePoolReloadsTotal() PrometheusTargetScrapePoolReloadsTotal { + labels := []string{} + return PrometheusTargetScrapePoolReloadsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrape_pool_reloads_total", + Help: "Total number of scrape pool reloads.", + }, labels), + } +} + +type PrometheusTargetScrapePoolReloadsTotalAttr interface { + Attribute + implPrometheusTargetScrapePoolReloadsTotal() +} + +func (m PrometheusTargetScrapePoolReloadsTotal) With( + extra ...PrometheusTargetScrapePoolReloadsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapePoolSymboltableItems records the current number of symbols in the scrape pool symbol table. +type PrometheusTargetScrapePoolSymboltableItems struct { + *prometheus.GaugeVec +} + +// NewPrometheusTargetScrapePoolSymboltableItems returns a new PrometheusTargetScrapePoolSymboltableItems instrument. +func NewPrometheusTargetScrapePoolSymboltableItems() PrometheusTargetScrapePoolSymboltableItems { + labels := []string{ + "scrape_job", + } + return PrometheusTargetScrapePoolSymboltableItems{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_target_scrape_pool_symboltable_items", + Help: "Current number of symbols in the scrape pool symbol table.", + }, labels), + } +} + +type PrometheusTargetScrapePoolSymboltableItemsAttr interface { + Attribute + implPrometheusTargetScrapePoolSymboltableItems() +} + +func (a ScrapeJobAttr) implPrometheusTargetScrapePoolSymboltableItems() {} + +func (m PrometheusTargetScrapePoolSymboltableItems) With( + extra ...PrometheusTargetScrapePoolSymboltableItemsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "scrape_job": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTargetScrapePoolSyncTotal records the total number of syncs that were executed on a scrape pool. +type PrometheusTargetScrapePoolSyncTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapePoolSyncTotal returns a new PrometheusTargetScrapePoolSyncTotal instrument. +func NewPrometheusTargetScrapePoolSyncTotal() PrometheusTargetScrapePoolSyncTotal { + labels := []string{ + "scrape_job", + } + return PrometheusTargetScrapePoolSyncTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrape_pool_sync_total", + Help: "Total number of syncs that were executed on a scrape pool.", + }, labels), + } +} + +type PrometheusTargetScrapePoolSyncTotalAttr interface { + Attribute + implPrometheusTargetScrapePoolSyncTotal() +} + +func (a ScrapeJobAttr) implPrometheusTargetScrapePoolSyncTotal() {} + +func (m PrometheusTargetScrapePoolSyncTotal) With( + extra ...PrometheusTargetScrapePoolSyncTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "scrape_job": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapePoolTargetLimit records the maximum number of targets allowed in this scrape pool. +type PrometheusTargetScrapePoolTargetLimit struct { + *prometheus.GaugeVec +} + +// NewPrometheusTargetScrapePoolTargetLimit returns a new PrometheusTargetScrapePoolTargetLimit instrument. +func NewPrometheusTargetScrapePoolTargetLimit() PrometheusTargetScrapePoolTargetLimit { + labels := []string{ + "scrape_job", + } + return PrometheusTargetScrapePoolTargetLimit{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_target_scrape_pool_target_limit", + Help: "Maximum number of targets allowed in this scrape pool.", + }, labels), + } +} + +type PrometheusTargetScrapePoolTargetLimitAttr interface { + Attribute + implPrometheusTargetScrapePoolTargetLimit() +} + +func (a ScrapeJobAttr) implPrometheusTargetScrapePoolTargetLimit() {} + +func (m PrometheusTargetScrapePoolTargetLimit) With( + extra ...PrometheusTargetScrapePoolTargetLimitAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "scrape_job": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTargetScrapePoolTargets records the current number of targets in this scrape pool. +type PrometheusTargetScrapePoolTargets struct { + *prometheus.GaugeVec +} + +// NewPrometheusTargetScrapePoolTargets returns a new PrometheusTargetScrapePoolTargets instrument. +func NewPrometheusTargetScrapePoolTargets() PrometheusTargetScrapePoolTargets { + labels := []string{ + "scrape_job", + } + return PrometheusTargetScrapePoolTargets{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_target_scrape_pool_targets", + Help: "Current number of targets in this scrape pool.", + }, labels), + } +} + +type PrometheusTargetScrapePoolTargetsAttr interface { + Attribute + implPrometheusTargetScrapePoolTargets() +} + +func (a ScrapeJobAttr) implPrometheusTargetScrapePoolTargets() {} + +func (m PrometheusTargetScrapePoolTargets) With( + extra ...PrometheusTargetScrapePoolTargetsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{ + "scrape_job": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTargetScrapePoolsFailedTotal records the total number of scrape pool creations that failed. +type PrometheusTargetScrapePoolsFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapePoolsFailedTotal returns a new PrometheusTargetScrapePoolsFailedTotal instrument. +func NewPrometheusTargetScrapePoolsFailedTotal() PrometheusTargetScrapePoolsFailedTotal { + labels := []string{} + return PrometheusTargetScrapePoolsFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrape_pools_failed_total", + Help: "Total number of scrape pool creations that failed.", + }, labels), + } +} + +type PrometheusTargetScrapePoolsFailedTotalAttr interface { + Attribute + implPrometheusTargetScrapePoolsFailedTotal() +} + +func (m PrometheusTargetScrapePoolsFailedTotal) With( + extra ...PrometheusTargetScrapePoolsFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapePoolsTotal records the total number of scrape pool creation attempts. +type PrometheusTargetScrapePoolsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapePoolsTotal returns a new PrometheusTargetScrapePoolsTotal instrument. +func NewPrometheusTargetScrapePoolsTotal() PrometheusTargetScrapePoolsTotal { + labels := []string{} + return PrometheusTargetScrapePoolsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrape_pools_total", + Help: "Total number of scrape pool creation attempts.", + }, labels), + } +} + +type PrometheusTargetScrapePoolsTotalAttr interface { + Attribute + implPrometheusTargetScrapePoolsTotal() +} + +func (m PrometheusTargetScrapePoolsTotal) With( + extra ...PrometheusTargetScrapePoolsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapesCacheFlushForcedTotal records the total number of scrapes that forced a complete label cache flush. +type PrometheusTargetScrapesCacheFlushForcedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapesCacheFlushForcedTotal returns a new PrometheusTargetScrapesCacheFlushForcedTotal instrument. +func NewPrometheusTargetScrapesCacheFlushForcedTotal() PrometheusTargetScrapesCacheFlushForcedTotal { + labels := []string{} + return PrometheusTargetScrapesCacheFlushForcedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrapes_cache_flush_forced_total", + Help: "Total number of scrapes that forced a complete label cache flush.", + }, labels), + } +} + +type PrometheusTargetScrapesCacheFlushForcedTotalAttr interface { + Attribute + implPrometheusTargetScrapesCacheFlushForcedTotal() +} + +func (m PrometheusTargetScrapesCacheFlushForcedTotal) With( + extra ...PrometheusTargetScrapesCacheFlushForcedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapesExceededBodySizeLimitTotal records the total number of scrapes that hit the body size limit. +type PrometheusTargetScrapesExceededBodySizeLimitTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapesExceededBodySizeLimitTotal returns a new PrometheusTargetScrapesExceededBodySizeLimitTotal instrument. +func NewPrometheusTargetScrapesExceededBodySizeLimitTotal() PrometheusTargetScrapesExceededBodySizeLimitTotal { + labels := []string{} + return PrometheusTargetScrapesExceededBodySizeLimitTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrapes_exceeded_body_size_limit_total", + Help: "Total number of scrapes that hit the body size limit.", + }, labels), + } +} + +type PrometheusTargetScrapesExceededBodySizeLimitTotalAttr interface { + Attribute + implPrometheusTargetScrapesExceededBodySizeLimitTotal() +} + +func (m PrometheusTargetScrapesExceededBodySizeLimitTotal) With( + extra ...PrometheusTargetScrapesExceededBodySizeLimitTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapesExceededNativeHistogramBucketLimitTotal records the total number of scrapes that hit the native histogram bucket limit. +type PrometheusTargetScrapesExceededNativeHistogramBucketLimitTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapesExceededNativeHistogramBucketLimitTotal returns a new PrometheusTargetScrapesExceededNativeHistogramBucketLimitTotal instrument. +func NewPrometheusTargetScrapesExceededNativeHistogramBucketLimitTotal() PrometheusTargetScrapesExceededNativeHistogramBucketLimitTotal { + labels := []string{} + return PrometheusTargetScrapesExceededNativeHistogramBucketLimitTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrapes_exceeded_native_histogram_bucket_limit_total", + Help: "Total number of scrapes that hit the native histogram bucket limit.", + }, labels), + } +} + +type PrometheusTargetScrapesExceededNativeHistogramBucketLimitTotalAttr interface { + Attribute + implPrometheusTargetScrapesExceededNativeHistogramBucketLimitTotal() +} + +func (m PrometheusTargetScrapesExceededNativeHistogramBucketLimitTotal) With( + extra ...PrometheusTargetScrapesExceededNativeHistogramBucketLimitTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapesExceededSampleLimitTotal records the total number of scrapes that hit the sample limit. +type PrometheusTargetScrapesExceededSampleLimitTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapesExceededSampleLimitTotal returns a new PrometheusTargetScrapesExceededSampleLimitTotal instrument. +func NewPrometheusTargetScrapesExceededSampleLimitTotal() PrometheusTargetScrapesExceededSampleLimitTotal { + labels := []string{} + return PrometheusTargetScrapesExceededSampleLimitTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrapes_exceeded_sample_limit_total", + Help: "Total number of scrapes that hit the sample limit.", + }, labels), + } +} + +type PrometheusTargetScrapesExceededSampleLimitTotalAttr interface { + Attribute + implPrometheusTargetScrapesExceededSampleLimitTotal() +} + +func (m PrometheusTargetScrapesExceededSampleLimitTotal) With( + extra ...PrometheusTargetScrapesExceededSampleLimitTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapesExemplarOutOfOrderTotal records the total number of exemplar rejected due to not being out of the expected order. +type PrometheusTargetScrapesExemplarOutOfOrderTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapesExemplarOutOfOrderTotal returns a new PrometheusTargetScrapesExemplarOutOfOrderTotal instrument. +func NewPrometheusTargetScrapesExemplarOutOfOrderTotal() PrometheusTargetScrapesExemplarOutOfOrderTotal { + labels := []string{} + return PrometheusTargetScrapesExemplarOutOfOrderTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrapes_exemplar_out_of_order_total", + Help: "Total number of exemplar rejected due to not being out of the expected order.", + }, labels), + } +} + +type PrometheusTargetScrapesExemplarOutOfOrderTotalAttr interface { + Attribute + implPrometheusTargetScrapesExemplarOutOfOrderTotal() +} + +func (m PrometheusTargetScrapesExemplarOutOfOrderTotal) With( + extra ...PrometheusTargetScrapesExemplarOutOfOrderTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapesSampleDuplicateTimestampTotal records the total number of samples rejected due to duplicate timestamps but different values. +type PrometheusTargetScrapesSampleDuplicateTimestampTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapesSampleDuplicateTimestampTotal returns a new PrometheusTargetScrapesSampleDuplicateTimestampTotal instrument. +func NewPrometheusTargetScrapesSampleDuplicateTimestampTotal() PrometheusTargetScrapesSampleDuplicateTimestampTotal { + labels := []string{} + return PrometheusTargetScrapesSampleDuplicateTimestampTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrapes_sample_duplicate_timestamp_total", + Help: "Total number of samples rejected due to duplicate timestamps but different values.", + }, labels), + } +} + +type PrometheusTargetScrapesSampleDuplicateTimestampTotalAttr interface { + Attribute + implPrometheusTargetScrapesSampleDuplicateTimestampTotal() +} + +func (m PrometheusTargetScrapesSampleDuplicateTimestampTotal) With( + extra ...PrometheusTargetScrapesSampleDuplicateTimestampTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapesSampleOutOfBoundsTotal records the total number of samples rejected due to timestamp falling outside of the time bounds. +type PrometheusTargetScrapesSampleOutOfBoundsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapesSampleOutOfBoundsTotal returns a new PrometheusTargetScrapesSampleOutOfBoundsTotal instrument. +func NewPrometheusTargetScrapesSampleOutOfBoundsTotal() PrometheusTargetScrapesSampleOutOfBoundsTotal { + labels := []string{} + return PrometheusTargetScrapesSampleOutOfBoundsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrapes_sample_out_of_bounds_total", + Help: "Total number of samples rejected due to timestamp falling outside of the time bounds.", + }, labels), + } +} + +type PrometheusTargetScrapesSampleOutOfBoundsTotalAttr interface { + Attribute + implPrometheusTargetScrapesSampleOutOfBoundsTotal() +} + +func (m PrometheusTargetScrapesSampleOutOfBoundsTotal) With( + extra ...PrometheusTargetScrapesSampleOutOfBoundsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetScrapesSampleOutOfOrderTotal records the total number of samples rejected due to not being out of the expected order. +type PrometheusTargetScrapesSampleOutOfOrderTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetScrapesSampleOutOfOrderTotal returns a new PrometheusTargetScrapesSampleOutOfOrderTotal instrument. +func NewPrometheusTargetScrapesSampleOutOfOrderTotal() PrometheusTargetScrapesSampleOutOfOrderTotal { + labels := []string{} + return PrometheusTargetScrapesSampleOutOfOrderTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_scrapes_sample_out_of_order_total", + Help: "Total number of samples rejected due to not being out of the expected order.", + }, labels), + } +} + +type PrometheusTargetScrapesSampleOutOfOrderTotalAttr interface { + Attribute + implPrometheusTargetScrapesSampleOutOfOrderTotal() +} + +func (m PrometheusTargetScrapesSampleOutOfOrderTotal) With( + extra ...PrometheusTargetScrapesSampleOutOfOrderTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetSyncFailedTotal records the total number of target sync failures. +type PrometheusTargetSyncFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTargetSyncFailedTotal returns a new PrometheusTargetSyncFailedTotal instrument. +func NewPrometheusTargetSyncFailedTotal() PrometheusTargetSyncFailedTotal { + labels := []string{ + "scrape_job", + } + return PrometheusTargetSyncFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_target_sync_failed_total", + Help: "Total number of target sync failures.", + }, labels), + } +} + +type PrometheusTargetSyncFailedTotalAttr interface { + Attribute + implPrometheusTargetSyncFailedTotal() +} + +func (a ScrapeJobAttr) implPrometheusTargetSyncFailedTotal() {} + +func (m PrometheusTargetSyncFailedTotal) With( + extra ...PrometheusTargetSyncFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "scrape_job": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTargetSyncLengthHistogramSeconds records the actual interval to sync the scrape pool as a histogram. +type PrometheusTargetSyncLengthHistogramSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTargetSyncLengthHistogramSeconds returns a new PrometheusTargetSyncLengthHistogramSeconds instrument. +func NewPrometheusTargetSyncLengthHistogramSeconds() PrometheusTargetSyncLengthHistogramSeconds { + labels := []string{ + "scrape_job", + } + return PrometheusTargetSyncLengthHistogramSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_target_sync_length_histogram_seconds", + Help: "Actual interval to sync the scrape pool as a histogram.", + }, labels), + } +} + +type PrometheusTargetSyncLengthHistogramSecondsAttr interface { + Attribute + implPrometheusTargetSyncLengthHistogramSeconds() +} + +func (a ScrapeJobAttr) implPrometheusTargetSyncLengthHistogramSeconds() {} + +func (m PrometheusTargetSyncLengthHistogramSeconds) With( + extra ...PrometheusTargetSyncLengthHistogramSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{ + "scrape_job": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTargetSyncLengthSeconds records the actual interval to sync the scrape pool. +type PrometheusTargetSyncLengthSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTargetSyncLengthSeconds returns a new PrometheusTargetSyncLengthSeconds instrument. +func NewPrometheusTargetSyncLengthSeconds() PrometheusTargetSyncLengthSeconds { + labels := []string{} + return PrometheusTargetSyncLengthSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_target_sync_length_seconds", + Help: "Actual interval to sync the scrape pool.", + }, labels), + } +} + +type PrometheusTargetSyncLengthSecondsAttr interface { + Attribute + implPrometheusTargetSyncLengthSeconds() +} + +func (m PrometheusTargetSyncLengthSeconds) With( + extra ...PrometheusTargetSyncLengthSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} diff --git a/storage/remote/semconv/README.md b/storage/remote/semconv/README.md new file mode 100644 index 0000000000..9334485b98 --- /dev/null +++ b/storage/remote/semconv/README.md @@ -0,0 +1,71 @@ + + +# Metrics + +This document describes the metrics defined in this semantic convention registry. + +| Metric | Type | Unit | Description | +|--------|------|------|-------------| +| `prometheus_remote_read_handler_queries` | gauge | {query} | The number of in-flight remote read queries. | +| `prometheus_remote_storage_exemplars_in_total` | counter | {exemplar} | Exemplars in to remote storage, compare to determine dropped exemplars. | +| `prometheus_remote_storage_highest_timestamp_in_seconds` | gauge | s | Highest timestamp that has come into the remote storage via the Appender interface. | +| `prometheus_remote_storage_histograms_in_total` | counter | {histogram} | Histograms in to remote storage, compare to determine dropped histograms. | +| `prometheus_remote_storage_samples_in_total` | counter | {sample} | Samples in to remote storage, compare to determine dropped samples. | +| `prometheus_remote_storage_string_interner_zero_reference_releases_total` | counter | {release} | The number of times release has been called for strings that are not interned. | + + +## Metric Details + + +### `prometheus_remote_read_handler_queries` + +The number of in-flight remote read queries. + +- **Type:** gauge +- **Unit:** {query} +- **Stability:** development + + +### `prometheus_remote_storage_exemplars_in_total` + +Exemplars in to remote storage, compare to determine dropped exemplars. + +- **Type:** counter +- **Unit:** {exemplar} +- **Stability:** development + + +### `prometheus_remote_storage_highest_timestamp_in_seconds` + +Highest timestamp that has come into the remote storage via the Appender interface. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + + +### `prometheus_remote_storage_histograms_in_total` + +Histograms in to remote storage, compare to determine dropped histograms. + +- **Type:** counter +- **Unit:** {histogram} +- **Stability:** development + + +### `prometheus_remote_storage_samples_in_total` + +Samples in to remote storage, compare to determine dropped samples. + +- **Type:** counter +- **Unit:** {sample} +- **Stability:** development + + +### `prometheus_remote_storage_string_interner_zero_reference_releases_total` + +The number of times release has been called for strings that are not interned. + +- **Type:** counter +- **Unit:** {release} +- **Stability:** development diff --git a/storage/remote/semconv/metrics.go b/storage/remote/semconv/metrics.go new file mode 100644 index 0000000000..12bbf8d443 --- /dev/null +++ b/storage/remote/semconv/metrics.go @@ -0,0 +1,201 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package metrics provides Prometheus instrumentation types for metrics +// defined in this semantic convention registry. +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// Attribute is an interface for metric label attributes. +type Attribute interface { + ID() string + Value() string +} + +// PrometheusRemoteReadHandlerQueries records the number of in-flight remote read queries. +type PrometheusRemoteReadHandlerQueries struct { + *prometheus.GaugeVec +} + +// NewPrometheusRemoteReadHandlerQueries returns a new PrometheusRemoteReadHandlerQueries instrument. +func NewPrometheusRemoteReadHandlerQueries() PrometheusRemoteReadHandlerQueries { + labels := []string{} + return PrometheusRemoteReadHandlerQueries{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_remote_read_handler_queries", + Help: "The number of in-flight remote read queries.", + }, labels), + } +} + +type PrometheusRemoteReadHandlerQueriesAttr interface { + Attribute + implPrometheusRemoteReadHandlerQueries() +} + +func (m PrometheusRemoteReadHandlerQueries) With( + extra ...PrometheusRemoteReadHandlerQueriesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusRemoteStorageExemplarsInTotal records the exemplars in to remote storage, compare to determine dropped exemplars. +type PrometheusRemoteStorageExemplarsInTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusRemoteStorageExemplarsInTotal returns a new PrometheusRemoteStorageExemplarsInTotal instrument. +func NewPrometheusRemoteStorageExemplarsInTotal() PrometheusRemoteStorageExemplarsInTotal { + labels := []string{} + return PrometheusRemoteStorageExemplarsInTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_remote_storage_exemplars_in_total", + Help: "Exemplars in to remote storage, compare to determine dropped exemplars.", + }, labels), + } +} + +type PrometheusRemoteStorageExemplarsInTotalAttr interface { + Attribute + implPrometheusRemoteStorageExemplarsInTotal() +} + +func (m PrometheusRemoteStorageExemplarsInTotal) With( + extra ...PrometheusRemoteStorageExemplarsInTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusRemoteStorageHighestTimestampInSeconds records the highest timestamp that has come into the remote storage via the Appender interface. +type PrometheusRemoteStorageHighestTimestampInSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusRemoteStorageHighestTimestampInSeconds returns a new PrometheusRemoteStorageHighestTimestampInSeconds instrument. +func NewPrometheusRemoteStorageHighestTimestampInSeconds() PrometheusRemoteStorageHighestTimestampInSeconds { + labels := []string{} + return PrometheusRemoteStorageHighestTimestampInSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_remote_storage_highest_timestamp_in_seconds", + Help: "Highest timestamp that has come into the remote storage via the Appender interface.", + }, labels), + } +} + +type PrometheusRemoteStorageHighestTimestampInSecondsAttr interface { + Attribute + implPrometheusRemoteStorageHighestTimestampInSeconds() +} + +func (m PrometheusRemoteStorageHighestTimestampInSeconds) With( + extra ...PrometheusRemoteStorageHighestTimestampInSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusRemoteStorageHistogramsInTotal records the histograms in to remote storage, compare to determine dropped histograms. +type PrometheusRemoteStorageHistogramsInTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusRemoteStorageHistogramsInTotal returns a new PrometheusRemoteStorageHistogramsInTotal instrument. +func NewPrometheusRemoteStorageHistogramsInTotal() PrometheusRemoteStorageHistogramsInTotal { + labels := []string{} + return PrometheusRemoteStorageHistogramsInTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_remote_storage_histograms_in_total", + Help: "Histograms in to remote storage, compare to determine dropped histograms.", + }, labels), + } +} + +type PrometheusRemoteStorageHistogramsInTotalAttr interface { + Attribute + implPrometheusRemoteStorageHistogramsInTotal() +} + +func (m PrometheusRemoteStorageHistogramsInTotal) With( + extra ...PrometheusRemoteStorageHistogramsInTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusRemoteStorageSamplesInTotal records the samples in to remote storage, compare to determine dropped samples. +type PrometheusRemoteStorageSamplesInTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusRemoteStorageSamplesInTotal returns a new PrometheusRemoteStorageSamplesInTotal instrument. +func NewPrometheusRemoteStorageSamplesInTotal() PrometheusRemoteStorageSamplesInTotal { + labels := []string{} + return PrometheusRemoteStorageSamplesInTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_remote_storage_samples_in_total", + Help: "Samples in to remote storage, compare to determine dropped samples.", + }, labels), + } +} + +type PrometheusRemoteStorageSamplesInTotalAttr interface { + Attribute + implPrometheusRemoteStorageSamplesInTotal() +} + +func (m PrometheusRemoteStorageSamplesInTotal) With( + extra ...PrometheusRemoteStorageSamplesInTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusRemoteStorageStringInternerZeroReferenceReleasesTotal records the number of times release has been called for strings that are not interned. +type PrometheusRemoteStorageStringInternerZeroReferenceReleasesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusRemoteStorageStringInternerZeroReferenceReleasesTotal returns a new PrometheusRemoteStorageStringInternerZeroReferenceReleasesTotal instrument. +func NewPrometheusRemoteStorageStringInternerZeroReferenceReleasesTotal() PrometheusRemoteStorageStringInternerZeroReferenceReleasesTotal { + labels := []string{} + return PrometheusRemoteStorageStringInternerZeroReferenceReleasesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_remote_storage_string_interner_zero_reference_releases_total", + Help: "The number of times release has been called for strings that are not interned.", + }, labels), + } +} + +type PrometheusRemoteStorageStringInternerZeroReferenceReleasesTotalAttr interface { + Attribute + implPrometheusRemoteStorageStringInternerZeroReferenceReleasesTotal() +} + +func (m PrometheusRemoteStorageStringInternerZeroReferenceReleasesTotal) With( + extra ...PrometheusRemoteStorageStringInternerZeroReferenceReleasesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} diff --git a/template/semconv/README.md b/template/semconv/README.md new file mode 100644 index 0000000000..bc37315f74 --- /dev/null +++ b/template/semconv/README.md @@ -0,0 +1,31 @@ + + +# Metrics + +This document describes the metrics defined in this semantic convention registry. + +| Metric | Type | Unit | Description | +|--------|------|------|-------------| +| `prometheus_template_text_expansion_failures_total` | counter | {failure} | The total number of template text expansion failures. | +| `prometheus_template_text_expansions_total` | counter | {expansion} | The total number of template text expansions. | + + +## Metric Details + + +### `prometheus_template_text_expansion_failures_total` + +The total number of template text expansion failures. + +- **Type:** counter +- **Unit:** {failure} +- **Stability:** development + + +### `prometheus_template_text_expansions_total` + +The total number of template text expansions. + +- **Type:** counter +- **Unit:** {expansion} +- **Stability:** development diff --git a/template/semconv/metrics.go b/template/semconv/metrics.go new file mode 100644 index 0000000000..71e35ebfb2 --- /dev/null +++ b/template/semconv/metrics.go @@ -0,0 +1,77 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package metrics provides Prometheus instrumentation types for metrics +// defined in this semantic convention registry. +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// Attribute is an interface for metric label attributes. +type Attribute interface { + ID() string + Value() string +} + +// PrometheusTemplateTextExpansionFailuresTotal records the total number of template text expansion failures. +type PrometheusTemplateTextExpansionFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTemplateTextExpansionFailuresTotal returns a new PrometheusTemplateTextExpansionFailuresTotal instrument. +func NewPrometheusTemplateTextExpansionFailuresTotal() PrometheusTemplateTextExpansionFailuresTotal { + labels := []string{} + return PrometheusTemplateTextExpansionFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_template_text_expansion_failures_total", + Help: "The total number of template text expansion failures.", + }, labels), + } +} + +type PrometheusTemplateTextExpansionFailuresTotalAttr interface { + Attribute + implPrometheusTemplateTextExpansionFailuresTotal() +} + +func (m PrometheusTemplateTextExpansionFailuresTotal) With( + extra ...PrometheusTemplateTextExpansionFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTemplateTextExpansionsTotal records the total number of template text expansions. +type PrometheusTemplateTextExpansionsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTemplateTextExpansionsTotal returns a new PrometheusTemplateTextExpansionsTotal instrument. +func NewPrometheusTemplateTextExpansionsTotal() PrometheusTemplateTextExpansionsTotal { + labels := []string{} + return PrometheusTemplateTextExpansionsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_template_text_expansions_total", + Help: "The total number of template text expansions.", + }, labels), + } +} + +type PrometheusTemplateTextExpansionsTotalAttr interface { + Attribute + implPrometheusTemplateTextExpansionsTotal() +} + +func (m PrometheusTemplateTextExpansionsTotal) With( + extra ...PrometheusTemplateTextExpansionsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} diff --git a/tsdb/semconv/README.md b/tsdb/semconv/README.md new file mode 100644 index 0000000000..972dac3f76 --- /dev/null +++ b/tsdb/semconv/README.md @@ -0,0 +1,903 @@ + + +# Metrics + +This document describes the metrics defined in this semantic convention registry. + +| Metric | Type | Unit | Description | +|--------|------|------|-------------| +| `prometheus_tsdb_blocks_loaded` | gauge | {block} | Number of currently loaded data blocks. | +| `prometheus_tsdb_checkpoint_creations_failed_total` | counter | {checkpoint} | Total number of checkpoint creations that failed. | +| `prometheus_tsdb_checkpoint_creations_total` | counter | {checkpoint} | Total number of checkpoint creations attempted. | +| `prometheus_tsdb_checkpoint_deletions_failed_total` | counter | {checkpoint} | Total number of checkpoint deletions that failed. | +| `prometheus_tsdb_checkpoint_deletions_total` | counter | {checkpoint} | Total number of checkpoint deletions attempted. | +| `prometheus_tsdb_clean_start` | gauge | 1 | Set to 1 if the TSDB was clean at startup, 0 otherwise. | +| `prometheus_tsdb_compaction_chunk_range_seconds` | histogram | s | Final time range of chunks on their first compaction. | +| `prometheus_tsdb_compaction_chunk_samples` | histogram | {sample} | Final number of samples on their first compaction. | +| `prometheus_tsdb_compaction_chunk_size_bytes` | histogram | By | Final size of chunks on their first compaction. | +| `prometheus_tsdb_compaction_duration_seconds` | histogram | s | Duration of compaction runs. | +| `prometheus_tsdb_compaction_populating_block` | gauge | 1 | Set to 1 when a block is being written to the disk. | +| `prometheus_tsdb_compactions_failed_total` | counter | {compaction} | Total number of compactions that failed. | +| `prometheus_tsdb_compactions_skipped_total` | counter | {compaction} | Total number of skipped compactions due to overlap. | +| `prometheus_tsdb_compactions_total` | counter | {compaction} | Total number of compactions that were executed. | +| `prometheus_tsdb_compactions_triggered_total` | counter | {compaction} | Total number of triggered compactions. | +| `prometheus_tsdb_data_replay_duration_seconds` | gauge | s | Time taken to replay the data on disk. | +| `prometheus_tsdb_exemplar_exemplars_appended_total` | counter | {exemplar} | Total number of appended exemplars. | +| `prometheus_tsdb_exemplar_exemplars_in_storage` | gauge | {exemplar} | Number of exemplars currently in circular storage. | +| `prometheus_tsdb_exemplar_last_exemplars_timestamp_seconds` | gauge | s | The timestamp of the oldest exemplar stored in circular storage. | +| `prometheus_tsdb_exemplar_max_exemplars` | gauge | {exemplar} | Total number of exemplars the exemplar storage can store. | +| `prometheus_tsdb_exemplar_out_of_order_exemplars_total` | counter | {exemplar} | Total number of out-of-order exemplar ingestion failed attempts. | +| `prometheus_tsdb_exemplar_series_with_exemplars_in_storage` | gauge | {series} | Number of series with exemplars currently in circular storage. | +| `prometheus_tsdb_head_active_appenders` | gauge | {appender} | Number of currently active appender transactions. | +| `prometheus_tsdb_head_chunks` | gauge | {chunk} | Total number of chunks in the head block. | +| `prometheus_tsdb_head_chunks_created_total` | counter | {chunk} | Total number of chunks created in the head block. | +| `prometheus_tsdb_head_chunks_removed_total` | counter | {chunk} | Total number of chunks removed from the head block. | +| `prometheus_tsdb_head_chunks_storage_size_bytes` | gauge | By | Size of the chunks_head directory. | +| `prometheus_tsdb_head_gc_duration_seconds` | histogram | s | Runtime of garbage collection in the head block. | +| `prometheus_tsdb_head_max_time` | gauge | 1 | Maximum timestamp of the head block. | +| `prometheus_tsdb_head_max_time_seconds` | gauge | s | Maximum timestamp of the head block in seconds. | +| `prometheus_tsdb_head_min_time` | gauge | 1 | Minimum timestamp of the head block. | +| `prometheus_tsdb_head_min_time_seconds` | gauge | s | Minimum timestamp of the head block in seconds. | +| `prometheus_tsdb_head_out_of_order_samples_appended_total` | counter | {sample} | Total number of appended out-of-order samples. | +| `prometheus_tsdb_head_samples_appended_total` | counter | {sample} | Total number of appended samples. | +| `prometheus_tsdb_head_series` | gauge | {series} | Total number of series in the head block. | +| `prometheus_tsdb_head_series_created_total` | counter | {series} | Total number of series created in the head block. | +| `prometheus_tsdb_head_series_not_found_total` | counter | {request} | Total number of requests for series that were not found. | +| `prometheus_tsdb_head_series_removed_total` | counter | {series} | Total number of series removed from the head block. | +| `prometheus_tsdb_head_stale_series` | gauge | {series} | Number of stale series in the head block. | +| `prometheus_tsdb_head_truncations_failed_total` | counter | {truncation} | Total number of head truncations that failed. | +| `prometheus_tsdb_head_truncations_total` | counter | {truncation} | Total number of head truncations attempted. | +| `prometheus_tsdb_isolation_high_watermark` | gauge | 1 | The isolation high watermark. | +| `prometheus_tsdb_isolation_low_watermark` | gauge | 1 | The isolation low watermark. | +| `prometheus_tsdb_lowest_timestamp` | gauge | 1 | Lowest timestamp value stored in the database. | +| `prometheus_tsdb_lowest_timestamp_seconds` | gauge | s | Lowest timestamp value stored in the database in seconds. | +| `prometheus_tsdb_mmap_chunk_corruptions_total` | counter | {corruption} | Total number of memory-mapped chunk corruptions. | +| `prometheus_tsdb_mmap_chunks_total` | counter | {chunk} | Total number of memory-mapped chunks. | +| `prometheus_tsdb_out_of_bound_samples_total` | counter | {sample} | Total number of out-of-bound samples ingestion failed attempts. | +| `prometheus_tsdb_out_of_order_samples_total` | counter | {sample} | Total number of out-of-order samples ingestion failed attempts. | +| `prometheus_tsdb_out_of_order_wbl_completed_pages_total` | counter | {page} | Total number of completed WBL pages for out-of-order samples. | +| `prometheus_tsdb_out_of_order_wbl_fsync_duration_seconds` | histogram | s | Duration of WBL fsync for out-of-order samples. | +| `prometheus_tsdb_out_of_order_wbl_page_flushes_total` | counter | {flush} | Total number of WBL page flushes for out-of-order samples. | +| `prometheus_tsdb_out_of_order_wbl_record_part_writes_total` | counter | {write} | Total number of WBL record part writes for out-of-order samples. | +| `prometheus_tsdb_out_of_order_wbl_record_parts_bytes_written_total` | counter | By | Total bytes written to WBL record parts for out-of-order samples. | +| `prometheus_tsdb_out_of_order_wbl_segment_current` | gauge | {segment} | Current out-of-order WBL segment. | +| `prometheus_tsdb_out_of_order_wbl_storage_size_bytes` | gauge | By | Size of the out-of-order WBL storage. | +| `prometheus_tsdb_out_of_order_wbl_truncations_failed_total` | counter | {truncation} | Total number of out-of-order WBL truncations that failed. | +| `prometheus_tsdb_out_of_order_wbl_truncations_total` | counter | {truncation} | Total number of out-of-order WBL truncations. | +| `prometheus_tsdb_out_of_order_wbl_writes_failed_total` | counter | {write} | Total number of out-of-order WBL writes that failed. | +| `prometheus_tsdb_reloads_failures_total` | counter | {reload} | Number of times the database reloads failed. | +| `prometheus_tsdb_reloads_total` | counter | {reload} | Number of times the database reloads. | +| `prometheus_tsdb_retention_limit_bytes` | gauge | By | Maximum number of bytes to be retained in the TSDB. | +| `prometheus_tsdb_retention_limit_seconds` | gauge | s | Maximum age in seconds for samples to be retained in the TSDB. | +| `prometheus_tsdb_sample_ooo_delta` | histogram | s | Delta in seconds between the time when an out-of-order sample was ingested and the latest sample in the chunk. | +| `prometheus_tsdb_size_retentions_total` | counter | {retention} | Number of times that blocks were deleted because the maximum number of bytes was exceeded. | +| `prometheus_tsdb_snapshot_replay_error_total` | counter | {error} | Total number of snapshot replay errors. | +| `prometheus_tsdb_storage_blocks_bytes` | gauge | By | The number of bytes that are currently used for local storage by all blocks. | +| `prometheus_tsdb_symbol_table_size_bytes` | gauge | By | Size of the symbol table in bytes. | +| `prometheus_tsdb_time_retentions_total` | counter | {retention} | Number of times that blocks were deleted because the maximum time limit was exceeded. | +| `prometheus_tsdb_tombstone_cleanup_seconds` | histogram | s | Time taken to clean up tombstones. | +| `prometheus_tsdb_too_old_samples_total` | counter | {sample} | Total number of samples that were too old to be ingested. | +| `prometheus_tsdb_vertical_compactions_total` | counter | {compaction} | Total number of compactions done on overlapping blocks. | +| `prometheus_tsdb_wal_completed_pages_total` | counter | {page} | Total number of completed WAL pages. | +| `prometheus_tsdb_wal_corruptions_total` | counter | {corruption} | Total number of WAL corruptions. | +| `prometheus_tsdb_wal_fsync_duration_seconds` | histogram | s | Duration of WAL fsync. | +| `prometheus_tsdb_wal_page_flushes_total` | counter | {flush} | Total number of WAL page flushes. | +| `prometheus_tsdb_wal_record_bytes_saved_total` | counter | By | Total bytes saved by WAL record compression. | +| `prometheus_tsdb_wal_record_part_writes_total` | counter | {write} | Total number of WAL record part writes. | +| `prometheus_tsdb_wal_record_parts_bytes_written_total` | counter | By | Total bytes written to WAL record parts. | +| `prometheus_tsdb_wal_segment_current` | gauge | {segment} | Current WAL segment. | +| `prometheus_tsdb_wal_storage_size_bytes` | gauge | By | Size of the WAL storage. | +| `prometheus_tsdb_wal_truncate_duration_seconds` | histogram | s | Duration of WAL truncation. | +| `prometheus_tsdb_wal_truncations_failed_total` | counter | {truncation} | Total number of WAL truncations that failed. | +| `prometheus_tsdb_wal_truncations_total` | counter | {truncation} | Total number of WAL truncations. | +| `prometheus_tsdb_wal_writes_failed_total` | counter | {write} | Total number of WAL writes that failed. | + + +## Metric Details + + +### `prometheus_tsdb_blocks_loaded` + +Number of currently loaded data blocks. + +- **Type:** gauge +- **Unit:** {block} +- **Stability:** development + + +### `prometheus_tsdb_checkpoint_creations_failed_total` + +Total number of checkpoint creations that failed. + +- **Type:** counter +- **Unit:** {checkpoint} +- **Stability:** development + + +### `prometheus_tsdb_checkpoint_creations_total` + +Total number of checkpoint creations attempted. + +- **Type:** counter +- **Unit:** {checkpoint} +- **Stability:** development + + +### `prometheus_tsdb_checkpoint_deletions_failed_total` + +Total number of checkpoint deletions that failed. + +- **Type:** counter +- **Unit:** {checkpoint} +- **Stability:** development + + +### `prometheus_tsdb_checkpoint_deletions_total` + +Total number of checkpoint deletions attempted. + +- **Type:** counter +- **Unit:** {checkpoint} +- **Stability:** development + + +### `prometheus_tsdb_clean_start` + +Set to 1 if the TSDB was clean at startup, 0 otherwise. + +- **Type:** gauge +- **Unit:** 1 +- **Stability:** development + + +### `prometheus_tsdb_compaction_chunk_range_seconds` + +Final time range of chunks on their first compaction. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_compaction_chunk_samples` + +Final number of samples on their first compaction. + +- **Type:** histogram +- **Unit:** {sample} +- **Stability:** development + + +### `prometheus_tsdb_compaction_chunk_size_bytes` + +Final size of chunks on their first compaction. + +- **Type:** histogram +- **Unit:** By +- **Stability:** development + + +### `prometheus_tsdb_compaction_duration_seconds` + +Duration of compaction runs. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_compaction_populating_block` + +Set to 1 when a block is being written to the disk. + +- **Type:** gauge +- **Unit:** 1 +- **Stability:** development + + +### `prometheus_tsdb_compactions_failed_total` + +Total number of compactions that failed. + +- **Type:** counter +- **Unit:** {compaction} +- **Stability:** development + + +### `prometheus_tsdb_compactions_skipped_total` + +Total number of skipped compactions due to overlap. + +- **Type:** counter +- **Unit:** {compaction} +- **Stability:** development + + +### `prometheus_tsdb_compactions_total` + +Total number of compactions that were executed. + +- **Type:** counter +- **Unit:** {compaction} +- **Stability:** development + + +### `prometheus_tsdb_compactions_triggered_total` + +Total number of triggered compactions. + +- **Type:** counter +- **Unit:** {compaction} +- **Stability:** development + + +### `prometheus_tsdb_data_replay_duration_seconds` + +Time taken to replay the data on disk. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_exemplar_exemplars_appended_total` + +Total number of appended exemplars. + +- **Type:** counter +- **Unit:** {exemplar} +- **Stability:** development + + +### `prometheus_tsdb_exemplar_exemplars_in_storage` + +Number of exemplars currently in circular storage. + +- **Type:** gauge +- **Unit:** {exemplar} +- **Stability:** development + + +### `prometheus_tsdb_exemplar_last_exemplars_timestamp_seconds` + +The timestamp of the oldest exemplar stored in circular storage. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_exemplar_max_exemplars` + +Total number of exemplars the exemplar storage can store. + +- **Type:** gauge +- **Unit:** {exemplar} +- **Stability:** development + + +### `prometheus_tsdb_exemplar_out_of_order_exemplars_total` + +Total number of out-of-order exemplar ingestion failed attempts. + +- **Type:** counter +- **Unit:** {exemplar} +- **Stability:** development + + +### `prometheus_tsdb_exemplar_series_with_exemplars_in_storage` + +Number of series with exemplars currently in circular storage. + +- **Type:** gauge +- **Unit:** {series} +- **Stability:** development + + +### `prometheus_tsdb_head_active_appenders` + +Number of currently active appender transactions. + +- **Type:** gauge +- **Unit:** {appender} +- **Stability:** development + + +### `prometheus_tsdb_head_chunks` + +Total number of chunks in the head block. + +- **Type:** gauge +- **Unit:** {chunk} +- **Stability:** development + + +### `prometheus_tsdb_head_chunks_created_total` + +Total number of chunks created in the head block. + +- **Type:** counter +- **Unit:** {chunk} +- **Stability:** development + + +### `prometheus_tsdb_head_chunks_removed_total` + +Total number of chunks removed from the head block. + +- **Type:** counter +- **Unit:** {chunk} +- **Stability:** development + + +### `prometheus_tsdb_head_chunks_storage_size_bytes` + +Size of the chunks_head directory. + +- **Type:** gauge +- **Unit:** By +- **Stability:** development + + +### `prometheus_tsdb_head_gc_duration_seconds` + +Runtime of garbage collection in the head block. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_head_max_time` + +Maximum timestamp of the head block. + +- **Type:** gauge +- **Unit:** 1 +- **Stability:** development + + +### `prometheus_tsdb_head_max_time_seconds` + +Maximum timestamp of the head block in seconds. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_head_min_time` + +Minimum timestamp of the head block. + +- **Type:** gauge +- **Unit:** 1 +- **Stability:** development + + +### `prometheus_tsdb_head_min_time_seconds` + +Minimum timestamp of the head block in seconds. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_head_out_of_order_samples_appended_total` + +Total number of appended out-of-order samples. + +- **Type:** counter +- **Unit:** {sample} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `type` | string | The sample type. | float, histogram | + + + +### `prometheus_tsdb_head_samples_appended_total` + +Total number of appended samples. + +- **Type:** counter +- **Unit:** {sample} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `type` | string | The sample type. | float, histogram | + + + +### `prometheus_tsdb_head_series` + +Total number of series in the head block. + +- **Type:** gauge +- **Unit:** {series} +- **Stability:** development + + +### `prometheus_tsdb_head_series_created_total` + +Total number of series created in the head block. + +- **Type:** counter +- **Unit:** {series} +- **Stability:** development + + +### `prometheus_tsdb_head_series_not_found_total` + +Total number of requests for series that were not found. + +- **Type:** counter +- **Unit:** {request} +- **Stability:** development + + +### `prometheus_tsdb_head_series_removed_total` + +Total number of series removed from the head block. + +- **Type:** counter +- **Unit:** {series} +- **Stability:** development + + +### `prometheus_tsdb_head_stale_series` + +Number of stale series in the head block. + +- **Type:** gauge +- **Unit:** {series} +- **Stability:** development + + +### `prometheus_tsdb_head_truncations_failed_total` + +Total number of head truncations that failed. + +- **Type:** counter +- **Unit:** {truncation} +- **Stability:** development + + +### `prometheus_tsdb_head_truncations_total` + +Total number of head truncations attempted. + +- **Type:** counter +- **Unit:** {truncation} +- **Stability:** development + + +### `prometheus_tsdb_isolation_high_watermark` + +The isolation high watermark. + +- **Type:** gauge +- **Unit:** 1 +- **Stability:** development + + +### `prometheus_tsdb_isolation_low_watermark` + +The isolation low watermark. + +- **Type:** gauge +- **Unit:** 1 +- **Stability:** development + + +### `prometheus_tsdb_lowest_timestamp` + +Lowest timestamp value stored in the database. + +- **Type:** gauge +- **Unit:** 1 +- **Stability:** development + + +### `prometheus_tsdb_lowest_timestamp_seconds` + +Lowest timestamp value stored in the database in seconds. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_mmap_chunk_corruptions_total` + +Total number of memory-mapped chunk corruptions. + +- **Type:** counter +- **Unit:** {corruption} +- **Stability:** development + + +### `prometheus_tsdb_mmap_chunks_total` + +Total number of memory-mapped chunks. + +- **Type:** counter +- **Unit:** {chunk} +- **Stability:** development + + +### `prometheus_tsdb_out_of_bound_samples_total` + +Total number of out-of-bound samples ingestion failed attempts. + +- **Type:** counter +- **Unit:** {sample} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `type` | string | The sample type. | float | + + + +### `prometheus_tsdb_out_of_order_samples_total` + +Total number of out-of-order samples ingestion failed attempts. + +- **Type:** counter +- **Unit:** {sample} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `type` | string | The sample type. | float, histogram | + + + +### `prometheus_tsdb_out_of_order_wbl_completed_pages_total` + +Total number of completed WBL pages for out-of-order samples. + +- **Type:** counter +- **Unit:** {page} +- **Stability:** development + + +### `prometheus_tsdb_out_of_order_wbl_fsync_duration_seconds` + +Duration of WBL fsync for out-of-order samples. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_out_of_order_wbl_page_flushes_total` + +Total number of WBL page flushes for out-of-order samples. + +- **Type:** counter +- **Unit:** {flush} +- **Stability:** development + + +### `prometheus_tsdb_out_of_order_wbl_record_part_writes_total` + +Total number of WBL record part writes for out-of-order samples. + +- **Type:** counter +- **Unit:** {write} +- **Stability:** development + + +### `prometheus_tsdb_out_of_order_wbl_record_parts_bytes_written_total` + +Total bytes written to WBL record parts for out-of-order samples. + +- **Type:** counter +- **Unit:** By +- **Stability:** development + + +### `prometheus_tsdb_out_of_order_wbl_segment_current` + +Current out-of-order WBL segment. + +- **Type:** gauge +- **Unit:** {segment} +- **Stability:** development + + +### `prometheus_tsdb_out_of_order_wbl_storage_size_bytes` + +Size of the out-of-order WBL storage. + +- **Type:** gauge +- **Unit:** By +- **Stability:** development + + +### `prometheus_tsdb_out_of_order_wbl_truncations_failed_total` + +Total number of out-of-order WBL truncations that failed. + +- **Type:** counter +- **Unit:** {truncation} +- **Stability:** development + + +### `prometheus_tsdb_out_of_order_wbl_truncations_total` + +Total number of out-of-order WBL truncations. + +- **Type:** counter +- **Unit:** {truncation} +- **Stability:** development + + +### `prometheus_tsdb_out_of_order_wbl_writes_failed_total` + +Total number of out-of-order WBL writes that failed. + +- **Type:** counter +- **Unit:** {write} +- **Stability:** development + + +### `prometheus_tsdb_reloads_failures_total` + +Number of times the database reloads failed. + +- **Type:** counter +- **Unit:** {reload} +- **Stability:** development + + +### `prometheus_tsdb_reloads_total` + +Number of times the database reloads. + +- **Type:** counter +- **Unit:** {reload} +- **Stability:** development + + +### `prometheus_tsdb_retention_limit_bytes` + +Maximum number of bytes to be retained in the TSDB. + +- **Type:** gauge +- **Unit:** By +- **Stability:** development + + +### `prometheus_tsdb_retention_limit_seconds` + +Maximum age in seconds for samples to be retained in the TSDB. + +- **Type:** gauge +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_sample_ooo_delta` + +Delta in seconds between the time when an out-of-order sample was ingested and the latest sample in the chunk. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_size_retentions_total` + +Number of times that blocks were deleted because the maximum number of bytes was exceeded. + +- **Type:** counter +- **Unit:** {retention} +- **Stability:** development + + +### `prometheus_tsdb_snapshot_replay_error_total` + +Total number of snapshot replay errors. + +- **Type:** counter +- **Unit:** {error} +- **Stability:** development + + +### `prometheus_tsdb_storage_blocks_bytes` + +The number of bytes that are currently used for local storage by all blocks. + +- **Type:** gauge +- **Unit:** By +- **Stability:** development + + +### `prometheus_tsdb_symbol_table_size_bytes` + +Size of the symbol table in bytes. + +- **Type:** gauge +- **Unit:** By +- **Stability:** development + + +### `prometheus_tsdb_time_retentions_total` + +Number of times that blocks were deleted because the maximum time limit was exceeded. + +- **Type:** counter +- **Unit:** {retention} +- **Stability:** development + + +### `prometheus_tsdb_tombstone_cleanup_seconds` + +Time taken to clean up tombstones. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_too_old_samples_total` + +Total number of samples that were too old to be ingested. + +- **Type:** counter +- **Unit:** {sample} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `type` | string | The sample type. | float | + + + +### `prometheus_tsdb_vertical_compactions_total` + +Total number of compactions done on overlapping blocks. + +- **Type:** counter +- **Unit:** {compaction} +- **Stability:** development + + +### `prometheus_tsdb_wal_completed_pages_total` + +Total number of completed WAL pages. + +- **Type:** counter +- **Unit:** {page} +- **Stability:** development + + +### `prometheus_tsdb_wal_corruptions_total` + +Total number of WAL corruptions. + +- **Type:** counter +- **Unit:** {corruption} +- **Stability:** development + + +### `prometheus_tsdb_wal_fsync_duration_seconds` + +Duration of WAL fsync. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_wal_page_flushes_total` + +Total number of WAL page flushes. + +- **Type:** counter +- **Unit:** {flush} +- **Stability:** development + + +### `prometheus_tsdb_wal_record_bytes_saved_total` + +Total bytes saved by WAL record compression. + +- **Type:** counter +- **Unit:** By +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `compression` | string | The compression algorithm. | snappy | + + + +### `prometheus_tsdb_wal_record_part_writes_total` + +Total number of WAL record part writes. + +- **Type:** counter +- **Unit:** {write} +- **Stability:** development + + +### `prometheus_tsdb_wal_record_parts_bytes_written_total` + +Total bytes written to WAL record parts. + +- **Type:** counter +- **Unit:** By +- **Stability:** development + + +### `prometheus_tsdb_wal_segment_current` + +Current WAL segment. + +- **Type:** gauge +- **Unit:** {segment} +- **Stability:** development + + +### `prometheus_tsdb_wal_storage_size_bytes` + +Size of the WAL storage. + +- **Type:** gauge +- **Unit:** By +- **Stability:** development + + +### `prometheus_tsdb_wal_truncate_duration_seconds` + +Duration of WAL truncation. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + + +### `prometheus_tsdb_wal_truncations_failed_total` + +Total number of WAL truncations that failed. + +- **Type:** counter +- **Unit:** {truncation} +- **Stability:** development + + +### `prometheus_tsdb_wal_truncations_total` + +Total number of WAL truncations. + +- **Type:** counter +- **Unit:** {truncation} +- **Stability:** development + + +### `prometheus_tsdb_wal_writes_failed_total` + +Total number of WAL writes that failed. + +- **Type:** counter +- **Unit:** {write} +- **Stability:** development diff --git a/tsdb/semconv/metrics.go b/tsdb/semconv/metrics.go new file mode 100644 index 0000000000..3d98a01081 --- /dev/null +++ b/tsdb/semconv/metrics.go @@ -0,0 +1,2705 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package metrics provides Prometheus instrumentation types for metrics +// defined in this semantic convention registry. +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// Attribute is an interface for metric label attributes. +type Attribute interface { + ID() string + Value() string +} +type CompressionAttr string + +func (a CompressionAttr) ID() string { + return "compression" +} + +func (a CompressionAttr) Value() string { + return string(a) +} + +type TypeAttr string + +func (a TypeAttr) ID() string { + return "type" +} + +func (a TypeAttr) Value() string { + return string(a) +} + +// PrometheusTSDBBlocksLoaded records the number of currently loaded data blocks. +type PrometheusTSDBBlocksLoaded struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBBlocksLoaded returns a new PrometheusTSDBBlocksLoaded instrument. +func NewPrometheusTSDBBlocksLoaded() PrometheusTSDBBlocksLoaded { + labels := []string{} + return PrometheusTSDBBlocksLoaded{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_blocks_loaded", + Help: "Number of currently loaded data blocks.", + }, labels), + } +} + +type PrometheusTSDBBlocksLoadedAttr interface { + Attribute + implPrometheusTSDBBlocksLoaded() +} + +func (m PrometheusTSDBBlocksLoaded) With( + extra ...PrometheusTSDBBlocksLoadedAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBCheckpointCreationsFailedTotal records the total number of checkpoint creations that failed. +type PrometheusTSDBCheckpointCreationsFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBCheckpointCreationsFailedTotal returns a new PrometheusTSDBCheckpointCreationsFailedTotal instrument. +func NewPrometheusTSDBCheckpointCreationsFailedTotal() PrometheusTSDBCheckpointCreationsFailedTotal { + labels := []string{} + return PrometheusTSDBCheckpointCreationsFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_checkpoint_creations_failed_total", + Help: "Total number of checkpoint creations that failed.", + }, labels), + } +} + +type PrometheusTSDBCheckpointCreationsFailedTotalAttr interface { + Attribute + implPrometheusTSDBCheckpointCreationsFailedTotal() +} + +func (m PrometheusTSDBCheckpointCreationsFailedTotal) With( + extra ...PrometheusTSDBCheckpointCreationsFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBCheckpointCreationsTotal records the total number of checkpoint creations attempted. +type PrometheusTSDBCheckpointCreationsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBCheckpointCreationsTotal returns a new PrometheusTSDBCheckpointCreationsTotal instrument. +func NewPrometheusTSDBCheckpointCreationsTotal() PrometheusTSDBCheckpointCreationsTotal { + labels := []string{} + return PrometheusTSDBCheckpointCreationsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_checkpoint_creations_total", + Help: "Total number of checkpoint creations attempted.", + }, labels), + } +} + +type PrometheusTSDBCheckpointCreationsTotalAttr interface { + Attribute + implPrometheusTSDBCheckpointCreationsTotal() +} + +func (m PrometheusTSDBCheckpointCreationsTotal) With( + extra ...PrometheusTSDBCheckpointCreationsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBCheckpointDeletionsFailedTotal records the total number of checkpoint deletions that failed. +type PrometheusTSDBCheckpointDeletionsFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBCheckpointDeletionsFailedTotal returns a new PrometheusTSDBCheckpointDeletionsFailedTotal instrument. +func NewPrometheusTSDBCheckpointDeletionsFailedTotal() PrometheusTSDBCheckpointDeletionsFailedTotal { + labels := []string{} + return PrometheusTSDBCheckpointDeletionsFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_checkpoint_deletions_failed_total", + Help: "Total number of checkpoint deletions that failed.", + }, labels), + } +} + +type PrometheusTSDBCheckpointDeletionsFailedTotalAttr interface { + Attribute + implPrometheusTSDBCheckpointDeletionsFailedTotal() +} + +func (m PrometheusTSDBCheckpointDeletionsFailedTotal) With( + extra ...PrometheusTSDBCheckpointDeletionsFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBCheckpointDeletionsTotal records the total number of checkpoint deletions attempted. +type PrometheusTSDBCheckpointDeletionsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBCheckpointDeletionsTotal returns a new PrometheusTSDBCheckpointDeletionsTotal instrument. +func NewPrometheusTSDBCheckpointDeletionsTotal() PrometheusTSDBCheckpointDeletionsTotal { + labels := []string{} + return PrometheusTSDBCheckpointDeletionsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_checkpoint_deletions_total", + Help: "Total number of checkpoint deletions attempted.", + }, labels), + } +} + +type PrometheusTSDBCheckpointDeletionsTotalAttr interface { + Attribute + implPrometheusTSDBCheckpointDeletionsTotal() +} + +func (m PrometheusTSDBCheckpointDeletionsTotal) With( + extra ...PrometheusTSDBCheckpointDeletionsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBCleanStart records the set to 1 if the TSDB was clean at startup, 0 otherwise. +type PrometheusTSDBCleanStart struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBCleanStart returns a new PrometheusTSDBCleanStart instrument. +func NewPrometheusTSDBCleanStart() PrometheusTSDBCleanStart { + labels := []string{} + return PrometheusTSDBCleanStart{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_clean_start", + Help: "Set to 1 if the TSDB was clean at startup, 0 otherwise.", + }, labels), + } +} + +type PrometheusTSDBCleanStartAttr interface { + Attribute + implPrometheusTSDBCleanStart() +} + +func (m PrometheusTSDBCleanStart) With( + extra ...PrometheusTSDBCleanStartAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBCompactionChunkRangeSeconds records the final time range of chunks on their first compaction. +type PrometheusTSDBCompactionChunkRangeSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTSDBCompactionChunkRangeSeconds returns a new PrometheusTSDBCompactionChunkRangeSeconds instrument. +func NewPrometheusTSDBCompactionChunkRangeSeconds() PrometheusTSDBCompactionChunkRangeSeconds { + labels := []string{} + return PrometheusTSDBCompactionChunkRangeSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_tsdb_compaction_chunk_range_seconds", + Help: "Final time range of chunks on their first compaction.", + }, labels), + } +} + +type PrometheusTSDBCompactionChunkRangeSecondsAttr interface { + Attribute + implPrometheusTSDBCompactionChunkRangeSeconds() +} + +func (m PrometheusTSDBCompactionChunkRangeSeconds) With( + extra ...PrometheusTSDBCompactionChunkRangeSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTSDBCompactionChunkSamples records the final number of samples on their first compaction. +type PrometheusTSDBCompactionChunkSamples struct { + *prometheus.HistogramVec +} + +// NewPrometheusTSDBCompactionChunkSamples returns a new PrometheusTSDBCompactionChunkSamples instrument. +func NewPrometheusTSDBCompactionChunkSamples() PrometheusTSDBCompactionChunkSamples { + labels := []string{} + return PrometheusTSDBCompactionChunkSamples{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_tsdb_compaction_chunk_samples", + Help: "Final number of samples on their first compaction.", + }, labels), + } +} + +type PrometheusTSDBCompactionChunkSamplesAttr interface { + Attribute + implPrometheusTSDBCompactionChunkSamples() +} + +func (m PrometheusTSDBCompactionChunkSamples) With( + extra ...PrometheusTSDBCompactionChunkSamplesAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTSDBCompactionChunkSizeBytes records the final size of chunks on their first compaction. +type PrometheusTSDBCompactionChunkSizeBytes struct { + *prometheus.HistogramVec +} + +// NewPrometheusTSDBCompactionChunkSizeBytes returns a new PrometheusTSDBCompactionChunkSizeBytes instrument. +func NewPrometheusTSDBCompactionChunkSizeBytes() PrometheusTSDBCompactionChunkSizeBytes { + labels := []string{} + return PrometheusTSDBCompactionChunkSizeBytes{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_tsdb_compaction_chunk_size_bytes", + Help: "Final size of chunks on their first compaction.", + }, labels), + } +} + +type PrometheusTSDBCompactionChunkSizeBytesAttr interface { + Attribute + implPrometheusTSDBCompactionChunkSizeBytes() +} + +func (m PrometheusTSDBCompactionChunkSizeBytes) With( + extra ...PrometheusTSDBCompactionChunkSizeBytesAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTSDBCompactionDurationSeconds records the duration of compaction runs. +type PrometheusTSDBCompactionDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTSDBCompactionDurationSeconds returns a new PrometheusTSDBCompactionDurationSeconds instrument. +func NewPrometheusTSDBCompactionDurationSeconds() PrometheusTSDBCompactionDurationSeconds { + labels := []string{} + return PrometheusTSDBCompactionDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_tsdb_compaction_duration_seconds", + Help: "Duration of compaction runs.", + }, labels), + } +} + +type PrometheusTSDBCompactionDurationSecondsAttr interface { + Attribute + implPrometheusTSDBCompactionDurationSeconds() +} + +func (m PrometheusTSDBCompactionDurationSeconds) With( + extra ...PrometheusTSDBCompactionDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTSDBCompactionPopulatingBlock records the set to 1 when a block is being written to the disk. +type PrometheusTSDBCompactionPopulatingBlock struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBCompactionPopulatingBlock returns a new PrometheusTSDBCompactionPopulatingBlock instrument. +func NewPrometheusTSDBCompactionPopulatingBlock() PrometheusTSDBCompactionPopulatingBlock { + labels := []string{} + return PrometheusTSDBCompactionPopulatingBlock{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_compaction_populating_block", + Help: "Set to 1 when a block is being written to the disk.", + }, labels), + } +} + +type PrometheusTSDBCompactionPopulatingBlockAttr interface { + Attribute + implPrometheusTSDBCompactionPopulatingBlock() +} + +func (m PrometheusTSDBCompactionPopulatingBlock) With( + extra ...PrometheusTSDBCompactionPopulatingBlockAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBCompactionsFailedTotal records the total number of compactions that failed. +type PrometheusTSDBCompactionsFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBCompactionsFailedTotal returns a new PrometheusTSDBCompactionsFailedTotal instrument. +func NewPrometheusTSDBCompactionsFailedTotal() PrometheusTSDBCompactionsFailedTotal { + labels := []string{} + return PrometheusTSDBCompactionsFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_compactions_failed_total", + Help: "Total number of compactions that failed.", + }, labels), + } +} + +type PrometheusTSDBCompactionsFailedTotalAttr interface { + Attribute + implPrometheusTSDBCompactionsFailedTotal() +} + +func (m PrometheusTSDBCompactionsFailedTotal) With( + extra ...PrometheusTSDBCompactionsFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBCompactionsSkippedTotal records the total number of skipped compactions due to overlap. +type PrometheusTSDBCompactionsSkippedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBCompactionsSkippedTotal returns a new PrometheusTSDBCompactionsSkippedTotal instrument. +func NewPrometheusTSDBCompactionsSkippedTotal() PrometheusTSDBCompactionsSkippedTotal { + labels := []string{} + return PrometheusTSDBCompactionsSkippedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_compactions_skipped_total", + Help: "Total number of skipped compactions due to overlap.", + }, labels), + } +} + +type PrometheusTSDBCompactionsSkippedTotalAttr interface { + Attribute + implPrometheusTSDBCompactionsSkippedTotal() +} + +func (m PrometheusTSDBCompactionsSkippedTotal) With( + extra ...PrometheusTSDBCompactionsSkippedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBCompactionsTotal records the total number of compactions that were executed. +type PrometheusTSDBCompactionsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBCompactionsTotal returns a new PrometheusTSDBCompactionsTotal instrument. +func NewPrometheusTSDBCompactionsTotal() PrometheusTSDBCompactionsTotal { + labels := []string{} + return PrometheusTSDBCompactionsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_compactions_total", + Help: "Total number of compactions that were executed.", + }, labels), + } +} + +type PrometheusTSDBCompactionsTotalAttr interface { + Attribute + implPrometheusTSDBCompactionsTotal() +} + +func (m PrometheusTSDBCompactionsTotal) With( + extra ...PrometheusTSDBCompactionsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBCompactionsTriggeredTotal records the total number of triggered compactions. +type PrometheusTSDBCompactionsTriggeredTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBCompactionsTriggeredTotal returns a new PrometheusTSDBCompactionsTriggeredTotal instrument. +func NewPrometheusTSDBCompactionsTriggeredTotal() PrometheusTSDBCompactionsTriggeredTotal { + labels := []string{} + return PrometheusTSDBCompactionsTriggeredTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_compactions_triggered_total", + Help: "Total number of triggered compactions.", + }, labels), + } +} + +type PrometheusTSDBCompactionsTriggeredTotalAttr interface { + Attribute + implPrometheusTSDBCompactionsTriggeredTotal() +} + +func (m PrometheusTSDBCompactionsTriggeredTotal) With( + extra ...PrometheusTSDBCompactionsTriggeredTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBDataReplayDurationSeconds records the time taken to replay the data on disk. +type PrometheusTSDBDataReplayDurationSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBDataReplayDurationSeconds returns a new PrometheusTSDBDataReplayDurationSeconds instrument. +func NewPrometheusTSDBDataReplayDurationSeconds() PrometheusTSDBDataReplayDurationSeconds { + labels := []string{} + return PrometheusTSDBDataReplayDurationSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_data_replay_duration_seconds", + Help: "Time taken to replay the data on disk.", + }, labels), + } +} + +type PrometheusTSDBDataReplayDurationSecondsAttr interface { + Attribute + implPrometheusTSDBDataReplayDurationSeconds() +} + +func (m PrometheusTSDBDataReplayDurationSeconds) With( + extra ...PrometheusTSDBDataReplayDurationSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBExemplarExemplarsAppendedTotal records the total number of appended exemplars. +type PrometheusTSDBExemplarExemplarsAppendedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBExemplarExemplarsAppendedTotal returns a new PrometheusTSDBExemplarExemplarsAppendedTotal instrument. +func NewPrometheusTSDBExemplarExemplarsAppendedTotal() PrometheusTSDBExemplarExemplarsAppendedTotal { + labels := []string{} + return PrometheusTSDBExemplarExemplarsAppendedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_exemplar_exemplars_appended_total", + Help: "Total number of appended exemplars.", + }, labels), + } +} + +type PrometheusTSDBExemplarExemplarsAppendedTotalAttr interface { + Attribute + implPrometheusTSDBExemplarExemplarsAppendedTotal() +} + +func (m PrometheusTSDBExemplarExemplarsAppendedTotal) With( + extra ...PrometheusTSDBExemplarExemplarsAppendedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBExemplarExemplarsInStorage records the number of exemplars currently in circular storage. +type PrometheusTSDBExemplarExemplarsInStorage struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBExemplarExemplarsInStorage returns a new PrometheusTSDBExemplarExemplarsInStorage instrument. +func NewPrometheusTSDBExemplarExemplarsInStorage() PrometheusTSDBExemplarExemplarsInStorage { + labels := []string{} + return PrometheusTSDBExemplarExemplarsInStorage{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_exemplar_exemplars_in_storage", + Help: "Number of exemplars currently in circular storage.", + }, labels), + } +} + +type PrometheusTSDBExemplarExemplarsInStorageAttr interface { + Attribute + implPrometheusTSDBExemplarExemplarsInStorage() +} + +func (m PrometheusTSDBExemplarExemplarsInStorage) With( + extra ...PrometheusTSDBExemplarExemplarsInStorageAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBExemplarLastExemplarsTimestampSeconds records the timestamp of the oldest exemplar stored in circular storage. +type PrometheusTSDBExemplarLastExemplarsTimestampSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBExemplarLastExemplarsTimestampSeconds returns a new PrometheusTSDBExemplarLastExemplarsTimestampSeconds instrument. +func NewPrometheusTSDBExemplarLastExemplarsTimestampSeconds() PrometheusTSDBExemplarLastExemplarsTimestampSeconds { + labels := []string{} + return PrometheusTSDBExemplarLastExemplarsTimestampSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_exemplar_last_exemplars_timestamp_seconds", + Help: "The timestamp of the oldest exemplar stored in circular storage.", + }, labels), + } +} + +type PrometheusTSDBExemplarLastExemplarsTimestampSecondsAttr interface { + Attribute + implPrometheusTSDBExemplarLastExemplarsTimestampSeconds() +} + +func (m PrometheusTSDBExemplarLastExemplarsTimestampSeconds) With( + extra ...PrometheusTSDBExemplarLastExemplarsTimestampSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBExemplarMaxExemplars records the total number of exemplars the exemplar storage can store. +type PrometheusTSDBExemplarMaxExemplars struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBExemplarMaxExemplars returns a new PrometheusTSDBExemplarMaxExemplars instrument. +func NewPrometheusTSDBExemplarMaxExemplars() PrometheusTSDBExemplarMaxExemplars { + labels := []string{} + return PrometheusTSDBExemplarMaxExemplars{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_exemplar_max_exemplars", + Help: "Total number of exemplars the exemplar storage can store.", + }, labels), + } +} + +type PrometheusTSDBExemplarMaxExemplarsAttr interface { + Attribute + implPrometheusTSDBExemplarMaxExemplars() +} + +func (m PrometheusTSDBExemplarMaxExemplars) With( + extra ...PrometheusTSDBExemplarMaxExemplarsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBExemplarOutOfOrderExemplarsTotal records the total number of out-of-order exemplar ingestion failed attempts. +type PrometheusTSDBExemplarOutOfOrderExemplarsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBExemplarOutOfOrderExemplarsTotal returns a new PrometheusTSDBExemplarOutOfOrderExemplarsTotal instrument. +func NewPrometheusTSDBExemplarOutOfOrderExemplarsTotal() PrometheusTSDBExemplarOutOfOrderExemplarsTotal { + labels := []string{} + return PrometheusTSDBExemplarOutOfOrderExemplarsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_exemplar_out_of_order_exemplars_total", + Help: "Total number of out-of-order exemplar ingestion failed attempts.", + }, labels), + } +} + +type PrometheusTSDBExemplarOutOfOrderExemplarsTotalAttr interface { + Attribute + implPrometheusTSDBExemplarOutOfOrderExemplarsTotal() +} + +func (m PrometheusTSDBExemplarOutOfOrderExemplarsTotal) With( + extra ...PrometheusTSDBExemplarOutOfOrderExemplarsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBExemplarSeriesWithExemplarsInStorage records the number of series with exemplars currently in circular storage. +type PrometheusTSDBExemplarSeriesWithExemplarsInStorage struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBExemplarSeriesWithExemplarsInStorage returns a new PrometheusTSDBExemplarSeriesWithExemplarsInStorage instrument. +func NewPrometheusTSDBExemplarSeriesWithExemplarsInStorage() PrometheusTSDBExemplarSeriesWithExemplarsInStorage { + labels := []string{} + return PrometheusTSDBExemplarSeriesWithExemplarsInStorage{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_exemplar_series_with_exemplars_in_storage", + Help: "Number of series with exemplars currently in circular storage.", + }, labels), + } +} + +type PrometheusTSDBExemplarSeriesWithExemplarsInStorageAttr interface { + Attribute + implPrometheusTSDBExemplarSeriesWithExemplarsInStorage() +} + +func (m PrometheusTSDBExemplarSeriesWithExemplarsInStorage) With( + extra ...PrometheusTSDBExemplarSeriesWithExemplarsInStorageAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBHeadActiveAppenders records the number of currently active appender transactions. +type PrometheusTSDBHeadActiveAppenders struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBHeadActiveAppenders returns a new PrometheusTSDBHeadActiveAppenders instrument. +func NewPrometheusTSDBHeadActiveAppenders() PrometheusTSDBHeadActiveAppenders { + labels := []string{} + return PrometheusTSDBHeadActiveAppenders{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_head_active_appenders", + Help: "Number of currently active appender transactions.", + }, labels), + } +} + +type PrometheusTSDBHeadActiveAppendersAttr interface { + Attribute + implPrometheusTSDBHeadActiveAppenders() +} + +func (m PrometheusTSDBHeadActiveAppenders) With( + extra ...PrometheusTSDBHeadActiveAppendersAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBHeadChunks records the total number of chunks in the head block. +type PrometheusTSDBHeadChunks struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBHeadChunks returns a new PrometheusTSDBHeadChunks instrument. +func NewPrometheusTSDBHeadChunks() PrometheusTSDBHeadChunks { + labels := []string{} + return PrometheusTSDBHeadChunks{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_head_chunks", + Help: "Total number of chunks in the head block.", + }, labels), + } +} + +type PrometheusTSDBHeadChunksAttr interface { + Attribute + implPrometheusTSDBHeadChunks() +} + +func (m PrometheusTSDBHeadChunks) With( + extra ...PrometheusTSDBHeadChunksAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBHeadChunksCreatedTotal records the total number of chunks created in the head block. +type PrometheusTSDBHeadChunksCreatedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBHeadChunksCreatedTotal returns a new PrometheusTSDBHeadChunksCreatedTotal instrument. +func NewPrometheusTSDBHeadChunksCreatedTotal() PrometheusTSDBHeadChunksCreatedTotal { + labels := []string{} + return PrometheusTSDBHeadChunksCreatedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_head_chunks_created_total", + Help: "Total number of chunks created in the head block.", + }, labels), + } +} + +type PrometheusTSDBHeadChunksCreatedTotalAttr interface { + Attribute + implPrometheusTSDBHeadChunksCreatedTotal() +} + +func (m PrometheusTSDBHeadChunksCreatedTotal) With( + extra ...PrometheusTSDBHeadChunksCreatedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBHeadChunksRemovedTotal records the total number of chunks removed from the head block. +type PrometheusTSDBHeadChunksRemovedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBHeadChunksRemovedTotal returns a new PrometheusTSDBHeadChunksRemovedTotal instrument. +func NewPrometheusTSDBHeadChunksRemovedTotal() PrometheusTSDBHeadChunksRemovedTotal { + labels := []string{} + return PrometheusTSDBHeadChunksRemovedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_head_chunks_removed_total", + Help: "Total number of chunks removed from the head block.", + }, labels), + } +} + +type PrometheusTSDBHeadChunksRemovedTotalAttr interface { + Attribute + implPrometheusTSDBHeadChunksRemovedTotal() +} + +func (m PrometheusTSDBHeadChunksRemovedTotal) With( + extra ...PrometheusTSDBHeadChunksRemovedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBHeadChunksStorageSizeBytes records the size of the chunks_head directory. +type PrometheusTSDBHeadChunksStorageSizeBytes struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBHeadChunksStorageSizeBytes returns a new PrometheusTSDBHeadChunksStorageSizeBytes instrument. +func NewPrometheusTSDBHeadChunksStorageSizeBytes() PrometheusTSDBHeadChunksStorageSizeBytes { + labels := []string{} + return PrometheusTSDBHeadChunksStorageSizeBytes{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_head_chunks_storage_size_bytes", + Help: "Size of the chunks_head directory.", + }, labels), + } +} + +type PrometheusTSDBHeadChunksStorageSizeBytesAttr interface { + Attribute + implPrometheusTSDBHeadChunksStorageSizeBytes() +} + +func (m PrometheusTSDBHeadChunksStorageSizeBytes) With( + extra ...PrometheusTSDBHeadChunksStorageSizeBytesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBHeadGCDurationSeconds records the runtime of garbage collection in the head block. +type PrometheusTSDBHeadGCDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTSDBHeadGCDurationSeconds returns a new PrometheusTSDBHeadGCDurationSeconds instrument. +func NewPrometheusTSDBHeadGCDurationSeconds() PrometheusTSDBHeadGCDurationSeconds { + labels := []string{} + return PrometheusTSDBHeadGCDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_tsdb_head_gc_duration_seconds", + Help: "Runtime of garbage collection in the head block.", + }, labels), + } +} + +type PrometheusTSDBHeadGCDurationSecondsAttr interface { + Attribute + implPrometheusTSDBHeadGCDurationSeconds() +} + +func (m PrometheusTSDBHeadGCDurationSeconds) With( + extra ...PrometheusTSDBHeadGCDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTSDBHeadMaxTime records the maximum timestamp of the head block. +type PrometheusTSDBHeadMaxTime struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBHeadMaxTime returns a new PrometheusTSDBHeadMaxTime instrument. +func NewPrometheusTSDBHeadMaxTime() PrometheusTSDBHeadMaxTime { + labels := []string{} + return PrometheusTSDBHeadMaxTime{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_head_max_time", + Help: "Maximum timestamp of the head block.", + }, labels), + } +} + +type PrometheusTSDBHeadMaxTimeAttr interface { + Attribute + implPrometheusTSDBHeadMaxTime() +} + +func (m PrometheusTSDBHeadMaxTime) With( + extra ...PrometheusTSDBHeadMaxTimeAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBHeadMaxTimeSeconds records the maximum timestamp of the head block in seconds. +type PrometheusTSDBHeadMaxTimeSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBHeadMaxTimeSeconds returns a new PrometheusTSDBHeadMaxTimeSeconds instrument. +func NewPrometheusTSDBHeadMaxTimeSeconds() PrometheusTSDBHeadMaxTimeSeconds { + labels := []string{} + return PrometheusTSDBHeadMaxTimeSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_head_max_time_seconds", + Help: "Maximum timestamp of the head block in seconds.", + }, labels), + } +} + +type PrometheusTSDBHeadMaxTimeSecondsAttr interface { + Attribute + implPrometheusTSDBHeadMaxTimeSeconds() +} + +func (m PrometheusTSDBHeadMaxTimeSeconds) With( + extra ...PrometheusTSDBHeadMaxTimeSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBHeadMinTime records the minimum timestamp of the head block. +type PrometheusTSDBHeadMinTime struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBHeadMinTime returns a new PrometheusTSDBHeadMinTime instrument. +func NewPrometheusTSDBHeadMinTime() PrometheusTSDBHeadMinTime { + labels := []string{} + return PrometheusTSDBHeadMinTime{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_head_min_time", + Help: "Minimum timestamp of the head block.", + }, labels), + } +} + +type PrometheusTSDBHeadMinTimeAttr interface { + Attribute + implPrometheusTSDBHeadMinTime() +} + +func (m PrometheusTSDBHeadMinTime) With( + extra ...PrometheusTSDBHeadMinTimeAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBHeadMinTimeSeconds records the minimum timestamp of the head block in seconds. +type PrometheusTSDBHeadMinTimeSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBHeadMinTimeSeconds returns a new PrometheusTSDBHeadMinTimeSeconds instrument. +func NewPrometheusTSDBHeadMinTimeSeconds() PrometheusTSDBHeadMinTimeSeconds { + labels := []string{} + return PrometheusTSDBHeadMinTimeSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_head_min_time_seconds", + Help: "Minimum timestamp of the head block in seconds.", + }, labels), + } +} + +type PrometheusTSDBHeadMinTimeSecondsAttr interface { + Attribute + implPrometheusTSDBHeadMinTimeSeconds() +} + +func (m PrometheusTSDBHeadMinTimeSeconds) With( + extra ...PrometheusTSDBHeadMinTimeSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBHeadOutOfOrderSamplesAppendedTotal records the total number of appended out-of-order samples. +type PrometheusTSDBHeadOutOfOrderSamplesAppendedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBHeadOutOfOrderSamplesAppendedTotal returns a new PrometheusTSDBHeadOutOfOrderSamplesAppendedTotal instrument. +func NewPrometheusTSDBHeadOutOfOrderSamplesAppendedTotal() PrometheusTSDBHeadOutOfOrderSamplesAppendedTotal { + labels := []string{ + "type", + } + return PrometheusTSDBHeadOutOfOrderSamplesAppendedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_head_out_of_order_samples_appended_total", + Help: "Total number of appended out-of-order samples.", + }, labels), + } +} + +type PrometheusTSDBHeadOutOfOrderSamplesAppendedTotalAttr interface { + Attribute + implPrometheusTSDBHeadOutOfOrderSamplesAppendedTotal() +} + +func (a TypeAttr) implPrometheusTSDBHeadOutOfOrderSamplesAppendedTotal() {} + +func (m PrometheusTSDBHeadOutOfOrderSamplesAppendedTotal) With( + extra ...PrometheusTSDBHeadOutOfOrderSamplesAppendedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "type": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBHeadSamplesAppendedTotal records the total number of appended samples. +type PrometheusTSDBHeadSamplesAppendedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBHeadSamplesAppendedTotal returns a new PrometheusTSDBHeadSamplesAppendedTotal instrument. +func NewPrometheusTSDBHeadSamplesAppendedTotal() PrometheusTSDBHeadSamplesAppendedTotal { + labels := []string{ + "type", + } + return PrometheusTSDBHeadSamplesAppendedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_head_samples_appended_total", + Help: "Total number of appended samples.", + }, labels), + } +} + +type PrometheusTSDBHeadSamplesAppendedTotalAttr interface { + Attribute + implPrometheusTSDBHeadSamplesAppendedTotal() +} + +func (a TypeAttr) implPrometheusTSDBHeadSamplesAppendedTotal() {} + +func (m PrometheusTSDBHeadSamplesAppendedTotal) With( + extra ...PrometheusTSDBHeadSamplesAppendedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "type": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBHeadSeries records the total number of series in the head block. +type PrometheusTSDBHeadSeries struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBHeadSeries returns a new PrometheusTSDBHeadSeries instrument. +func NewPrometheusTSDBHeadSeries() PrometheusTSDBHeadSeries { + labels := []string{} + return PrometheusTSDBHeadSeries{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_head_series", + Help: "Total number of series in the head block.", + }, labels), + } +} + +type PrometheusTSDBHeadSeriesAttr interface { + Attribute + implPrometheusTSDBHeadSeries() +} + +func (m PrometheusTSDBHeadSeries) With( + extra ...PrometheusTSDBHeadSeriesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBHeadSeriesCreatedTotal records the total number of series created in the head block. +type PrometheusTSDBHeadSeriesCreatedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBHeadSeriesCreatedTotal returns a new PrometheusTSDBHeadSeriesCreatedTotal instrument. +func NewPrometheusTSDBHeadSeriesCreatedTotal() PrometheusTSDBHeadSeriesCreatedTotal { + labels := []string{} + return PrometheusTSDBHeadSeriesCreatedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_head_series_created_total", + Help: "Total number of series created in the head block.", + }, labels), + } +} + +type PrometheusTSDBHeadSeriesCreatedTotalAttr interface { + Attribute + implPrometheusTSDBHeadSeriesCreatedTotal() +} + +func (m PrometheusTSDBHeadSeriesCreatedTotal) With( + extra ...PrometheusTSDBHeadSeriesCreatedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBHeadSeriesNotFoundTotal records the total number of requests for series that were not found. +type PrometheusTSDBHeadSeriesNotFoundTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBHeadSeriesNotFoundTotal returns a new PrometheusTSDBHeadSeriesNotFoundTotal instrument. +func NewPrometheusTSDBHeadSeriesNotFoundTotal() PrometheusTSDBHeadSeriesNotFoundTotal { + labels := []string{} + return PrometheusTSDBHeadSeriesNotFoundTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_head_series_not_found_total", + Help: "Total number of requests for series that were not found.", + }, labels), + } +} + +type PrometheusTSDBHeadSeriesNotFoundTotalAttr interface { + Attribute + implPrometheusTSDBHeadSeriesNotFoundTotal() +} + +func (m PrometheusTSDBHeadSeriesNotFoundTotal) With( + extra ...PrometheusTSDBHeadSeriesNotFoundTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBHeadSeriesRemovedTotal records the total number of series removed from the head block. +type PrometheusTSDBHeadSeriesRemovedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBHeadSeriesRemovedTotal returns a new PrometheusTSDBHeadSeriesRemovedTotal instrument. +func NewPrometheusTSDBHeadSeriesRemovedTotal() PrometheusTSDBHeadSeriesRemovedTotal { + labels := []string{} + return PrometheusTSDBHeadSeriesRemovedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_head_series_removed_total", + Help: "Total number of series removed from the head block.", + }, labels), + } +} + +type PrometheusTSDBHeadSeriesRemovedTotalAttr interface { + Attribute + implPrometheusTSDBHeadSeriesRemovedTotal() +} + +func (m PrometheusTSDBHeadSeriesRemovedTotal) With( + extra ...PrometheusTSDBHeadSeriesRemovedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBHeadStaleSeries records the number of stale series in the head block. +type PrometheusTSDBHeadStaleSeries struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBHeadStaleSeries returns a new PrometheusTSDBHeadStaleSeries instrument. +func NewPrometheusTSDBHeadStaleSeries() PrometheusTSDBHeadStaleSeries { + labels := []string{} + return PrometheusTSDBHeadStaleSeries{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_head_stale_series", + Help: "Number of stale series in the head block.", + }, labels), + } +} + +type PrometheusTSDBHeadStaleSeriesAttr interface { + Attribute + implPrometheusTSDBHeadStaleSeries() +} + +func (m PrometheusTSDBHeadStaleSeries) With( + extra ...PrometheusTSDBHeadStaleSeriesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBHeadTruncationsFailedTotal records the total number of head truncations that failed. +type PrometheusTSDBHeadTruncationsFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBHeadTruncationsFailedTotal returns a new PrometheusTSDBHeadTruncationsFailedTotal instrument. +func NewPrometheusTSDBHeadTruncationsFailedTotal() PrometheusTSDBHeadTruncationsFailedTotal { + labels := []string{} + return PrometheusTSDBHeadTruncationsFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_head_truncations_failed_total", + Help: "Total number of head truncations that failed.", + }, labels), + } +} + +type PrometheusTSDBHeadTruncationsFailedTotalAttr interface { + Attribute + implPrometheusTSDBHeadTruncationsFailedTotal() +} + +func (m PrometheusTSDBHeadTruncationsFailedTotal) With( + extra ...PrometheusTSDBHeadTruncationsFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBHeadTruncationsTotal records the total number of head truncations attempted. +type PrometheusTSDBHeadTruncationsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBHeadTruncationsTotal returns a new PrometheusTSDBHeadTruncationsTotal instrument. +func NewPrometheusTSDBHeadTruncationsTotal() PrometheusTSDBHeadTruncationsTotal { + labels := []string{} + return PrometheusTSDBHeadTruncationsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_head_truncations_total", + Help: "Total number of head truncations attempted.", + }, labels), + } +} + +type PrometheusTSDBHeadTruncationsTotalAttr interface { + Attribute + implPrometheusTSDBHeadTruncationsTotal() +} + +func (m PrometheusTSDBHeadTruncationsTotal) With( + extra ...PrometheusTSDBHeadTruncationsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBIsolationHighWatermark records the isolation high watermark. +type PrometheusTSDBIsolationHighWatermark struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBIsolationHighWatermark returns a new PrometheusTSDBIsolationHighWatermark instrument. +func NewPrometheusTSDBIsolationHighWatermark() PrometheusTSDBIsolationHighWatermark { + labels := []string{} + return PrometheusTSDBIsolationHighWatermark{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_isolation_high_watermark", + Help: "The isolation high watermark.", + }, labels), + } +} + +type PrometheusTSDBIsolationHighWatermarkAttr interface { + Attribute + implPrometheusTSDBIsolationHighWatermark() +} + +func (m PrometheusTSDBIsolationHighWatermark) With( + extra ...PrometheusTSDBIsolationHighWatermarkAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBIsolationLowWatermark records the isolation low watermark. +type PrometheusTSDBIsolationLowWatermark struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBIsolationLowWatermark returns a new PrometheusTSDBIsolationLowWatermark instrument. +func NewPrometheusTSDBIsolationLowWatermark() PrometheusTSDBIsolationLowWatermark { + labels := []string{} + return PrometheusTSDBIsolationLowWatermark{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_isolation_low_watermark", + Help: "The isolation low watermark.", + }, labels), + } +} + +type PrometheusTSDBIsolationLowWatermarkAttr interface { + Attribute + implPrometheusTSDBIsolationLowWatermark() +} + +func (m PrometheusTSDBIsolationLowWatermark) With( + extra ...PrometheusTSDBIsolationLowWatermarkAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBLowestTimestamp records the lowest timestamp value stored in the database. +type PrometheusTSDBLowestTimestamp struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBLowestTimestamp returns a new PrometheusTSDBLowestTimestamp instrument. +func NewPrometheusTSDBLowestTimestamp() PrometheusTSDBLowestTimestamp { + labels := []string{} + return PrometheusTSDBLowestTimestamp{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_lowest_timestamp", + Help: "Lowest timestamp value stored in the database.", + }, labels), + } +} + +type PrometheusTSDBLowestTimestampAttr interface { + Attribute + implPrometheusTSDBLowestTimestamp() +} + +func (m PrometheusTSDBLowestTimestamp) With( + extra ...PrometheusTSDBLowestTimestampAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBLowestTimestampSeconds records the lowest timestamp value stored in the database in seconds. +type PrometheusTSDBLowestTimestampSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBLowestTimestampSeconds returns a new PrometheusTSDBLowestTimestampSeconds instrument. +func NewPrometheusTSDBLowestTimestampSeconds() PrometheusTSDBLowestTimestampSeconds { + labels := []string{} + return PrometheusTSDBLowestTimestampSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_lowest_timestamp_seconds", + Help: "Lowest timestamp value stored in the database in seconds.", + }, labels), + } +} + +type PrometheusTSDBLowestTimestampSecondsAttr interface { + Attribute + implPrometheusTSDBLowestTimestampSeconds() +} + +func (m PrometheusTSDBLowestTimestampSeconds) With( + extra ...PrometheusTSDBLowestTimestampSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBMmapChunkCorruptionsTotal records the total number of memory-mapped chunk corruptions. +type PrometheusTSDBMmapChunkCorruptionsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBMmapChunkCorruptionsTotal returns a new PrometheusTSDBMmapChunkCorruptionsTotal instrument. +func NewPrometheusTSDBMmapChunkCorruptionsTotal() PrometheusTSDBMmapChunkCorruptionsTotal { + labels := []string{} + return PrometheusTSDBMmapChunkCorruptionsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_mmap_chunk_corruptions_total", + Help: "Total number of memory-mapped chunk corruptions.", + }, labels), + } +} + +type PrometheusTSDBMmapChunkCorruptionsTotalAttr interface { + Attribute + implPrometheusTSDBMmapChunkCorruptionsTotal() +} + +func (m PrometheusTSDBMmapChunkCorruptionsTotal) With( + extra ...PrometheusTSDBMmapChunkCorruptionsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBMmapChunksTotal records the total number of memory-mapped chunks. +type PrometheusTSDBMmapChunksTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBMmapChunksTotal returns a new PrometheusTSDBMmapChunksTotal instrument. +func NewPrometheusTSDBMmapChunksTotal() PrometheusTSDBMmapChunksTotal { + labels := []string{} + return PrometheusTSDBMmapChunksTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_mmap_chunks_total", + Help: "Total number of memory-mapped chunks.", + }, labels), + } +} + +type PrometheusTSDBMmapChunksTotalAttr interface { + Attribute + implPrometheusTSDBMmapChunksTotal() +} + +func (m PrometheusTSDBMmapChunksTotal) With( + extra ...PrometheusTSDBMmapChunksTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBOutOfBoundSamplesTotal records the total number of out-of-bound samples ingestion failed attempts. +type PrometheusTSDBOutOfBoundSamplesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBOutOfBoundSamplesTotal returns a new PrometheusTSDBOutOfBoundSamplesTotal instrument. +func NewPrometheusTSDBOutOfBoundSamplesTotal() PrometheusTSDBOutOfBoundSamplesTotal { + labels := []string{ + "type", + } + return PrometheusTSDBOutOfBoundSamplesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_out_of_bound_samples_total", + Help: "Total number of out-of-bound samples ingestion failed attempts.", + }, labels), + } +} + +type PrometheusTSDBOutOfBoundSamplesTotalAttr interface { + Attribute + implPrometheusTSDBOutOfBoundSamplesTotal() +} + +func (a TypeAttr) implPrometheusTSDBOutOfBoundSamplesTotal() {} + +func (m PrometheusTSDBOutOfBoundSamplesTotal) With( + extra ...PrometheusTSDBOutOfBoundSamplesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "type": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBOutOfOrderSamplesTotal records the total number of out-of-order samples ingestion failed attempts. +type PrometheusTSDBOutOfOrderSamplesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBOutOfOrderSamplesTotal returns a new PrometheusTSDBOutOfOrderSamplesTotal instrument. +func NewPrometheusTSDBOutOfOrderSamplesTotal() PrometheusTSDBOutOfOrderSamplesTotal { + labels := []string{ + "type", + } + return PrometheusTSDBOutOfOrderSamplesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_out_of_order_samples_total", + Help: "Total number of out-of-order samples ingestion failed attempts.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderSamplesTotalAttr interface { + Attribute + implPrometheusTSDBOutOfOrderSamplesTotal() +} + +func (a TypeAttr) implPrometheusTSDBOutOfOrderSamplesTotal() {} + +func (m PrometheusTSDBOutOfOrderSamplesTotal) With( + extra ...PrometheusTSDBOutOfOrderSamplesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "type": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBOutOfOrderWBLCompletedPagesTotal records the total number of completed WBL pages for out-of-order samples. +type PrometheusTSDBOutOfOrderWBLCompletedPagesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBOutOfOrderWBLCompletedPagesTotal returns a new PrometheusTSDBOutOfOrderWBLCompletedPagesTotal instrument. +func NewPrometheusTSDBOutOfOrderWBLCompletedPagesTotal() PrometheusTSDBOutOfOrderWBLCompletedPagesTotal { + labels := []string{} + return PrometheusTSDBOutOfOrderWBLCompletedPagesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_out_of_order_wbl_completed_pages_total", + Help: "Total number of completed WBL pages for out-of-order samples.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderWBLCompletedPagesTotalAttr interface { + Attribute + implPrometheusTSDBOutOfOrderWBLCompletedPagesTotal() +} + +func (m PrometheusTSDBOutOfOrderWBLCompletedPagesTotal) With( + extra ...PrometheusTSDBOutOfOrderWBLCompletedPagesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBOutOfOrderWBLFsyncDurationSeconds records the duration of WBL fsync for out-of-order samples. +type PrometheusTSDBOutOfOrderWBLFsyncDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTSDBOutOfOrderWBLFsyncDurationSeconds returns a new PrometheusTSDBOutOfOrderWBLFsyncDurationSeconds instrument. +func NewPrometheusTSDBOutOfOrderWBLFsyncDurationSeconds() PrometheusTSDBOutOfOrderWBLFsyncDurationSeconds { + labels := []string{} + return PrometheusTSDBOutOfOrderWBLFsyncDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_tsdb_out_of_order_wbl_fsync_duration_seconds", + Help: "Duration of WBL fsync for out-of-order samples.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderWBLFsyncDurationSecondsAttr interface { + Attribute + implPrometheusTSDBOutOfOrderWBLFsyncDurationSeconds() +} + +func (m PrometheusTSDBOutOfOrderWBLFsyncDurationSeconds) With( + extra ...PrometheusTSDBOutOfOrderWBLFsyncDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTSDBOutOfOrderWBLPageFlushesTotal records the total number of WBL page flushes for out-of-order samples. +type PrometheusTSDBOutOfOrderWBLPageFlushesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBOutOfOrderWBLPageFlushesTotal returns a new PrometheusTSDBOutOfOrderWBLPageFlushesTotal instrument. +func NewPrometheusTSDBOutOfOrderWBLPageFlushesTotal() PrometheusTSDBOutOfOrderWBLPageFlushesTotal { + labels := []string{} + return PrometheusTSDBOutOfOrderWBLPageFlushesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_out_of_order_wbl_page_flushes_total", + Help: "Total number of WBL page flushes for out-of-order samples.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderWBLPageFlushesTotalAttr interface { + Attribute + implPrometheusTSDBOutOfOrderWBLPageFlushesTotal() +} + +func (m PrometheusTSDBOutOfOrderWBLPageFlushesTotal) With( + extra ...PrometheusTSDBOutOfOrderWBLPageFlushesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBOutOfOrderWBLRecordPartWritesTotal records the total number of WBL record part writes for out-of-order samples. +type PrometheusTSDBOutOfOrderWBLRecordPartWritesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBOutOfOrderWBLRecordPartWritesTotal returns a new PrometheusTSDBOutOfOrderWBLRecordPartWritesTotal instrument. +func NewPrometheusTSDBOutOfOrderWBLRecordPartWritesTotal() PrometheusTSDBOutOfOrderWBLRecordPartWritesTotal { + labels := []string{} + return PrometheusTSDBOutOfOrderWBLRecordPartWritesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_out_of_order_wbl_record_part_writes_total", + Help: "Total number of WBL record part writes for out-of-order samples.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderWBLRecordPartWritesTotalAttr interface { + Attribute + implPrometheusTSDBOutOfOrderWBLRecordPartWritesTotal() +} + +func (m PrometheusTSDBOutOfOrderWBLRecordPartWritesTotal) With( + extra ...PrometheusTSDBOutOfOrderWBLRecordPartWritesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotal records the total bytes written to WBL record parts for out-of-order samples. +type PrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotal returns a new PrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotal instrument. +func NewPrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotal() PrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotal { + labels := []string{} + return PrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_out_of_order_wbl_record_parts_bytes_written_total", + Help: "Total bytes written to WBL record parts for out-of-order samples.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotalAttr interface { + Attribute + implPrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotal() +} + +func (m PrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotal) With( + extra ...PrometheusTSDBOutOfOrderWBLRecordPartsBytesWrittenTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBOutOfOrderWBLSegmentCurrent records the current out-of-order WBL segment. +type PrometheusTSDBOutOfOrderWBLSegmentCurrent struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBOutOfOrderWBLSegmentCurrent returns a new PrometheusTSDBOutOfOrderWBLSegmentCurrent instrument. +func NewPrometheusTSDBOutOfOrderWBLSegmentCurrent() PrometheusTSDBOutOfOrderWBLSegmentCurrent { + labels := []string{} + return PrometheusTSDBOutOfOrderWBLSegmentCurrent{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_out_of_order_wbl_segment_current", + Help: "Current out-of-order WBL segment.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderWBLSegmentCurrentAttr interface { + Attribute + implPrometheusTSDBOutOfOrderWBLSegmentCurrent() +} + +func (m PrometheusTSDBOutOfOrderWBLSegmentCurrent) With( + extra ...PrometheusTSDBOutOfOrderWBLSegmentCurrentAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBOutOfOrderWBLStorageSizeBytes records the size of the out-of-order WBL storage. +type PrometheusTSDBOutOfOrderWBLStorageSizeBytes struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBOutOfOrderWBLStorageSizeBytes returns a new PrometheusTSDBOutOfOrderWBLStorageSizeBytes instrument. +func NewPrometheusTSDBOutOfOrderWBLStorageSizeBytes() PrometheusTSDBOutOfOrderWBLStorageSizeBytes { + labels := []string{} + return PrometheusTSDBOutOfOrderWBLStorageSizeBytes{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_out_of_order_wbl_storage_size_bytes", + Help: "Size of the out-of-order WBL storage.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderWBLStorageSizeBytesAttr interface { + Attribute + implPrometheusTSDBOutOfOrderWBLStorageSizeBytes() +} + +func (m PrometheusTSDBOutOfOrderWBLStorageSizeBytes) With( + extra ...PrometheusTSDBOutOfOrderWBLStorageSizeBytesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBOutOfOrderWBLTruncationsFailedTotal records the total number of out-of-order WBL truncations that failed. +type PrometheusTSDBOutOfOrderWBLTruncationsFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBOutOfOrderWBLTruncationsFailedTotal returns a new PrometheusTSDBOutOfOrderWBLTruncationsFailedTotal instrument. +func NewPrometheusTSDBOutOfOrderWBLTruncationsFailedTotal() PrometheusTSDBOutOfOrderWBLTruncationsFailedTotal { + labels := []string{} + return PrometheusTSDBOutOfOrderWBLTruncationsFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_out_of_order_wbl_truncations_failed_total", + Help: "Total number of out-of-order WBL truncations that failed.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderWBLTruncationsFailedTotalAttr interface { + Attribute + implPrometheusTSDBOutOfOrderWBLTruncationsFailedTotal() +} + +func (m PrometheusTSDBOutOfOrderWBLTruncationsFailedTotal) With( + extra ...PrometheusTSDBOutOfOrderWBLTruncationsFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBOutOfOrderWBLTruncationsTotal records the total number of out-of-order WBL truncations. +type PrometheusTSDBOutOfOrderWBLTruncationsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBOutOfOrderWBLTruncationsTotal returns a new PrometheusTSDBOutOfOrderWBLTruncationsTotal instrument. +func NewPrometheusTSDBOutOfOrderWBLTruncationsTotal() PrometheusTSDBOutOfOrderWBLTruncationsTotal { + labels := []string{} + return PrometheusTSDBOutOfOrderWBLTruncationsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_out_of_order_wbl_truncations_total", + Help: "Total number of out-of-order WBL truncations.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderWBLTruncationsTotalAttr interface { + Attribute + implPrometheusTSDBOutOfOrderWBLTruncationsTotal() +} + +func (m PrometheusTSDBOutOfOrderWBLTruncationsTotal) With( + extra ...PrometheusTSDBOutOfOrderWBLTruncationsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBOutOfOrderWBLWritesFailedTotal records the total number of out-of-order WBL writes that failed. +type PrometheusTSDBOutOfOrderWBLWritesFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBOutOfOrderWBLWritesFailedTotal returns a new PrometheusTSDBOutOfOrderWBLWritesFailedTotal instrument. +func NewPrometheusTSDBOutOfOrderWBLWritesFailedTotal() PrometheusTSDBOutOfOrderWBLWritesFailedTotal { + labels := []string{} + return PrometheusTSDBOutOfOrderWBLWritesFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_out_of_order_wbl_writes_failed_total", + Help: "Total number of out-of-order WBL writes that failed.", + }, labels), + } +} + +type PrometheusTSDBOutOfOrderWBLWritesFailedTotalAttr interface { + Attribute + implPrometheusTSDBOutOfOrderWBLWritesFailedTotal() +} + +func (m PrometheusTSDBOutOfOrderWBLWritesFailedTotal) With( + extra ...PrometheusTSDBOutOfOrderWBLWritesFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBReloadsFailuresTotal records the number of times the database reloads failed. +type PrometheusTSDBReloadsFailuresTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBReloadsFailuresTotal returns a new PrometheusTSDBReloadsFailuresTotal instrument. +func NewPrometheusTSDBReloadsFailuresTotal() PrometheusTSDBReloadsFailuresTotal { + labels := []string{} + return PrometheusTSDBReloadsFailuresTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_reloads_failures_total", + Help: "Number of times the database reloads failed.", + }, labels), + } +} + +type PrometheusTSDBReloadsFailuresTotalAttr interface { + Attribute + implPrometheusTSDBReloadsFailuresTotal() +} + +func (m PrometheusTSDBReloadsFailuresTotal) With( + extra ...PrometheusTSDBReloadsFailuresTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBReloadsTotal records the number of times the database reloads. +type PrometheusTSDBReloadsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBReloadsTotal returns a new PrometheusTSDBReloadsTotal instrument. +func NewPrometheusTSDBReloadsTotal() PrometheusTSDBReloadsTotal { + labels := []string{} + return PrometheusTSDBReloadsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_reloads_total", + Help: "Number of times the database reloads.", + }, labels), + } +} + +type PrometheusTSDBReloadsTotalAttr interface { + Attribute + implPrometheusTSDBReloadsTotal() +} + +func (m PrometheusTSDBReloadsTotal) With( + extra ...PrometheusTSDBReloadsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBRetentionLimitBytes records the maximum number of bytes to be retained in the TSDB. +type PrometheusTSDBRetentionLimitBytes struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBRetentionLimitBytes returns a new PrometheusTSDBRetentionLimitBytes instrument. +func NewPrometheusTSDBRetentionLimitBytes() PrometheusTSDBRetentionLimitBytes { + labels := []string{} + return PrometheusTSDBRetentionLimitBytes{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_retention_limit_bytes", + Help: "Maximum number of bytes to be retained in the TSDB.", + }, labels), + } +} + +type PrometheusTSDBRetentionLimitBytesAttr interface { + Attribute + implPrometheusTSDBRetentionLimitBytes() +} + +func (m PrometheusTSDBRetentionLimitBytes) With( + extra ...PrometheusTSDBRetentionLimitBytesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBRetentionLimitSeconds records the maximum age in seconds for samples to be retained in the TSDB. +type PrometheusTSDBRetentionLimitSeconds struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBRetentionLimitSeconds returns a new PrometheusTSDBRetentionLimitSeconds instrument. +func NewPrometheusTSDBRetentionLimitSeconds() PrometheusTSDBRetentionLimitSeconds { + labels := []string{} + return PrometheusTSDBRetentionLimitSeconds{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_retention_limit_seconds", + Help: "Maximum age in seconds for samples to be retained in the TSDB.", + }, labels), + } +} + +type PrometheusTSDBRetentionLimitSecondsAttr interface { + Attribute + implPrometheusTSDBRetentionLimitSeconds() +} + +func (m PrometheusTSDBRetentionLimitSeconds) With( + extra ...PrometheusTSDBRetentionLimitSecondsAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBSampleOOODelta records the delta in seconds between the time when an out-of-order sample was ingested and the latest sample in the chunk. +type PrometheusTSDBSampleOOODelta struct { + *prometheus.HistogramVec +} + +// NewPrometheusTSDBSampleOOODelta returns a new PrometheusTSDBSampleOOODelta instrument. +func NewPrometheusTSDBSampleOOODelta() PrometheusTSDBSampleOOODelta { + labels := []string{} + return PrometheusTSDBSampleOOODelta{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_tsdb_sample_ooo_delta", + Help: "Delta in seconds between the time when an out-of-order sample was ingested and the latest sample in the chunk.", + }, labels), + } +} + +type PrometheusTSDBSampleOOODeltaAttr interface { + Attribute + implPrometheusTSDBSampleOOODelta() +} + +func (m PrometheusTSDBSampleOOODelta) With( + extra ...PrometheusTSDBSampleOOODeltaAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTSDBSizeRetentionsTotal records the number of times that blocks were deleted because the maximum number of bytes was exceeded. +type PrometheusTSDBSizeRetentionsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBSizeRetentionsTotal returns a new PrometheusTSDBSizeRetentionsTotal instrument. +func NewPrometheusTSDBSizeRetentionsTotal() PrometheusTSDBSizeRetentionsTotal { + labels := []string{} + return PrometheusTSDBSizeRetentionsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_size_retentions_total", + Help: "Number of times that blocks were deleted because the maximum number of bytes was exceeded.", + }, labels), + } +} + +type PrometheusTSDBSizeRetentionsTotalAttr interface { + Attribute + implPrometheusTSDBSizeRetentionsTotal() +} + +func (m PrometheusTSDBSizeRetentionsTotal) With( + extra ...PrometheusTSDBSizeRetentionsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBSnapshotReplayErrorTotal records the total number of snapshot replay errors. +type PrometheusTSDBSnapshotReplayErrorTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBSnapshotReplayErrorTotal returns a new PrometheusTSDBSnapshotReplayErrorTotal instrument. +func NewPrometheusTSDBSnapshotReplayErrorTotal() PrometheusTSDBSnapshotReplayErrorTotal { + labels := []string{} + return PrometheusTSDBSnapshotReplayErrorTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_snapshot_replay_error_total", + Help: "Total number of snapshot replay errors.", + }, labels), + } +} + +type PrometheusTSDBSnapshotReplayErrorTotalAttr interface { + Attribute + implPrometheusTSDBSnapshotReplayErrorTotal() +} + +func (m PrometheusTSDBSnapshotReplayErrorTotal) With( + extra ...PrometheusTSDBSnapshotReplayErrorTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBStorageBlocksBytes records the number of bytes that are currently used for local storage by all blocks. +type PrometheusTSDBStorageBlocksBytes struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBStorageBlocksBytes returns a new PrometheusTSDBStorageBlocksBytes instrument. +func NewPrometheusTSDBStorageBlocksBytes() PrometheusTSDBStorageBlocksBytes { + labels := []string{} + return PrometheusTSDBStorageBlocksBytes{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_storage_blocks_bytes", + Help: "The number of bytes that are currently used for local storage by all blocks.", + }, labels), + } +} + +type PrometheusTSDBStorageBlocksBytesAttr interface { + Attribute + implPrometheusTSDBStorageBlocksBytes() +} + +func (m PrometheusTSDBStorageBlocksBytes) With( + extra ...PrometheusTSDBStorageBlocksBytesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBSymbolTableSizeBytes records the size of the symbol table in bytes. +type PrometheusTSDBSymbolTableSizeBytes struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBSymbolTableSizeBytes returns a new PrometheusTSDBSymbolTableSizeBytes instrument. +func NewPrometheusTSDBSymbolTableSizeBytes() PrometheusTSDBSymbolTableSizeBytes { + labels := []string{} + return PrometheusTSDBSymbolTableSizeBytes{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_symbol_table_size_bytes", + Help: "Size of the symbol table in bytes.", + }, labels), + } +} + +type PrometheusTSDBSymbolTableSizeBytesAttr interface { + Attribute + implPrometheusTSDBSymbolTableSizeBytes() +} + +func (m PrometheusTSDBSymbolTableSizeBytes) With( + extra ...PrometheusTSDBSymbolTableSizeBytesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBTimeRetentionsTotal records the number of times that blocks were deleted because the maximum time limit was exceeded. +type PrometheusTSDBTimeRetentionsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBTimeRetentionsTotal returns a new PrometheusTSDBTimeRetentionsTotal instrument. +func NewPrometheusTSDBTimeRetentionsTotal() PrometheusTSDBTimeRetentionsTotal { + labels := []string{} + return PrometheusTSDBTimeRetentionsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_time_retentions_total", + Help: "Number of times that blocks were deleted because the maximum time limit was exceeded.", + }, labels), + } +} + +type PrometheusTSDBTimeRetentionsTotalAttr interface { + Attribute + implPrometheusTSDBTimeRetentionsTotal() +} + +func (m PrometheusTSDBTimeRetentionsTotal) With( + extra ...PrometheusTSDBTimeRetentionsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBTombstoneCleanupSeconds records the time taken to clean up tombstones. +type PrometheusTSDBTombstoneCleanupSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTSDBTombstoneCleanupSeconds returns a new PrometheusTSDBTombstoneCleanupSeconds instrument. +func NewPrometheusTSDBTombstoneCleanupSeconds() PrometheusTSDBTombstoneCleanupSeconds { + labels := []string{} + return PrometheusTSDBTombstoneCleanupSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_tsdb_tombstone_cleanup_seconds", + Help: "Time taken to clean up tombstones.", + }, labels), + } +} + +type PrometheusTSDBTombstoneCleanupSecondsAttr interface { + Attribute + implPrometheusTSDBTombstoneCleanupSeconds() +} + +func (m PrometheusTSDBTombstoneCleanupSeconds) With( + extra ...PrometheusTSDBTombstoneCleanupSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTSDBTooOldSamplesTotal records the total number of samples that were too old to be ingested. +type PrometheusTSDBTooOldSamplesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBTooOldSamplesTotal returns a new PrometheusTSDBTooOldSamplesTotal instrument. +func NewPrometheusTSDBTooOldSamplesTotal() PrometheusTSDBTooOldSamplesTotal { + labels := []string{ + "type", + } + return PrometheusTSDBTooOldSamplesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_too_old_samples_total", + Help: "Total number of samples that were too old to be ingested.", + }, labels), + } +} + +type PrometheusTSDBTooOldSamplesTotalAttr interface { + Attribute + implPrometheusTSDBTooOldSamplesTotal() +} + +func (a TypeAttr) implPrometheusTSDBTooOldSamplesTotal() {} + +func (m PrometheusTSDBTooOldSamplesTotal) With( + extra ...PrometheusTSDBTooOldSamplesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "type": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBVerticalCompactionsTotal records the total number of compactions done on overlapping blocks. +type PrometheusTSDBVerticalCompactionsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBVerticalCompactionsTotal returns a new PrometheusTSDBVerticalCompactionsTotal instrument. +func NewPrometheusTSDBVerticalCompactionsTotal() PrometheusTSDBVerticalCompactionsTotal { + labels := []string{} + return PrometheusTSDBVerticalCompactionsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_vertical_compactions_total", + Help: "Total number of compactions done on overlapping blocks.", + }, labels), + } +} + +type PrometheusTSDBVerticalCompactionsTotalAttr interface { + Attribute + implPrometheusTSDBVerticalCompactionsTotal() +} + +func (m PrometheusTSDBVerticalCompactionsTotal) With( + extra ...PrometheusTSDBVerticalCompactionsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBWALCompletedPagesTotal records the total number of completed WAL pages. +type PrometheusTSDBWALCompletedPagesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBWALCompletedPagesTotal returns a new PrometheusTSDBWALCompletedPagesTotal instrument. +func NewPrometheusTSDBWALCompletedPagesTotal() PrometheusTSDBWALCompletedPagesTotal { + labels := []string{} + return PrometheusTSDBWALCompletedPagesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_wal_completed_pages_total", + Help: "Total number of completed WAL pages.", + }, labels), + } +} + +type PrometheusTSDBWALCompletedPagesTotalAttr interface { + Attribute + implPrometheusTSDBWALCompletedPagesTotal() +} + +func (m PrometheusTSDBWALCompletedPagesTotal) With( + extra ...PrometheusTSDBWALCompletedPagesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBWALCorruptionsTotal records the total number of WAL corruptions. +type PrometheusTSDBWALCorruptionsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBWALCorruptionsTotal returns a new PrometheusTSDBWALCorruptionsTotal instrument. +func NewPrometheusTSDBWALCorruptionsTotal() PrometheusTSDBWALCorruptionsTotal { + labels := []string{} + return PrometheusTSDBWALCorruptionsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_wal_corruptions_total", + Help: "Total number of WAL corruptions.", + }, labels), + } +} + +type PrometheusTSDBWALCorruptionsTotalAttr interface { + Attribute + implPrometheusTSDBWALCorruptionsTotal() +} + +func (m PrometheusTSDBWALCorruptionsTotal) With( + extra ...PrometheusTSDBWALCorruptionsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBWALFsyncDurationSeconds records the duration of WAL fsync. +type PrometheusTSDBWALFsyncDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTSDBWALFsyncDurationSeconds returns a new PrometheusTSDBWALFsyncDurationSeconds instrument. +func NewPrometheusTSDBWALFsyncDurationSeconds() PrometheusTSDBWALFsyncDurationSeconds { + labels := []string{} + return PrometheusTSDBWALFsyncDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_tsdb_wal_fsync_duration_seconds", + Help: "Duration of WAL fsync.", + }, labels), + } +} + +type PrometheusTSDBWALFsyncDurationSecondsAttr interface { + Attribute + implPrometheusTSDBWALFsyncDurationSeconds() +} + +func (m PrometheusTSDBWALFsyncDurationSeconds) With( + extra ...PrometheusTSDBWALFsyncDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTSDBWALPageFlushesTotal records the total number of WAL page flushes. +type PrometheusTSDBWALPageFlushesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBWALPageFlushesTotal returns a new PrometheusTSDBWALPageFlushesTotal instrument. +func NewPrometheusTSDBWALPageFlushesTotal() PrometheusTSDBWALPageFlushesTotal { + labels := []string{} + return PrometheusTSDBWALPageFlushesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_wal_page_flushes_total", + Help: "Total number of WAL page flushes.", + }, labels), + } +} + +type PrometheusTSDBWALPageFlushesTotalAttr interface { + Attribute + implPrometheusTSDBWALPageFlushesTotal() +} + +func (m PrometheusTSDBWALPageFlushesTotal) With( + extra ...PrometheusTSDBWALPageFlushesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBWALRecordBytesSavedTotal records the total bytes saved by WAL record compression. +type PrometheusTSDBWALRecordBytesSavedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBWALRecordBytesSavedTotal returns a new PrometheusTSDBWALRecordBytesSavedTotal instrument. +func NewPrometheusTSDBWALRecordBytesSavedTotal() PrometheusTSDBWALRecordBytesSavedTotal { + labels := []string{ + "compression", + } + return PrometheusTSDBWALRecordBytesSavedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_wal_record_bytes_saved_total", + Help: "Total bytes saved by WAL record compression.", + }, labels), + } +} + +type PrometheusTSDBWALRecordBytesSavedTotalAttr interface { + Attribute + implPrometheusTSDBWALRecordBytesSavedTotal() +} + +func (a CompressionAttr) implPrometheusTSDBWALRecordBytesSavedTotal() {} + +func (m PrometheusTSDBWALRecordBytesSavedTotal) With( + extra ...PrometheusTSDBWALRecordBytesSavedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "compression": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBWALRecordPartWritesTotal records the total number of WAL record part writes. +type PrometheusTSDBWALRecordPartWritesTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBWALRecordPartWritesTotal returns a new PrometheusTSDBWALRecordPartWritesTotal instrument. +func NewPrometheusTSDBWALRecordPartWritesTotal() PrometheusTSDBWALRecordPartWritesTotal { + labels := []string{} + return PrometheusTSDBWALRecordPartWritesTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_wal_record_part_writes_total", + Help: "Total number of WAL record part writes.", + }, labels), + } +} + +type PrometheusTSDBWALRecordPartWritesTotalAttr interface { + Attribute + implPrometheusTSDBWALRecordPartWritesTotal() +} + +func (m PrometheusTSDBWALRecordPartWritesTotal) With( + extra ...PrometheusTSDBWALRecordPartWritesTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBWALRecordPartsBytesWrittenTotal records the total bytes written to WAL record parts. +type PrometheusTSDBWALRecordPartsBytesWrittenTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBWALRecordPartsBytesWrittenTotal returns a new PrometheusTSDBWALRecordPartsBytesWrittenTotal instrument. +func NewPrometheusTSDBWALRecordPartsBytesWrittenTotal() PrometheusTSDBWALRecordPartsBytesWrittenTotal { + labels := []string{} + return PrometheusTSDBWALRecordPartsBytesWrittenTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_wal_record_parts_bytes_written_total", + Help: "Total bytes written to WAL record parts.", + }, labels), + } +} + +type PrometheusTSDBWALRecordPartsBytesWrittenTotalAttr interface { + Attribute + implPrometheusTSDBWALRecordPartsBytesWrittenTotal() +} + +func (m PrometheusTSDBWALRecordPartsBytesWrittenTotal) With( + extra ...PrometheusTSDBWALRecordPartsBytesWrittenTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBWALSegmentCurrent records the current WAL segment. +type PrometheusTSDBWALSegmentCurrent struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBWALSegmentCurrent returns a new PrometheusTSDBWALSegmentCurrent instrument. +func NewPrometheusTSDBWALSegmentCurrent() PrometheusTSDBWALSegmentCurrent { + labels := []string{} + return PrometheusTSDBWALSegmentCurrent{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_wal_segment_current", + Help: "Current WAL segment.", + }, labels), + } +} + +type PrometheusTSDBWALSegmentCurrentAttr interface { + Attribute + implPrometheusTSDBWALSegmentCurrent() +} + +func (m PrometheusTSDBWALSegmentCurrent) With( + extra ...PrometheusTSDBWALSegmentCurrentAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBWALStorageSizeBytes records the size of the WAL storage. +type PrometheusTSDBWALStorageSizeBytes struct { + *prometheus.GaugeVec +} + +// NewPrometheusTSDBWALStorageSizeBytes returns a new PrometheusTSDBWALStorageSizeBytes instrument. +func NewPrometheusTSDBWALStorageSizeBytes() PrometheusTSDBWALStorageSizeBytes { + labels := []string{} + return PrometheusTSDBWALStorageSizeBytes{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_tsdb_wal_storage_size_bytes", + Help: "Size of the WAL storage.", + }, labels), + } +} + +type PrometheusTSDBWALStorageSizeBytesAttr interface { + Attribute + implPrometheusTSDBWALStorageSizeBytes() +} + +func (m PrometheusTSDBWALStorageSizeBytes) With( + extra ...PrometheusTSDBWALStorageSizeBytesAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusTSDBWALTruncateDurationSeconds records the duration of WAL truncation. +type PrometheusTSDBWALTruncateDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusTSDBWALTruncateDurationSeconds returns a new PrometheusTSDBWALTruncateDurationSeconds instrument. +func NewPrometheusTSDBWALTruncateDurationSeconds() PrometheusTSDBWALTruncateDurationSeconds { + labels := []string{} + return PrometheusTSDBWALTruncateDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_tsdb_wal_truncate_duration_seconds", + Help: "Duration of WAL truncation.", + }, labels), + } +} + +type PrometheusTSDBWALTruncateDurationSecondsAttr interface { + Attribute + implPrometheusTSDBWALTruncateDurationSeconds() +} + +func (m PrometheusTSDBWALTruncateDurationSeconds) With( + extra ...PrometheusTSDBWALTruncateDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusTSDBWALTruncationsFailedTotal records the total number of WAL truncations that failed. +type PrometheusTSDBWALTruncationsFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBWALTruncationsFailedTotal returns a new PrometheusTSDBWALTruncationsFailedTotal instrument. +func NewPrometheusTSDBWALTruncationsFailedTotal() PrometheusTSDBWALTruncationsFailedTotal { + labels := []string{} + return PrometheusTSDBWALTruncationsFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_wal_truncations_failed_total", + Help: "Total number of WAL truncations that failed.", + }, labels), + } +} + +type PrometheusTSDBWALTruncationsFailedTotalAttr interface { + Attribute + implPrometheusTSDBWALTruncationsFailedTotal() +} + +func (m PrometheusTSDBWALTruncationsFailedTotal) With( + extra ...PrometheusTSDBWALTruncationsFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBWALTruncationsTotal records the total number of WAL truncations. +type PrometheusTSDBWALTruncationsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBWALTruncationsTotal returns a new PrometheusTSDBWALTruncationsTotal instrument. +func NewPrometheusTSDBWALTruncationsTotal() PrometheusTSDBWALTruncationsTotal { + labels := []string{} + return PrometheusTSDBWALTruncationsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_wal_truncations_total", + Help: "Total number of WAL truncations.", + }, labels), + } +} + +type PrometheusTSDBWALTruncationsTotalAttr interface { + Attribute + implPrometheusTSDBWALTruncationsTotal() +} + +func (m PrometheusTSDBWALTruncationsTotal) With( + extra ...PrometheusTSDBWALTruncationsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusTSDBWALWritesFailedTotal records the total number of WAL writes that failed. +type PrometheusTSDBWALWritesFailedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusTSDBWALWritesFailedTotal returns a new PrometheusTSDBWALWritesFailedTotal instrument. +func NewPrometheusTSDBWALWritesFailedTotal() PrometheusTSDBWALWritesFailedTotal { + labels := []string{} + return PrometheusTSDBWALWritesFailedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_tsdb_wal_writes_failed_total", + Help: "Total number of WAL writes that failed.", + }, labels), + } +} + +type PrometheusTSDBWALWritesFailedTotalAttr interface { + Attribute + implPrometheusTSDBWALWritesFailedTotal() +} + +func (m PrometheusTSDBWALWritesFailedTotal) With( + extra ...PrometheusTSDBWALWritesFailedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} diff --git a/web/semconv/README.md b/web/semconv/README.md new file mode 100644 index 0000000000..11c0224362 --- /dev/null +++ b/web/semconv/README.md @@ -0,0 +1,123 @@ + + +# Metrics + +This document describes the metrics defined in this semantic convention registry. + +| Metric | Type | Unit | Description | +|--------|------|------|-------------| +| `prometheus_api_notification_active_subscribers` | gauge | {subscriber} | The current number of active notification subscribers. | +| `prometheus_api_notification_updates_dropped_total` | counter | {update} | Total number of API notification updates that were dropped. | +| `prometheus_api_notification_updates_sent_total` | counter | {update} | Total number of API notification updates sent. | +| `prometheus_http_request_duration_seconds` | histogram | s | Histogram of latencies for HTTP requests. | +| `prometheus_http_requests_total` | counter | {request} | Counter of HTTP requests. | +| `prometheus_http_response_size_bytes` | histogram | By | Histogram of response size for HTTP requests. | +| `prometheus_ready` | gauge | 1 | Whether Prometheus startup was fully completed and the server is ready for normal operation. | +| `prometheus_web_federation_errors_total` | counter | {error} | Total number of errors that occurred while sending federation responses. | +| `prometheus_web_federation_warnings_total` | counter | {warning} | Total number of warnings that occurred while sending federation responses. | + + +## Metric Details + + +### `prometheus_api_notification_active_subscribers` + +The current number of active notification subscribers. + +- **Type:** gauge +- **Unit:** {subscriber} +- **Stability:** development + + +### `prometheus_api_notification_updates_dropped_total` + +Total number of API notification updates that were dropped. + +- **Type:** counter +- **Unit:** {update} +- **Stability:** development + + +### `prometheus_api_notification_updates_sent_total` + +Total number of API notification updates sent. + +- **Type:** counter +- **Unit:** {update} +- **Stability:** development + + +### `prometheus_http_request_duration_seconds` + +Histogram of latencies for HTTP requests. + +- **Type:** histogram +- **Unit:** s +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `handler` | string | The HTTP handler. | /, /-/healthy, /-/ready, /api/v1/query | + + + +### `prometheus_http_requests_total` + +Counter of HTTP requests. + +- **Type:** counter +- **Unit:** {request} +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `code` | string | The HTTP response status code. | 200, 400, 404, 500 | +| `handler` | string | The HTTP handler. | /, /-/healthy, /-/ready, /api/v1/query | + + + +### `prometheus_http_response_size_bytes` + +Histogram of response size for HTTP requests. + +- **Type:** histogram +- **Unit:** By +- **Stability:** development + +#### Attributes + +| Attribute | Type | Description | Examples | +|-----------|------|-------------|----------| +| `handler` | string | The HTTP handler. | /, /-/healthy, /-/ready, /api/v1/query | + + + +### `prometheus_ready` + +Whether Prometheus startup was fully completed and the server is ready for normal operation. + +- **Type:** gauge +- **Unit:** 1 +- **Stability:** development + + +### `prometheus_web_federation_errors_total` + +Total number of errors that occurred while sending federation responses. + +- **Type:** counter +- **Unit:** {error} +- **Stability:** development + + +### `prometheus_web_federation_warnings_total` + +Total number of warnings that occurred while sending federation responses. + +- **Type:** counter +- **Unit:** {warning} +- **Stability:** development diff --git a/web/semconv/metrics.go b/web/semconv/metrics.go new file mode 100644 index 0000000000..dc62be9e95 --- /dev/null +++ b/web/semconv/metrics.go @@ -0,0 +1,334 @@ +// Code generated from semantic convention specification. DO NOT EDIT. + +// Package metrics provides Prometheus instrumentation types for metrics +// defined in this semantic convention registry. +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +// Attribute is an interface for metric label attributes. +type Attribute interface { + ID() string + Value() string +} +type CodeAttr string + +func (a CodeAttr) ID() string { + return "code" +} + +func (a CodeAttr) Value() string { + return string(a) +} + +type HandlerAttr string + +func (a HandlerAttr) ID() string { + return "handler" +} + +func (a HandlerAttr) Value() string { + return string(a) +} + +// PrometheusAPINotificationActiveSubscribers records the current number of active notification subscribers. +type PrometheusAPINotificationActiveSubscribers struct { + *prometheus.GaugeVec +} + +// NewPrometheusAPINotificationActiveSubscribers returns a new PrometheusAPINotificationActiveSubscribers instrument. +func NewPrometheusAPINotificationActiveSubscribers() PrometheusAPINotificationActiveSubscribers { + labels := []string{} + return PrometheusAPINotificationActiveSubscribers{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_api_notification_active_subscribers", + Help: "The current number of active notification subscribers.", + }, labels), + } +} + +type PrometheusAPINotificationActiveSubscribersAttr interface { + Attribute + implPrometheusAPINotificationActiveSubscribers() +} + +func (m PrometheusAPINotificationActiveSubscribers) With( + extra ...PrometheusAPINotificationActiveSubscribersAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusAPINotificationUpdatesDroppedTotal records the total number of API notification updates that were dropped. +type PrometheusAPINotificationUpdatesDroppedTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusAPINotificationUpdatesDroppedTotal returns a new PrometheusAPINotificationUpdatesDroppedTotal instrument. +func NewPrometheusAPINotificationUpdatesDroppedTotal() PrometheusAPINotificationUpdatesDroppedTotal { + labels := []string{} + return PrometheusAPINotificationUpdatesDroppedTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_api_notification_updates_dropped_total", + Help: "Total number of API notification updates that were dropped.", + }, labels), + } +} + +type PrometheusAPINotificationUpdatesDroppedTotalAttr interface { + Attribute + implPrometheusAPINotificationUpdatesDroppedTotal() +} + +func (m PrometheusAPINotificationUpdatesDroppedTotal) With( + extra ...PrometheusAPINotificationUpdatesDroppedTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusAPINotificationUpdatesSentTotal records the total number of API notification updates sent. +type PrometheusAPINotificationUpdatesSentTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusAPINotificationUpdatesSentTotal returns a new PrometheusAPINotificationUpdatesSentTotal instrument. +func NewPrometheusAPINotificationUpdatesSentTotal() PrometheusAPINotificationUpdatesSentTotal { + labels := []string{} + return PrometheusAPINotificationUpdatesSentTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_api_notification_updates_sent_total", + Help: "Total number of API notification updates sent.", + }, labels), + } +} + +type PrometheusAPINotificationUpdatesSentTotalAttr interface { + Attribute + implPrometheusAPINotificationUpdatesSentTotal() +} + +func (m PrometheusAPINotificationUpdatesSentTotal) With( + extra ...PrometheusAPINotificationUpdatesSentTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusHTTPRequestDurationSeconds records the histogram of latencies for HTTP requests. +type PrometheusHTTPRequestDurationSeconds struct { + *prometheus.HistogramVec +} + +// NewPrometheusHTTPRequestDurationSeconds returns a new PrometheusHTTPRequestDurationSeconds instrument. +func NewPrometheusHTTPRequestDurationSeconds() PrometheusHTTPRequestDurationSeconds { + labels := []string{ + "handler", + } + return PrometheusHTTPRequestDurationSeconds{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_http_request_duration_seconds", + Help: "Histogram of latencies for HTTP requests.", + }, labels), + } +} + +type PrometheusHTTPRequestDurationSecondsAttr interface { + Attribute + implPrometheusHTTPRequestDurationSeconds() +} + +func (a HandlerAttr) implPrometheusHTTPRequestDurationSeconds() {} + +func (m PrometheusHTTPRequestDurationSeconds) With( + extra ...PrometheusHTTPRequestDurationSecondsAttr, +) prometheus.Observer { + labels := prometheus.Labels{ + "handler": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusHTTPRequestsTotal records the counter of HTTP requests. +type PrometheusHTTPRequestsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusHTTPRequestsTotal returns a new PrometheusHTTPRequestsTotal instrument. +func NewPrometheusHTTPRequestsTotal() PrometheusHTTPRequestsTotal { + labels := []string{ + "handler", + "code", + } + return PrometheusHTTPRequestsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_http_requests_total", + Help: "Counter of HTTP requests.", + }, labels), + } +} + +type PrometheusHTTPRequestsTotalAttr interface { + Attribute + implPrometheusHTTPRequestsTotal() +} + +func (a HandlerAttr) implPrometheusHTTPRequestsTotal() {} +func (a CodeAttr) implPrometheusHTTPRequestsTotal() {} + +func (m PrometheusHTTPRequestsTotal) With( + extra ...PrometheusHTTPRequestsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{ + "handler": "", + "code": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusHTTPResponseSizeBytes records the histogram of response size for HTTP requests. +type PrometheusHTTPResponseSizeBytes struct { + *prometheus.HistogramVec +} + +// NewPrometheusHTTPResponseSizeBytes returns a new PrometheusHTTPResponseSizeBytes instrument. +func NewPrometheusHTTPResponseSizeBytes() PrometheusHTTPResponseSizeBytes { + labels := []string{ + "handler", + } + return PrometheusHTTPResponseSizeBytes{ + HistogramVec: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Name: "prometheus_http_response_size_bytes", + Help: "Histogram of response size for HTTP requests.", + }, labels), + } +} + +type PrometheusHTTPResponseSizeBytesAttr interface { + Attribute + implPrometheusHTTPResponseSizeBytes() +} + +func (a HandlerAttr) implPrometheusHTTPResponseSizeBytes() {} + +func (m PrometheusHTTPResponseSizeBytes) With( + extra ...PrometheusHTTPResponseSizeBytesAttr, +) prometheus.Observer { + labels := prometheus.Labels{ + "handler": "", + } + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.HistogramVec.With(labels) +} + +// PrometheusReady records the whether Prometheus startup was fully completed and the server is ready for normal operation. +type PrometheusReady struct { + *prometheus.GaugeVec +} + +// NewPrometheusReady returns a new PrometheusReady instrument. +func NewPrometheusReady() PrometheusReady { + labels := []string{} + return PrometheusReady{ + GaugeVec: prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Name: "prometheus_ready", + Help: "Whether Prometheus startup was fully completed and the server is ready for normal operation.", + }, labels), + } +} + +type PrometheusReadyAttr interface { + Attribute + implPrometheusReady() +} + +func (m PrometheusReady) With( + extra ...PrometheusReadyAttr, +) prometheus.Gauge { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.GaugeVec.With(labels) +} + +// PrometheusWebFederationErrorsTotal records the total number of errors that occurred while sending federation responses. +type PrometheusWebFederationErrorsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusWebFederationErrorsTotal returns a new PrometheusWebFederationErrorsTotal instrument. +func NewPrometheusWebFederationErrorsTotal() PrometheusWebFederationErrorsTotal { + labels := []string{} + return PrometheusWebFederationErrorsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_web_federation_errors_total", + Help: "Total number of errors that occurred while sending federation responses.", + }, labels), + } +} + +type PrometheusWebFederationErrorsTotalAttr interface { + Attribute + implPrometheusWebFederationErrorsTotal() +} + +func (m PrometheusWebFederationErrorsTotal) With( + extra ...PrometheusWebFederationErrorsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +} + +// PrometheusWebFederationWarningsTotal records the total number of warnings that occurred while sending federation responses. +type PrometheusWebFederationWarningsTotal struct { + *prometheus.CounterVec +} + +// NewPrometheusWebFederationWarningsTotal returns a new PrometheusWebFederationWarningsTotal instrument. +func NewPrometheusWebFederationWarningsTotal() PrometheusWebFederationWarningsTotal { + labels := []string{} + return PrometheusWebFederationWarningsTotal{ + CounterVec: prometheus.NewCounterVec(prometheus.CounterOpts{ + Name: "prometheus_web_federation_warnings_total", + Help: "Total number of warnings that occurred while sending federation responses.", + }, labels), + } +} + +type PrometheusWebFederationWarningsTotalAttr interface { + Attribute + implPrometheusWebFederationWarningsTotal() +} + +func (m PrometheusWebFederationWarningsTotal) With( + extra ...PrometheusWebFederationWarningsTotalAttr, +) prometheus.Counter { + labels := prometheus.Labels{} + for _, v := range extra { + labels[v.ID()] = v.Value() + } + return m.CounterVec.With(labels) +}