From 3591c060a0c5a392c16039463f6a0ea60d95f192 Mon Sep 17 00:00:00 2001 From: Daniel Jaglowski Date: Wed, 24 May 2023 17:08:00 -0600 Subject: [PATCH] [receiver/postgresql] Remove with/without resource attributes feature gates (#22479) See deleted language in README for context. These gates had reached their intended final stage before removal but were then forgotten for some time. --- .chloggen/postgresql-rm-gates.yaml | 20 + receiver/postgresqlreceiver/README.md | 35 +- receiver/postgresqlreceiver/go.mod | 2 +- .../postgresqlreceiver/integration_test.go | 29 - receiver/postgresqlreceiver/scraper.go | 161 +- receiver/postgresqlreceiver/scraper_test.go | 8 - ...ected_all_without_resource_attributes.yaml | 851 ------- .../testdata/scraper/multiple/expected.yaml | 1997 ++++++++++------- .../testdata/scraper/otel/expected.yaml | 753 ++++--- 9 files changed, 1698 insertions(+), 2158 deletions(-) create mode 100755 .chloggen/postgresql-rm-gates.yaml delete mode 100644 receiver/postgresqlreceiver/testdata/integration/expected_all_without_resource_attributes.yaml diff --git a/.chloggen/postgresql-rm-gates.yaml b/.chloggen/postgresql-rm-gates.yaml new file mode 100755 index 000000000000..b37baaf43509 --- /dev/null +++ b/.chloggen/postgresql-rm-gates.yaml @@ -0,0 +1,20 @@ +# Use this changelog template to create an entry for release notes. +# If your change doesn't affect end users, such as a test fix or a tooling change, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: postgresqlreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove resource attribute feature gates + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [22479] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/receiver/postgresqlreceiver/README.md b/receiver/postgresqlreceiver/README.md index c57cb0f5d377..164f187f59cf 100644 --- a/receiver/postgresqlreceiver/README.md +++ b/receiver/postgresqlreceiver/README.md @@ -26,16 +26,19 @@ The monitoring user must be granted `SELECT` on `pg_stat_database`. ## Configuration The following settings are required to create a database connection: + - `username` - `password` The following settings are optional: + - `endpoint` (default = `localhost:5432`): The endpoint of the postgresql server. Whether using TCP or Unix sockets, this value should be `host:port`. If `transport` is set to `unix`, the endpoint will internally be translated from `host:port` to `/host.s.PGSQL.port` - `transport` (default = `tcp`): The transport protocol being used to connect to postgresql. Available options are `tcp` and `unix`. - `databases` (default = `[]`): The list of databases for which the receiver will attempt to collect statistics. If an empty list is provided, the receiver will attempt to collect statistics for all non-template databases. The following settings are also optional and nested under `tls` to help configure client transport security + - `insecure` (default = `false`): Whether to enable client transport security for the postgresql connection. - `insecure_skip_verify` (default = `true`): Whether to validate server name and certificate if client transport security is enabled. - `cert_file` (default = `$HOME/.postgresql/postgresql.crt`): A cerficate used for client authentication, if necessary. @@ -69,35 +72,3 @@ The full list of settings exposed for this receiver are documented [here](./conf ## Metrics Details about the metrics produced by this receiver can be found in [metadata.yaml](./metadata.yaml) - -[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta -[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib - -### Feature gate configurations - -#### Transition from metrics without "resource_attributes" - -All metrics are being transitioning to moving the metric attributes `table` and `database` to resource attributes `postgresql.table` and `postgresql.database` respectively. This effort is motivated via the resource specification found [in the metrics data model](https://github.com/open-telemetry/opentelemetry-specification/blob/141a3ef0bf1eba0b6d260335bbe0ce7af9387cfc/specification/metrics/data-model.md#resource-attributes-1). - -Eventually the move will be finalized, but there will be a transitional period where metrics will emit with resource attributes behind a feature gate. - -##### Transition Schedule - -1. v0.58.0, August 2022: - - - The version of the metrics receiver with resource attributes will be available via feature gates. - - The old metrics with `table` and `database` metric attributes are deprecated with a warning. - - `receiver.postgresql.emitMetricsWithResourceAttributes` is *disabled* by default. - - `receiver.postgresql.emitMetricsWithoutResourceAttributes` is *enabled* by default. - -2. v0.60.0, September 2022: - - - The new collection method with resource attributes is enabled by default. The old metrics with the `table` and `database` metric attributes is disabled by default. - - `receiver.postgresql.emitMetricsWithResourceAttributes` is *enabled* by default. - - `receiver.postgresql.emitMetricsWithoutResourceAttributes` is *disabled* by default. - -3. v0.62.0, October 2022: - - - The feature gates are removed. - - Metrics collection using resource attributes are always emitted - - Metrics collection using the `database` and `table` metric attributes are no longer available. diff --git a/receiver/postgresqlreceiver/go.mod b/receiver/postgresqlreceiver/go.mod index bff930b25585..aa1b462a96bf 100644 --- a/receiver/postgresqlreceiver/go.mod +++ b/receiver/postgresqlreceiver/go.mod @@ -13,7 +13,6 @@ require ( go.opentelemetry.io/collector/component v0.78.2 go.opentelemetry.io/collector/confmap v0.78.2 go.opentelemetry.io/collector/consumer v0.78.2 - go.opentelemetry.io/collector/featuregate v1.0.0-rcv0012 go.opentelemetry.io/collector/pdata v1.0.0-rcv0012 go.opentelemetry.io/collector/receiver v0.78.2 go.uber.org/multierr v1.11.0 @@ -60,6 +59,7 @@ require ( github.com/stretchr/objx v0.5.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/exporter v0.78.2 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0012 // indirect go.opentelemetry.io/otel v1.15.1 // indirect go.opentelemetry.io/otel/metric v0.38.1 // indirect go.opentelemetry.io/otel/trace v1.15.1 // indirect diff --git a/receiver/postgresqlreceiver/integration_test.go b/receiver/postgresqlreceiver/integration_test.go index 6137e18328f4..a010196f4c4f 100644 --- a/receiver/postgresqlreceiver/integration_test.go +++ b/receiver/postgresqlreceiver/integration_test.go @@ -18,7 +18,6 @@ import ( "github.com/testcontainers/testcontainers-go/wait" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/consumer/consumertest" - "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/receiver/receivertest" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/golden" @@ -82,34 +81,6 @@ func TestPostgreSQLIntegration(t *testing.T) { }, expectedFile: filepath.Join("testdata", "integration", "expected_all_db.yaml"), }, - { - name: "without_resource_attributes", - cfg: func(hostname string) *Config { - require.NoError(t, featuregate.GlobalRegistry().Set( - emitMetricsWithResourceAttributesFeatureGate.ID(), false, - )) - require.NoError(t, featuregate.GlobalRegistry().Set( - emitMetricsWithoutResourceAttributesFeatureGate.ID(), true, - )) - f := NewFactory() - cfg := f.CreateDefaultConfig().(*Config) - cfg.Endpoint = net.JoinHostPort(hostname, "15432") - cfg.Databases = []string{} - cfg.Username = "otelu" - cfg.Password = "otelp" - cfg.Insecure = true - return cfg - }, - cleanup: func() { - require.NoError(t, featuregate.GlobalRegistry().Set( - emitMetricsWithResourceAttributesFeatureGate.ID(), true, - )) - require.NoError(t, featuregate.GlobalRegistry().Set( - emitMetricsWithoutResourceAttributesFeatureGate.ID(), false, - )) - }, - expectedFile: filepath.Join("testdata", "integration", "expected_all_without_resource_attributes.yaml"), - }, } container := getContainer(t, testcontainers.ContainerRequest{ diff --git a/receiver/postgresqlreceiver/scraper.go b/receiver/postgresqlreceiver/scraper.go index 02eee48dcffe..96e8f82fd5d0 100644 --- a/receiver/postgresqlreceiver/scraper.go +++ b/receiver/postgresqlreceiver/scraper.go @@ -10,7 +10,6 @@ import ( "sync" "time" - "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/receiver" @@ -20,34 +19,11 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver/internal/metadata" ) -var ( - emitMetricsWithoutResourceAttributesFeatureGate = featuregate.GlobalRegistry().MustRegister( - "receiver.postgresql.emitMetricsWithoutResourceAttributes", - featuregate.StageAlpha, - featuregate.WithRegisterDescription("Postgresql metrics are transitioning from being reported with identifying metric attributes "+ - "to being identified via resource attributes in order to fit the OpenTelemetry specification. This feature "+ - "gate controls emitting the old metrics without resource attributes. For more details, see: "+ - "https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/postgresqlreceiver/README.md#feature-gate-configurations"), - featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/12960"), - ) - emitMetricsWithResourceAttributesFeatureGate = featuregate.GlobalRegistry().MustRegister( - "receiver.postgresql.emitMetricsWithResourceAttributes", - featuregate.StageBeta, - featuregate.WithRegisterDescription("Postgresql metrics are transitioning from being reported with identifying metric attributes "+ - "to being identified via resource attributes in order to fit the OpenTelemetry specification. This feature "+ - "gate controls emitting the new metrics with resource attributes. For more details, see: "+ - "https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/postgresqlreceiver/README.md#feature-gate-configurations"), - featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/12960"), - ) -) - type postgreSQLScraper struct { - logger *zap.Logger - config *Config - clientFactory postgreSQLClientFactory - mb *metadata.MetricsBuilder - emitMetricsWithoutResourceAttributes bool - emitMetricsWithResourceAttributes bool + logger *zap.Logger + config *Config + clientFactory postgreSQLClientFactory + mb *metadata.MetricsBuilder } type postgreSQLClientFactory interface { @@ -72,12 +48,10 @@ func newPostgreSQLScraper( clientFactory postgreSQLClientFactory, ) *postgreSQLScraper { return &postgreSQLScraper{ - logger: settings.Logger, - config: config, - clientFactory: clientFactory, - mb: metadata.NewMetricsBuilder(config.MetricsBuilderConfig, settings), - emitMetricsWithResourceAttributes: emitMetricsWithResourceAttributesFeatureGate.IsEnabled(), - emitMetricsWithoutResourceAttributes: emitMetricsWithoutResourceAttributesFeatureGate.IsEnabled(), + logger: settings.Logger, + config: config, + clientFactory: clientFactory, + mb: metadata.NewMetricsBuilder(config.MetricsBuilderConfig, settings), } } @@ -128,19 +102,14 @@ func (p *postgreSQLScraper) scrape(ctx context.Context) (pmetric.Metrics, error) numTables := p.collectTables(ctx, now, dbClient, database, &errs) p.recordDatabase(now, database, r, numTables) - - if p.emitMetricsWithResourceAttributes { - p.collectIndexes(ctx, now, dbClient, database, &errs) - } + p.collectIndexes(ctx, now, dbClient, database, &errs) } - if p.emitMetricsWithResourceAttributes { - p.mb.RecordPostgresqlDatabaseCountDataPoint(now, int64(len(databases))) - p.collectBGWriterStats(ctx, now, listClient, &errs) - p.collectWalAge(ctx, now, listClient, &errs) - p.collectReplicationStats(ctx, now, listClient, &errs) - p.collectMaxConnections(ctx, now, listClient, &errs) - } + p.mb.RecordPostgresqlDatabaseCountDataPoint(now, int64(len(databases))) + p.collectBGWriterStats(ctx, now, listClient, &errs) + p.collectWalAge(ctx, now, listClient, &errs) + p.collectReplicationStats(ctx, now, listClient, &errs) + p.collectMaxConnections(ctx, now, listClient, &errs) return p.mb.Emit(), errs.Combine() } @@ -164,31 +133,18 @@ func (p *postgreSQLScraper) retrieveDBMetrics( func (p *postgreSQLScraper) recordDatabase(now pcommon.Timestamp, db string, r *dbRetrieval, numTables int64) { dbName := databaseName(db) - if p.emitMetricsWithResourceAttributes { - p.mb.RecordPostgresqlTableCountDataPoint(now, numTables) - if activeConnections, ok := r.activityMap[dbName]; ok { - p.mb.RecordPostgresqlBackendsDataPointWithoutDatabase(now, activeConnections) - } - if size, ok := r.dbSizeMap[dbName]; ok { - p.mb.RecordPostgresqlDbSizeDataPointWithoutDatabase(now, size) - } - if stats, ok := r.dbStats[dbName]; ok { - p.mb.RecordPostgresqlCommitsDataPointWithoutDatabase(now, stats.transactionCommitted) - p.mb.RecordPostgresqlRollbacksDataPointWithoutDatabase(now, stats.transactionRollback) - } - p.mb.EmitForResource(metadata.WithPostgresqlDatabaseName(db)) - } else { - if activeConnections, ok := r.activityMap[dbName]; ok { - p.mb.RecordPostgresqlBackendsDataPoint(now, activeConnections, db) - } - if size, ok := r.dbSizeMap[dbName]; ok { - p.mb.RecordPostgresqlDbSizeDataPoint(now, size, db) - } - if stats, ok := r.dbStats[dbName]; ok { - p.mb.RecordPostgresqlCommitsDataPoint(now, stats.transactionCommitted, db) - p.mb.RecordPostgresqlRollbacksDataPoint(now, stats.transactionRollback, db) - } + p.mb.RecordPostgresqlTableCountDataPoint(now, numTables) + if activeConnections, ok := r.activityMap[dbName]; ok { + p.mb.RecordPostgresqlBackendsDataPointWithoutDatabase(now, activeConnections) + } + if size, ok := r.dbSizeMap[dbName]; ok { + p.mb.RecordPostgresqlDbSizeDataPointWithoutDatabase(now, size) } + if stats, ok := r.dbStats[dbName]; ok { + p.mb.RecordPostgresqlCommitsDataPointWithoutDatabase(now, stats.transactionCommitted) + p.mb.RecordPostgresqlRollbacksDataPointWithoutDatabase(now, stats.transactionRollback) + } + p.mb.EmitForResource(metadata.WithPostgresqlDatabaseName(db)) } func (p *postgreSQLScraper) collectTables(ctx context.Context, now pcommon.Timestamp, dbClient client, db string, errs *scrapererror.ScrapeErrors) (numTables int64) { @@ -203,51 +159,30 @@ func (p *postgreSQLScraper) collectTables(ctx context.Context, now pcommon.Times } for tableKey, tm := range tableMetrics { - if p.emitMetricsWithResourceAttributes { - p.mb.RecordPostgresqlRowsDataPointWithoutDatabaseAndTable(now, tm.dead, metadata.AttributeStateDead) - p.mb.RecordPostgresqlRowsDataPointWithoutDatabaseAndTable(now, tm.live, metadata.AttributeStateLive) - p.mb.RecordPostgresqlOperationsDataPointWithoutDatabaseAndTable(now, tm.inserts, metadata.AttributeOperationIns) - p.mb.RecordPostgresqlOperationsDataPointWithoutDatabaseAndTable(now, tm.del, metadata.AttributeOperationDel) - p.mb.RecordPostgresqlOperationsDataPointWithoutDatabaseAndTable(now, tm.upd, metadata.AttributeOperationUpd) - p.mb.RecordPostgresqlOperationsDataPointWithoutDatabaseAndTable(now, tm.hotUpd, metadata.AttributeOperationHotUpd) - p.mb.RecordPostgresqlTableSizeDataPoint(now, tm.size) - p.mb.RecordPostgresqlTableVacuumCountDataPoint(now, tm.vacuumCount) - - br, ok := blockReads[tableKey] - if ok { - p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.heapRead, metadata.AttributeSourceHeapRead) - p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.heapHit, metadata.AttributeSourceHeapHit) - p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.idxRead, metadata.AttributeSourceIdxRead) - p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.idxHit, metadata.AttributeSourceIdxHit) - p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.toastHit, metadata.AttributeSourceToastHit) - p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.toastRead, metadata.AttributeSourceToastHit) - p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.tidxRead, metadata.AttributeSourceTidxRead) - p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.tidxHit, metadata.AttributeSourceTidxHit) - } - p.mb.EmitForResource( - metadata.WithPostgresqlDatabaseName(db), - metadata.WithPostgresqlTableName(tm.table), - ) - } else { - p.mb.RecordPostgresqlRowsDataPoint(now, tm.dead, db, tm.table, metadata.AttributeStateDead) - p.mb.RecordPostgresqlRowsDataPoint(now, tm.live, db, tm.table, metadata.AttributeStateLive) - p.mb.RecordPostgresqlOperationsDataPoint(now, tm.inserts, db, tm.table, metadata.AttributeOperationIns) - p.mb.RecordPostgresqlOperationsDataPoint(now, tm.del, db, tm.table, metadata.AttributeOperationDel) - p.mb.RecordPostgresqlOperationsDataPoint(now, tm.upd, db, tm.table, metadata.AttributeOperationUpd) - p.mb.RecordPostgresqlOperationsDataPoint(now, tm.hotUpd, db, tm.table, metadata.AttributeOperationHotUpd) - - br, ok := blockReads[tableKey] - if ok { - p.mb.RecordPostgresqlBlocksReadDataPoint(now, br.heapRead, db, br.table, metadata.AttributeSourceHeapRead) - p.mb.RecordPostgresqlBlocksReadDataPoint(now, br.heapHit, db, br.table, metadata.AttributeSourceHeapHit) - p.mb.RecordPostgresqlBlocksReadDataPoint(now, br.idxRead, db, br.table, metadata.AttributeSourceIdxRead) - p.mb.RecordPostgresqlBlocksReadDataPoint(now, br.idxHit, db, br.table, metadata.AttributeSourceIdxHit) - p.mb.RecordPostgresqlBlocksReadDataPoint(now, br.toastHit, db, br.table, metadata.AttributeSourceToastHit) - p.mb.RecordPostgresqlBlocksReadDataPoint(now, br.toastRead, db, br.table, metadata.AttributeSourceToastRead) - p.mb.RecordPostgresqlBlocksReadDataPoint(now, br.tidxRead, db, br.table, metadata.AttributeSourceTidxRead) - p.mb.RecordPostgresqlBlocksReadDataPoint(now, br.tidxHit, db, br.table, metadata.AttributeSourceTidxHit) - } + p.mb.RecordPostgresqlRowsDataPointWithoutDatabaseAndTable(now, tm.dead, metadata.AttributeStateDead) + p.mb.RecordPostgresqlRowsDataPointWithoutDatabaseAndTable(now, tm.live, metadata.AttributeStateLive) + p.mb.RecordPostgresqlOperationsDataPointWithoutDatabaseAndTable(now, tm.inserts, metadata.AttributeOperationIns) + p.mb.RecordPostgresqlOperationsDataPointWithoutDatabaseAndTable(now, tm.del, metadata.AttributeOperationDel) + p.mb.RecordPostgresqlOperationsDataPointWithoutDatabaseAndTable(now, tm.upd, metadata.AttributeOperationUpd) + p.mb.RecordPostgresqlOperationsDataPointWithoutDatabaseAndTable(now, tm.hotUpd, metadata.AttributeOperationHotUpd) + p.mb.RecordPostgresqlTableSizeDataPoint(now, tm.size) + p.mb.RecordPostgresqlTableVacuumCountDataPoint(now, tm.vacuumCount) + + br, ok := blockReads[tableKey] + if ok { + p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.heapRead, metadata.AttributeSourceHeapRead) + p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.heapHit, metadata.AttributeSourceHeapHit) + p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.idxRead, metadata.AttributeSourceIdxRead) + p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.idxHit, metadata.AttributeSourceIdxHit) + p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.toastHit, metadata.AttributeSourceToastHit) + p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.toastRead, metadata.AttributeSourceToastHit) + p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.tidxRead, metadata.AttributeSourceTidxRead) + p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.tidxHit, metadata.AttributeSourceTidxHit) } + p.mb.EmitForResource( + metadata.WithPostgresqlDatabaseName(db), + metadata.WithPostgresqlTableName(tm.table), + ) } return int64(len(tableMetrics)) } diff --git a/receiver/postgresqlreceiver/scraper_test.go b/receiver/postgresqlreceiver/scraper_test.go index 0f5cd3985fe1..198adad47a2f 100644 --- a/receiver/postgresqlreceiver/scraper_test.go +++ b/receiver/postgresqlreceiver/scraper_test.go @@ -24,8 +24,6 @@ func TestUnsuccessfulScrape(t *testing.T) { cfg.Endpoint = "fake:11111" scraper := newPostgreSQLScraper(receivertest.NewNopCreateSettings(), cfg, &defaultClientFactory{}) - scraper.emitMetricsWithResourceAttributes = false - scraper.emitMetricsWithoutResourceAttributes = true actualMetrics, err := scraper.scrape(context.Background()) require.Error(t, err) @@ -40,8 +38,6 @@ func TestScraper(t *testing.T) { cfg := createDefaultConfig().(*Config) cfg.Databases = []string{"otel"} scraper := newPostgreSQLScraper(receivertest.NewNopCreateSettings(), cfg, factory) - scraper.emitMetricsWithResourceAttributes = false - scraper.emitMetricsWithoutResourceAttributes = true actualMetrics, err := scraper.scrape(context.Background()) require.NoError(t, err) @@ -60,8 +56,6 @@ func TestScraperNoDatabaseSingle(t *testing.T) { cfg := createDefaultConfig().(*Config) scraper := newPostgreSQLScraper(receivertest.NewNopCreateSettings(), cfg, factory) - scraper.emitMetricsWithResourceAttributes = false - scraper.emitMetricsWithoutResourceAttributes = true actualMetrics, err := scraper.scrape(context.Background()) require.NoError(t, err) @@ -80,8 +74,6 @@ func TestScraperNoDatabaseMultiple(t *testing.T) { cfg := createDefaultConfig().(*Config) scraper := newPostgreSQLScraper(receivertest.NewNopCreateSettings(), cfg, &factory) - scraper.emitMetricsWithResourceAttributes = false - scraper.emitMetricsWithoutResourceAttributes = true actualMetrics, err := scraper.scrape(context.Background()) require.NoError(t, err) diff --git a/receiver/postgresqlreceiver/testdata/integration/expected_all_without_resource_attributes.yaml b/receiver/postgresqlreceiver/testdata/integration/expected_all_without_resource_attributes.yaml deleted file mode 100644 index 1f015a6def31..000000000000 --- a/receiver/postgresqlreceiver/testdata/integration/expected_all_without_resource_attributes.yaml +++ /dev/null @@ -1,851 +0,0 @@ -resourceMetrics: - - resource: {} - scopeMetrics: - - metrics: - - description: The number of backends. - name: postgresql.backends - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "3" - attributes: - - key: database - value: - stringValue: postgres - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - unit: "1" - - description: The number of blocks read. - name: postgresql.blocks_read - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source - value: - stringValue: heap_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source - value: - stringValue: heap_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source - value: - stringValue: idx_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source - value: - stringValue: idx_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source - value: - stringValue: toast_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source - value: - stringValue: toast_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source - value: - stringValue: tidx_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source - value: - stringValue: tidx_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: heap_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: heap_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: idx_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: idx_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: toast_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: toast_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: tidx_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: tidx_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: source - value: - stringValue: heap_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: source - value: - stringValue: heap_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: source - value: - stringValue: idx_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: source - value: - stringValue: idx_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: source - value: - stringValue: toast_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: source - value: - stringValue: toast_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: source - value: - stringValue: tidx_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: source - value: - stringValue: tidx_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "1" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: source - value: - stringValue: heap_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "1" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: source - value: - stringValue: heap_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "4" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: source - value: - stringValue: idx_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "2" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: source - value: - stringValue: idx_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: source - value: - stringValue: toast_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: source - value: - stringValue: toast_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: source - value: - stringValue: tidx_read - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: source - value: - stringValue: tidx_hit - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - isMonotonic: true - unit: "1" - - description: The number of commits. - name: postgresql.commits - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "97" - attributes: - - key: database - value: - stringValue: postgres - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "44" - attributes: - - key: database - value: - stringValue: otel - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "29" - attributes: - - key: database - value: - stringValue: otel2 - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - isMonotonic: true - unit: "1" - - description: The database disk usage. - name: postgresql.db_size - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "7223832" - attributes: - - key: database - value: - stringValue: postgres - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "7281176" - attributes: - - key: database - value: - stringValue: otel - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "7322136" - attributes: - - key: database - value: - stringValue: otel2 - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - unit: By - - description: The number of db row operations. - name: postgresql.operations - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: operation - value: - stringValue: ins - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: operation - value: - stringValue: del - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: operation - value: - stringValue: upd - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: operation - value: - stringValue: hot_upd - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: operation - value: - stringValue: ins - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: operation - value: - stringValue: del - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: operation - value: - stringValue: upd - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: operation - value: - stringValue: hot_upd - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: operation - value: - stringValue: ins - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: operation - value: - stringValue: del - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: operation - value: - stringValue: upd - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: operation - value: - stringValue: hot_upd - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "1" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: operation - value: - stringValue: ins - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: operation - value: - stringValue: del - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: operation - value: - stringValue: upd - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: operation - value: - stringValue: hot_upd - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - isMonotonic: true - unit: "1" - - description: The number of rollbacks. - name: postgresql.rollbacks - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "9" - attributes: - - key: database - value: - stringValue: postgres - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - isMonotonic: true - unit: "1" - - description: The number of rows in the database. - name: postgresql.rows - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: state - value: - stringValue: dead - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: state - value: - stringValue: live - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: state - value: - stringValue: dead - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: state - value: - stringValue: live - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: state - value: - stringValue: dead - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test1 - - key: state - value: - stringValue: live - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "0" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: state - value: - stringValue: dead - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - - asInt: "1" - attributes: - - key: database - value: - stringValue: otel2 - - key: table - value: - stringValue: public.test2 - - key: state - value: - stringValue: live - startTimeUnixNano: "1662565944930684000" - timeUnixNano: "1662565954940163000" - unit: "1" - scope: - name: otelcol/postgresqlreceiver - version: latest diff --git a/receiver/postgresqlreceiver/testdata/scraper/multiple/expected.yaml b/receiver/postgresqlreceiver/testdata/scraper/multiple/expected.yaml index 597d1fa15354..5af22cfac754 100644 --- a/receiver/postgresqlreceiver/testdata/scraper/multiple/expected.yaml +++ b/receiver/postgresqlreceiver/testdata/scraper/multiple/expected.yaml @@ -1,1133 +1,1448 @@ resourceMetrics: - - resource: {} + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: otel + - key: postgresql.table.name + value: + stringValue: public.table1 scopeMetrics: - metrics: - - description: The number of backends. - name: postgresql.backends - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "3" - attributes: - - key: database - value: - stringValue: otel - timeUnixNano: "1637261076970522000" - - asInt: "4" - attributes: - - key: database - value: - stringValue: open - timeUnixNano: "1637261076970522000" - - asInt: "5" - attributes: - - key: database - value: - stringValue: telemetry - timeUnixNano: "1637261076970522000" - unit: "1" - description: The number of blocks read. name: postgresql.blocks_read sum: aggregationTemporality: 2 dataPoints: - - asInt: "20" + - asInt: "19" attributes: - - key: database - value: - stringValue: otel - - key: table + - key: source value: - stringValue: public.table1 + stringValue: heap_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "20" + attributes: - key: source value: stringValue: heap_hit - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "21" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: stringValue: idx_read - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "22" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: stringValue: idx_hit - timeUnixNano: "1637261076970522000" - - asInt: "23" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "24" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: - stringValue: toast_read - timeUnixNano: "1637261076970522000" - - asInt: "24" + stringValue: toast_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "23" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: stringValue: toast_hit - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "25" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: stringValue: tidx_read - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "26" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: stringValue: tidx_hit - timeUnixNano: "1637261076970522000" - - asInt: "19" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The number of db row operations. + name: postgresql.operations + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "39" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source + - key: operation value: - stringValue: heap_read - timeUnixNano: "1637261076970522000" - - asInt: "31" + stringValue: ins + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "41" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source + - key: operation value: - stringValue: toast_read - timeUnixNano: "1637261076970522000" - - asInt: "32" + stringValue: del + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "40" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source + - key: operation value: - stringValue: toast_hit - timeUnixNano: "1637261076970522000" - - asInt: "33" + stringValue: upd + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "42" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source + - key: operation value: - stringValue: tidx_read - timeUnixNano: "1637261076970522000" - - asInt: "34" + stringValue: hot_upd + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The number of rows in the database. + name: postgresql.rows + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "8" attributes: - - key: database - value: - stringValue: otel - - key: table + - key: state value: - stringValue: public.table2 - - key: source + stringValue: dead + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "7" + attributes: + - key: state value: - stringValue: tidx_hit - timeUnixNano: "1637261076970522000" + stringValue: live + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: "1" + - description: Disk space used by a table. + name: postgresql.table.size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "43" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: By + - description: Number of times a table has manually been vacuumed. + name: postgresql.table.vacuum.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "44" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{vacuums}' + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: otel + - key: postgresql.table.name + value: + stringValue: public.table2 + scopeMetrics: + - metrics: + - description: The number of blocks read. + name: postgresql.blocks_read + sum: + aggregationTemporality: 2 + dataPoints: - asInt: "27" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: heap_read - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "28" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: heap_hit - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "29" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: idx_read - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "30" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: source - value: - stringValue: idx_hit - timeUnixNano: "1637261076970522000" - - asInt: "21" - attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: heap_hit - timeUnixNano: "1637261076970522000" - - asInt: "22" - attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: idx_read - timeUnixNano: "1637261076970522000" - - asInt: "23" - attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - key: source value: stringValue: idx_hit - timeUnixNano: "1637261076970522000" - - asInt: "24" - attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: toast_read - timeUnixNano: "1637261076970522000" - - asInt: "25" - attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: toast_hit - timeUnixNano: "1637261076970522000" - - asInt: "26" - attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: tidx_read - timeUnixNano: "1637261076970522000" - - asInt: "27" - attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: tidx_hit - timeUnixNano: "1637261076970522000" - - asInt: "20" - attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: heap_read - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "32" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - key: source value: - stringValue: toast_read - timeUnixNano: "1637261076970522000" - - asInt: "33" + stringValue: toast_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "31" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: toast_hit - timeUnixNano: "1637261076970522000" - - asInt: "34" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "33" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: tidx_read - timeUnixNano: "1637261076970522000" - - asInt: "35" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "34" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: tidx_hit - timeUnixNano: "1637261076970522000" - - asInt: "28" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The number of db row operations. + name: postgresql.operations + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "43" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - - key: source + - key: operation value: - stringValue: heap_read - timeUnixNano: "1637261076970522000" - - asInt: "29" + stringValue: ins + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "45" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - - key: source + - key: operation value: - stringValue: heap_hit - timeUnixNano: "1637261076970522000" - - asInt: "30" + stringValue: del + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "44" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - - key: source + - key: operation value: - stringValue: idx_read - timeUnixNano: "1637261076970522000" - - asInt: "31" + stringValue: upd + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "46" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - - key: source + - key: operation value: - stringValue: idx_hit - timeUnixNano: "1637261076970522000" - - asInt: "25" + stringValue: hot_upd + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The number of rows in the database. + name: postgresql.rows + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "10" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - - key: source + - key: state value: - stringValue: toast_read - timeUnixNano: "1637261076970522000" - - asInt: "26" + stringValue: dead + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "9" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - - key: source + - key: state value: - stringValue: toast_hit - timeUnixNano: "1637261076970522000" - - asInt: "27" - attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: tidx_read - timeUnixNano: "1637261076970522000" - - asInt: "28" + stringValue: live + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: "1" + - description: Disk space used by a table. + name: postgresql.table.size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "47" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: By + - description: Number of times a table has manually been vacuumed. + name: postgresql.table.vacuum.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "48" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{vacuums}' + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: otel + scopeMetrics: + - metrics: + - description: The number of backends. + name: postgresql.backends + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "3" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: "1" + - description: The number of commits. + name: postgresql.commits + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "1" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The database disk usage. + name: postgresql.db_size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "4" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: By + - description: The number of rollbacks. + name: postgresql.rollbacks + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "2" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: Number of user tables in a database. + name: postgresql.table.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "2" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: otel + - key: postgresql.table.name + value: + stringValue: public.table1 + - key: postgresql.index.name + value: + stringValue: otel_test1_pkey + scopeMetrics: + - metrics: + - description: The number of index scans on a table. + name: postgresql.index.scans + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "35" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{scans}' + - description: The size of the index on disk. + gauge: + dataPoints: + - asInt: "36" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + name: postgresql.index.size + unit: By + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: otel + - key: postgresql.table.name + value: + stringValue: public.table2 + - key: postgresql.index.name + value: + stringValue: otel_test2_pkey + scopeMetrics: + - metrics: + - description: The number of index scans on a table. + name: postgresql.index.scans + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "37" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{scans}' + - description: The size of the index on disk. + gauge: + dataPoints: + - asInt: "38" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + name: postgresql.index.size + unit: By + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: open + - key: postgresql.table.name + value: + stringValue: public.table1 + scopeMetrics: + - metrics: + - description: The number of blocks read. + name: postgresql.blocks_read + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "20" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - key: source value: - stringValue: tidx_hit - timeUnixNano: "1637261076970522000" + stringValue: heap_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "21" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - key: source value: - stringValue: heap_read - timeUnixNano: "1637261076970522000" + stringValue: heap_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "22" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - key: source value: - stringValue: heap_hit - timeUnixNano: "1637261076970522000" + stringValue: idx_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "23" attributes: - - key: database - value: - stringValue: telemetry - - key: table + - key: source value: - stringValue: public.table1 + stringValue: idx_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "25" + attributes: - key: source value: - stringValue: idx_read - timeUnixNano: "1637261076970522000" + stringValue: toast_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "24" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - key: source value: - stringValue: idx_hit - timeUnixNano: "1637261076970522000" - - asInt: "35" + stringValue: toast_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "26" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: tidx_read - timeUnixNano: "1637261076970522000" - - asInt: "36" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "27" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: tidx_hit - timeUnixNano: "1637261076970522000" - - asInt: "29" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The number of db row operations. + name: postgresql.operations + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "40" attributes: - - key: database + - key: operation value: - stringValue: telemetry - - key: table + stringValue: ins + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "42" + attributes: + - key: operation value: - stringValue: public.table2 - - key: source + stringValue: del + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "41" + attributes: + - key: operation value: - stringValue: heap_read - timeUnixNano: "1637261076970522000" - - asInt: "30" + stringValue: upd + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "43" attributes: - - key: database + - key: operation value: - stringValue: telemetry - - key: table + stringValue: hot_upd + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The number of rows in the database. + name: postgresql.rows + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "9" + attributes: + - key: state value: - stringValue: public.table2 - - key: source + stringValue: dead + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "8" + attributes: + - key: state value: - stringValue: heap_hit - timeUnixNano: "1637261076970522000" - - asInt: "31" + stringValue: live + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: "1" + - description: Disk space used by a table. + name: postgresql.table.size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "44" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: By + - description: Number of times a table has manually been vacuumed. + name: postgresql.table.vacuum.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "45" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{vacuums}' + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: open + - key: postgresql.table.name + value: + stringValue: public.table2 + scopeMetrics: + - metrics: + - description: The number of blocks read. + name: postgresql.blocks_read + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "28" attributes: - - key: database + - key: source value: - stringValue: telemetry - - key: table + stringValue: heap_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "29" + attributes: + - key: source value: - stringValue: public.table2 + stringValue: heap_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "30" + attributes: - key: source value: stringValue: idx_read - timeUnixNano: "1637261076970522000" - - asInt: "32" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "31" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: idx_hit - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "33" attributes: - - key: database - value: - stringValue: telemetry - - key: table + - key: source value: - stringValue: public.table2 + stringValue: toast_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "32" + attributes: - key: source value: - stringValue: toast_read - timeUnixNano: "1637261076970522000" + stringValue: toast_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "34" attributes: - - key: database - value: - stringValue: telemetry - - key: table + - key: source value: - stringValue: public.table2 + stringValue: tidx_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "35" + attributes: - key: source value: - stringValue: toast_hit - timeUnixNano: "1637261076970522000" + stringValue: tidx_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" isMonotonic: true unit: "1" - - description: The number of commits. - name: postgresql.commits + - description: The number of db row operations. + name: postgresql.operations sum: aggregationTemporality: 2 dataPoints: - - asInt: "1" + - asInt: "44" attributes: - - key: database + - key: operation value: - stringValue: otel - timeUnixNano: "1637261076970522000" - - asInt: "2" + stringValue: ins + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "46" + attributes: + - key: operation + value: + stringValue: del + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "45" attributes: - - key: database + - key: operation value: - stringValue: open - timeUnixNano: "1637261076970522000" - - asInt: "3" + stringValue: upd + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "47" attributes: - - key: database + - key: operation value: - stringValue: telemetry - timeUnixNano: "1637261076970522000" + stringValue: hot_upd + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" isMonotonic: true unit: "1" - - description: The database disk usage. - name: postgresql.db_size + - description: The number of rows in the database. + name: postgresql.rows sum: aggregationTemporality: 2 dataPoints: - - asInt: "4" - attributes: - - key: database - value: - stringValue: otel - timeUnixNano: "1637261076970522000" - - asInt: "5" + - asInt: "11" attributes: - - key: database + - key: state value: - stringValue: open - timeUnixNano: "1637261076970522000" - - asInt: "6" + stringValue: dead + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "10" attributes: - - key: database + - key: state value: - stringValue: telemetry - timeUnixNano: "1637261076970522000" + stringValue: live + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: "1" + - description: Disk space used by a table. + name: postgresql.table.size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "48" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" unit: By - - description: The number of db row operations. - name: postgresql.operations + - description: Number of times a table has manually been vacuumed. + name: postgresql.table.vacuum.count sum: aggregationTemporality: 2 + dataPoints: + - asInt: "49" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{vacuums}' + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: open + scopeMetrics: + - metrics: + - description: The number of backends. + name: postgresql.backends + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "4" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: "1" + - description: The number of commits. + name: postgresql.commits + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "2" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The database disk usage. + name: postgresql.db_size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "5" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: By + - description: The number of rollbacks. + name: postgresql.rollbacks + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "3" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: Number of user tables in a database. + name: postgresql.table.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "2" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: open + - key: postgresql.table.name + value: + stringValue: public.table1 + - key: postgresql.index.name + value: + stringValue: open_test1_pkey + scopeMetrics: + - metrics: + - description: The number of index scans on a table. + name: postgresql.index.scans + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "36" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{scans}' + - description: The size of the index on disk. + gauge: + dataPoints: + - asInt: "37" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + name: postgresql.index.size + unit: By + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: open + - key: postgresql.table.name + value: + stringValue: public.table2 + - key: postgresql.index.name + value: + stringValue: open_test2_pkey + scopeMetrics: + - metrics: + - description: The number of index scans on a table. + name: postgresql.index.scans + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "38" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{scans}' + - description: The size of the index on disk. + gauge: dataPoints: - asInt: "39" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + name: postgresql.index.size + unit: By + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: telemetry + - key: postgresql.table.name + value: + stringValue: public.table1 + scopeMetrics: + - metrics: + - description: The number of blocks read. + name: postgresql.blocks_read + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "21" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: operation + - key: source value: - stringValue: ins - timeUnixNano: "1637261076970522000" - - asInt: "40" + stringValue: heap_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "22" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: operation + - key: source value: - stringValue: upd - timeUnixNano: "1637261076970522000" - - asInt: "41" + stringValue: heap_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "23" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: operation + - key: source value: - stringValue: del - timeUnixNano: "1637261076970522000" - - asInt: "42" + stringValue: idx_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "24" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: operation + - key: source value: - stringValue: hot_upd - timeUnixNano: "1637261076970522000" - - asInt: "43" + stringValue: idx_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "26" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: operation + - key: source value: - stringValue: ins - timeUnixNano: "1637261076970522000" - - asInt: "44" + stringValue: toast_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "25" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: operation + - key: source value: - stringValue: upd - timeUnixNano: "1637261076970522000" - - asInt: "45" + stringValue: toast_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "27" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: operation + - key: source value: - stringValue: del - timeUnixNano: "1637261076970522000" - - asInt: "46" + stringValue: tidx_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "28" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: operation + - key: source value: - stringValue: hot_upd - timeUnixNano: "1637261076970522000" - - asInt: "40" + stringValue: tidx_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The number of db row operations. + name: postgresql.operations + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "41" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - key: operation value: stringValue: ins - timeUnixNano: "1637261076970522000" - - asInt: "41" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "43" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - key: operation value: - stringValue: upd - timeUnixNano: "1637261076970522000" + stringValue: del + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "42" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - key: operation value: - stringValue: del - timeUnixNano: "1637261076970522000" - - asInt: "43" + stringValue: upd + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "44" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - key: operation value: stringValue: hot_upd - timeUnixNano: "1637261076970522000" - - asInt: "44" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The number of rows in the database. + name: postgresql.rows + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "10" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - - key: operation + - key: state value: - stringValue: ins - timeUnixNano: "1637261076970522000" - - asInt: "45" + stringValue: dead + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "9" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - - key: operation + - key: state value: - stringValue: upd - timeUnixNano: "1637261076970522000" + stringValue: live + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: "1" + - description: Disk space used by a table. + name: postgresql.table.size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "45" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: By + - description: Number of times a table has manually been vacuumed. + name: postgresql.table.vacuum.count + sum: + aggregationTemporality: 2 + dataPoints: - asInt: "46" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{vacuums}' + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: telemetry + - key: postgresql.table.name + value: + stringValue: public.table2 + scopeMetrics: + - metrics: + - description: The number of blocks read. + name: postgresql.blocks_read + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "29" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - - key: operation + - key: source value: - stringValue: del - timeUnixNano: "1637261076970522000" - - asInt: "47" + stringValue: heap_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "30" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - - key: operation + - key: source value: - stringValue: hot_upd - timeUnixNano: "1637261076970522000" - - asInt: "41" + stringValue: heap_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "31" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - - key: operation + - key: source value: - stringValue: ins - timeUnixNano: "1637261076970522000" - - asInt: "42" + stringValue: idx_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "32" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - - key: operation + - key: source value: - stringValue: upd - timeUnixNano: "1637261076970522000" - - asInt: "43" + stringValue: idx_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "34" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - - key: operation + - key: source value: - stringValue: del - timeUnixNano: "1637261076970522000" - - asInt: "44" + stringValue: toast_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "33" attributes: - - key: database + - key: source value: - stringValue: telemetry - - key: table + stringValue: toast_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "35" + attributes: + - key: source value: - stringValue: public.table1 - - key: operation + stringValue: tidx_read + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "36" + attributes: + - key: source value: - stringValue: hot_upd - timeUnixNano: "1637261076970522000" + stringValue: tidx_hit + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The number of db row operations. + name: postgresql.operations + sum: + aggregationTemporality: 2 + dataPoints: - asInt: "45" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table2 - key: operation value: stringValue: ins - timeUnixNano: "1637261076970522000" - - asInt: "46" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "47" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table2 - key: operation value: - stringValue: upd - timeUnixNano: "1637261076970522000" - - asInt: "47" + stringValue: del + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "46" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table2 - key: operation value: - stringValue: del - timeUnixNano: "1637261076970522000" + stringValue: upd + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "48" attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table2 - key: operation value: stringValue: hot_upd - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" isMonotonic: true unit: "1" - - description: The number of rollbacks. - name: postgresql.rollbacks + - description: The number of rows in the database. + name: postgresql.rows sum: aggregationTemporality: 2 dataPoints: - - asInt: "2" + - asInt: "12" attributes: - - key: database + - key: state value: - stringValue: otel - timeUnixNano: "1637261076970522000" - - asInt: "3" + stringValue: dead + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "11" attributes: - - key: database + - key: state value: - stringValue: open - timeUnixNano: "1637261076970522000" + stringValue: live + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: "1" + - description: Disk space used by a table. + name: postgresql.table.size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "49" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: By + - description: Number of times a table has manually been vacuumed. + name: postgresql.table.vacuum.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "50" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{vacuums}' + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: telemetry + scopeMetrics: + - metrics: + - description: The number of backends. + name: postgresql.backends + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "5" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: "1" + - description: The number of commits. + name: postgresql.commits + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "3" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: "1" + - description: The database disk usage. + name: postgresql.db_size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "6" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: By + - description: The number of rollbacks. + name: postgresql.rollbacks + sum: + aggregationTemporality: 2 + dataPoints: - asInt: "4" - attributes: - - key: database - value: - stringValue: telemetry - timeUnixNano: "1637261076970522000" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" isMonotonic: true unit: "1" - - description: The number of rows in the database. - name: postgresql.rows + - description: Number of user tables in a database. + name: postgresql.table.count sum: aggregationTemporality: 2 dataPoints: - - asInt: "7" + - asInt: "2" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: telemetry + - key: postgresql.table.name + value: + stringValue: public.table2 + - key: postgresql.index.name + value: + stringValue: telemetry_test2_pkey + scopeMetrics: + - metrics: + - description: The number of index scans on a table. + name: postgresql.index.scans + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "39" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{scans}' + - description: The size of the index on disk. + gauge: + dataPoints: + - asInt: "40" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + name: postgresql.index.size + unit: By + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: telemetry + - key: postgresql.table.name + value: + stringValue: public.table1 + - key: postgresql.index.name + value: + stringValue: telemetry_test1_pkey + scopeMetrics: + - metrics: + - description: The number of index scans on a table. + name: postgresql.index.scans + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "37" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{scans}' + - description: The size of the index on disk. + gauge: + dataPoints: + - asInt: "38" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + name: postgresql.index.size + unit: By + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: [] + scopeMetrics: + - metrics: + - description: Number of buffers allocated. + name: postgresql.bgwriter.buffers.allocated + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "10" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{buffers}' + - description: Number of buffers written. + name: postgresql.bgwriter.buffers.writes + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "5" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: state + - key: source value: - stringValue: live - timeUnixNano: "1637261076970522000" - - asInt: "8" + stringValue: bgwriter + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "7" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: state + - key: source value: - stringValue: dead - timeUnixNano: "1637261076970522000" + stringValue: backend + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "9" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: state - value: - stringValue: live - timeUnixNano: "1637261076970522000" - - asInt: "10" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: state + - key: source value: - stringValue: dead - timeUnixNano: "1637261076970522000" + stringValue: checkpoints + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" - asInt: "8" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table1 - - key: state + - key: source value: - stringValue: live - timeUnixNano: "1637261076970522000" - - asInt: "9" + stringValue: backend_fsync + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{buffers}' + - description: The number of checkpoints performed. + name: postgresql.bgwriter.checkpoint.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "1" attributes: - - key: database - value: - stringValue: open - - key: table + - key: type value: - stringValue: public.table1 - - key: state - value: - stringValue: dead - timeUnixNano: "1637261076970522000" - - asInt: "10" + stringValue: requested + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "2" attributes: - - key: database - value: - stringValue: open - - key: table - value: - stringValue: public.table2 - - key: state + - key: type value: - stringValue: live - timeUnixNano: "1637261076970522000" - - asInt: "11" + stringValue: scheduled + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: '{checkpoints}' + - description: Total time spent writing and syncing files to disk by checkpoints. + name: postgresql.bgwriter.duration + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 4.23 attributes: - - key: database - value: - stringValue: open - - key: table + - key: type value: - stringValue: public.table2 - - key: state - value: - stringValue: dead - timeUnixNano: "1637261076970522000" - - asInt: "9" + stringValue: sync + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asDouble: 3.12 attributes: - - key: database - value: - stringValue: telemetry - - key: table - value: - stringValue: public.table1 - - key: state + - key: type value: - stringValue: live - timeUnixNano: "1637261076970522000" - - asInt: "10" + stringValue: write + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + unit: ms + - description: Number of times the background writer stopped a cleaning scan because it had written too many buffers. + name: postgresql.bgwriter.maxwritten + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "11" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + isMonotonic: true + - description: Configured maximum number of client connections allowed + gauge: + dataPoints: + - asInt: "100" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + name: postgresql.connection.max + unit: '{connections}' + - description: Number of user databases. + name: postgresql.database.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "3" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + unit: '{databases}' + - description: The amount of data delayed in replication. + gauge: + dataPoints: + - asInt: "1024" attributes: - - key: database + - key: replication_client value: - stringValue: telemetry - - key: table + stringValue: unix + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + name: postgresql.replication.data_delay + unit: By + - description: Age of the oldest WAL file. + gauge: + dataPoints: + - asInt: "3600" + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + name: postgresql.wal.age + unit: s + - description: Time between flushing recent WAL locally and receiving notification that the standby server has completed an operation with it. + gauge: + dataPoints: + - asInt: "800" + attributes: + - key: operation value: - stringValue: public.table1 - - key: state + stringValue: write + - key: replication_client value: - stringValue: dead - timeUnixNano: "1637261076970522000" - - asInt: "11" + stringValue: unix + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "700" attributes: - - key: database - value: - stringValue: telemetry - - key: table + - key: operation value: - stringValue: public.table2 - - key: state + stringValue: replay + - key: replication_client value: - stringValue: live - timeUnixNano: "1637261076970522000" - - asInt: "12" + stringValue: unix + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + - asInt: "600" attributes: - - key: database + - key: operation value: - stringValue: telemetry - - key: table + stringValue: flush + - key: replication_client value: - stringValue: public.table2 - - key: state - value: - stringValue: dead - timeUnixNano: "1637261076970522000" - unit: "1" + stringValue: unix + startTimeUnixNano: "1684786281207476000" + timeUnixNano: "1684786281207521000" + name: postgresql.wal.lag + unit: s scope: name: otelcol/postgresqlreceiver version: latest diff --git a/receiver/postgresqlreceiver/testdata/scraper/otel/expected.yaml b/receiver/postgresqlreceiver/testdata/scraper/otel/expected.yaml index 17f384f56fb5..cd4de99fe2c5 100644 --- a/receiver/postgresqlreceiver/testdata/scraper/otel/expected.yaml +++ b/receiver/postgresqlreceiver/testdata/scraper/otel/expected.yaml @@ -1,413 +1,600 @@ resourceMetrics: - - resource: {} + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: otel + - key: postgresql.table.name + value: + stringValue: public.table1 scopeMetrics: - metrics: - - description: The number of backends. - name: postgresql.backends - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "3" - attributes: - - key: database - value: - stringValue: otel - timeUnixNano: "1637261076898397000" - unit: "1" - description: The number of blocks read. name: postgresql.blocks_read sum: aggregationTemporality: 2 dataPoints: - - asInt: "24" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: toast_hit - timeUnixNano: "1637261076898397000" - - asInt: "25" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: tidx_read - timeUnixNano: "1637261076898397000" - - asInt: "26" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: source - value: - stringValue: tidx_hit - timeUnixNano: "1637261076898397000" - asInt: "19" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: stringValue: heap_read - timeUnixNano: "1637261076898397000" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" - asInt: "20" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: stringValue: heap_hit - timeUnixNano: "1637261076898397000" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" - asInt: "21" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: stringValue: idx_read - timeUnixNano: "1637261076898397000" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" - asInt: "22" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: stringValue: idx_hit - timeUnixNano: "1637261076898397000" - - asInt: "23" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "24" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: source value: - stringValue: toast_read - timeUnixNano: "1637261076898397000" - - asInt: "32" + stringValue: toast_hit + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "23" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: toast_hit - timeUnixNano: "1637261076898397000" - - asInt: "33" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "25" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: tidx_read - timeUnixNano: "1637261076898397000" - - asInt: "34" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "26" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: tidx_hit - timeUnixNano: "1637261076898397000" - - asInt: "27" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: "1" + - description: The number of db row operations. + name: postgresql.operations + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "39" attributes: - - key: database + - key: operation value: - stringValue: otel - - key: table + stringValue: ins + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "41" + attributes: + - key: operation value: - stringValue: public.table2 + stringValue: del + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "40" + attributes: + - key: operation + value: + stringValue: upd + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "42" + attributes: + - key: operation + value: + stringValue: hot_upd + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: "1" + - description: The number of rows in the database. + name: postgresql.rows + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "8" + attributes: + - key: state + value: + stringValue: dead + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "7" + attributes: + - key: state + value: + stringValue: live + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + unit: "1" + - description: Disk space used by a table. + name: postgresql.table.size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "43" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + unit: By + - description: Number of times a table has manually been vacuumed. + name: postgresql.table.vacuum.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "44" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: '{vacuums}' + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: otel + - key: postgresql.table.name + value: + stringValue: public.table2 + scopeMetrics: + - metrics: + - description: The number of blocks read. + name: postgresql.blocks_read + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "27" + attributes: - key: source value: stringValue: heap_read - timeUnixNano: "1637261076898397000" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" - asInt: "28" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: heap_hit - timeUnixNano: "1637261076898397000" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" - asInt: "29" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: idx_read - timeUnixNano: "1637261076898397000" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" - asInt: "30" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: source value: stringValue: idx_hit - timeUnixNano: "1637261076898397000" - - asInt: "31" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "32" attributes: - - key: database + - key: source value: - stringValue: otel - - key: table + stringValue: toast_hit + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "31" + attributes: + - key: source value: - stringValue: public.table2 + stringValue: toast_hit + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "33" + attributes: - key: source value: - stringValue: toast_read - timeUnixNano: "1637261076898397000" - isMonotonic: true - unit: "1" - - description: The number of commits. - name: postgresql.commits - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "1" + stringValue: tidx_read + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "34" attributes: - - key: database + - key: source value: - stringValue: otel - timeUnixNano: "1637261076898397000" + stringValue: tidx_hit + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" isMonotonic: true unit: "1" - - description: The database disk usage. - name: postgresql.db_size - sum: - aggregationTemporality: 2 - dataPoints: - - asInt: "4" - attributes: - - key: database - value: - stringValue: otel - timeUnixNano: "1637261076898397000" - unit: By - description: The number of db row operations. name: postgresql.operations sum: aggregationTemporality: 2 dataPoints: - - asInt: "39" + - asInt: "43" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: operation value: stringValue: ins - timeUnixNano: "1637261076898397000" - - asInt: "40" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: operation - value: - stringValue: upd - timeUnixNano: "1637261076898397000" - - asInt: "41" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "45" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - key: operation value: stringValue: del - timeUnixNano: "1637261076898397000" - - asInt: "42" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table1 - - key: operation - value: - stringValue: hot_upd - timeUnixNano: "1637261076898397000" - - asInt: "43" - attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - - key: operation - value: - stringValue: ins - timeUnixNano: "1637261076898397000" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" - asInt: "44" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: operation value: stringValue: upd - timeUnixNano: "1637261076898397000" - - asInt: "45" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "46" attributes: - - key: database - value: - stringValue: otel - - key: table - value: - stringValue: public.table2 - key: operation value: - stringValue: del - timeUnixNano: "1637261076898397000" - - asInt: "46" + stringValue: hot_upd + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: "1" + - description: The number of rows in the database. + name: postgresql.rows + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "10" attributes: - - key: database - value: - stringValue: otel - - key: table + - key: state value: - stringValue: public.table2 - - key: operation + stringValue: dead + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "9" + attributes: + - key: state value: - stringValue: hot_upd - timeUnixNano: "1637261076898397000" + stringValue: live + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + unit: "1" + - description: Disk space used by a table. + name: postgresql.table.size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "47" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + unit: By + - description: Number of times a table has manually been vacuumed. + name: postgresql.table.vacuum.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "48" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" isMonotonic: true + unit: '{vacuums}' + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: otel + scopeMetrics: + - metrics: + - description: The number of backends. + name: postgresql.backends + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "3" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" unit: "1" + - description: The number of commits. + name: postgresql.commits + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "1" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: "1" + - description: The database disk usage. + name: postgresql.db_size + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "4" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + unit: By - description: The number of rollbacks. name: postgresql.rollbacks sum: aggregationTemporality: 2 dataPoints: - asInt: "2" - attributes: - - key: database - value: - stringValue: otel - timeUnixNano: "1637261076898397000" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" isMonotonic: true unit: "1" - - description: The number of rows in the database. - name: postgresql.rows + - description: Number of user tables in a database. + name: postgresql.table.count sum: aggregationTemporality: 2 dataPoints: - - asInt: "7" + - asInt: "2" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: otel + - key: postgresql.table.name + value: + stringValue: public.table1 + - key: postgresql.index.name + value: + stringValue: otel_test1_pkey + scopeMetrics: + - metrics: + - description: The number of index scans on a table. + name: postgresql.index.scans + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "35" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: '{scans}' + - description: The size of the index on disk. + gauge: + dataPoints: + - asInt: "36" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + name: postgresql.index.size + unit: By + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: + - key: postgresql.database.name + value: + stringValue: otel + - key: postgresql.table.name + value: + stringValue: public.table2 + - key: postgresql.index.name + value: + stringValue: otel_test2_pkey + scopeMetrics: + - metrics: + - description: The number of index scans on a table. + name: postgresql.index.scans + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "37" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: '{scans}' + - description: The size of the index on disk. + gauge: + dataPoints: + - asInt: "38" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + name: postgresql.index.size + unit: By + scope: + name: otelcol/postgresqlreceiver + version: latest + - resource: + attributes: [] + scopeMetrics: + - metrics: + - description: Number of buffers allocated. + name: postgresql.bgwriter.buffers.allocated + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "10" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: '{buffers}' + - description: Number of buffers written. + name: postgresql.bgwriter.buffers.writes + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "5" attributes: - - key: database + - key: source value: - stringValue: otel - - key: table + stringValue: bgwriter + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "7" + attributes: + - key: source value: - stringValue: public.table1 - - key: state + stringValue: backend + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "9" + attributes: + - key: source value: - stringValue: live - timeUnixNano: "1637261076898397000" + stringValue: checkpoints + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" - asInt: "8" attributes: - - key: database + - key: source value: - stringValue: otel - - key: table + stringValue: backend_fsync + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: '{buffers}' + - description: The number of checkpoints performed. + name: postgresql.bgwriter.checkpoint.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "1" + attributes: + - key: type value: - stringValue: public.table1 - - key: state + stringValue: requested + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "2" + attributes: + - key: type value: - stringValue: dead - timeUnixNano: "1637261076898397000" - - asInt: "9" + stringValue: scheduled + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: '{checkpoints}' + - description: Total time spent writing and syncing files to disk by checkpoints. + name: postgresql.bgwriter.duration + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 4.23 attributes: - - key: database + - key: type value: - stringValue: otel - - key: table + stringValue: sync + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asDouble: 3.12 + attributes: + - key: type value: - stringValue: public.table2 - - key: state + stringValue: write + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + unit: ms + - description: Number of times the background writer stopped a cleaning scan because it had written too many buffers. + name: postgresql.bgwriter.maxwritten + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "11" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + isMonotonic: true + - description: Configured maximum number of client connections allowed + gauge: + dataPoints: + - asInt: "100" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + name: postgresql.connection.max + unit: '{connections}' + - description: Number of user databases. + name: postgresql.database.count + sum: + aggregationTemporality: 2 + dataPoints: + - asInt: "1" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + unit: '{databases}' + - description: The amount of data delayed in replication. + gauge: + dataPoints: + - asInt: "1024" + attributes: + - key: replication_client value: - stringValue: live - timeUnixNano: "1637261076898397000" - - asInt: "10" + stringValue: unix + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + name: postgresql.replication.data_delay + unit: By + - description: Age of the oldest WAL file. + gauge: + dataPoints: + - asInt: "3600" + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + name: postgresql.wal.age + unit: s + - description: Time between flushing recent WAL locally and receiving notification that the standby server has completed an operation with it. + gauge: + dataPoints: + - asInt: "800" attributes: - - key: database + - key: operation value: - stringValue: otel - - key: table + stringValue: write + - key: replication_client value: - stringValue: public.table2 - - key: state + stringValue: unix + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "700" + attributes: + - key: operation value: - stringValue: dead - timeUnixNano: "1637261076898397000" - unit: "1" + stringValue: replay + - key: replication_client + value: + stringValue: unix + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + - asInt: "600" + attributes: + - key: operation + value: + stringValue: flush + - key: replication_client + value: + stringValue: unix + startTimeUnixNano: "1684786281201767000" + timeUnixNano: "1684786281201820000" + name: postgresql.wal.lag + unit: s scope: name: otelcol/postgresqlreceiver version: latest