diff --git a/internal/signalfx-agent/bundle/Dockerfile b/internal/signalfx-agent/bundle/Dockerfile
index 97657ea9ba..9e603f253f 100644
--- a/internal/signalfx-agent/bundle/Dockerfile
+++ b/internal/signalfx-agent/bundle/Dockerfile
@@ -418,7 +418,6 @@ COPY --from=extra-packages /opt/root/lib/ /lib/
COPY --from=extra-packages /opt/root/bin/ /bin/
# Some extra non-binary collectd resources
-COPY --from=collectd /usr/share/collectd/postgresql_default.conf /postgresql_default.conf
COPY --from=collectd /usr/share/collectd/types.db /types.db
COPY --from=collectd /usr/share/collectd/java/ /collectd-java/
COPY signalfx_types.db /signalfx_types.db
diff --git a/internal/signalfx-agent/pkg/core/modules_linux.go b/internal/signalfx-agent/pkg/core/modules_linux.go
index f2eaa6efa0..d6518f7718 100644
--- a/internal/signalfx-agent/pkg/core/modules_linux.go
+++ b/internal/signalfx-agent/pkg/core/modules_linux.go
@@ -28,7 +28,6 @@ import (
_ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/metadata"
_ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/mysql"
_ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/nginx"
- _ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/postgresql"
_ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/processes"
_ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/protocols"
_ "github.com/signalfx/signalfx-agent/pkg/monitors/collectd/python"
diff --git a/internal/signalfx-agent/pkg/monitors/collectd/postgresql/genmetadata.go b/internal/signalfx-agent/pkg/monitors/collectd/postgresql/genmetadata.go
deleted file mode 100644
index 5c23c50b97..0000000000
--- a/internal/signalfx-agent/pkg/monitors/collectd/postgresql/genmetadata.go
+++ /dev/null
@@ -1,95 +0,0 @@
-// Code generated by monitor-code-gen. DO NOT EDIT.
-
-package postgresql
-
-import (
- "github.com/signalfx/golib/v3/datapoint"
- "github.com/signalfx/signalfx-agent/pkg/monitors"
-)
-
-const monitorType = "collectd/postgresql"
-
-var groupSet = map[string]bool{}
-
-const (
- pgBlksHeapHit = "pg_blks.heap_hit"
- pgBlksHeapRead = "pg_blks.heap_read"
- pgBlksIdxHit = "pg_blks.idx_hit"
- pgBlksIdxRead = "pg_blks.idx_read"
- pgBlksTidxHit = "pg_blks.tidx_hit"
- pgBlksTidxRead = "pg_blks.tidx_read"
- pgBlksToastHit = "pg_blks.toast_hit"
- pgBlksToastRead = "pg_blks.toast_read"
- pgDbSize = "pg_db_size"
- pgNTupCDel = "pg_n_tup_c.del"
- pgNTupCHotUpd = "pg_n_tup_c.hot_upd"
- pgNTupCIns = "pg_n_tup_c.ins"
- pgNTupCUpd = "pg_n_tup_c.upd"
- pgNTupGDead = "pg_n_tup_g.dead"
- pgNTupGLive = "pg_n_tup_g.live"
- pgNumbackends = "pg_numbackends"
- pgScanIdx = "pg_scan.idx"
- pgScanIdxTupFetch = "pg_scan.idx_tup_fetch"
- pgScanSeq = "pg_scan.seq"
- pgScanSeqTupRead = "pg_scan.seq_tup_read"
- pgXactCommit = "pg_xact.commit"
- pgXactNumDeadlocks = "pg_xact.num_deadlocks"
- pgXactRollback = "pg_xact.rollback"
-)
-
-var metricSet = map[string]monitors.MetricInfo{
- pgBlksHeapHit: {Type: datapoint.Gauge},
- pgBlksHeapRead: {Type: datapoint.Gauge},
- pgBlksIdxHit: {Type: datapoint.Gauge},
- pgBlksIdxRead: {Type: datapoint.Gauge},
- pgBlksTidxHit: {Type: datapoint.Gauge},
- pgBlksTidxRead: {Type: datapoint.Gauge},
- pgBlksToastHit: {Type: datapoint.Gauge},
- pgBlksToastRead: {Type: datapoint.Gauge},
- pgDbSize: {Type: datapoint.Gauge},
- pgNTupCDel: {Type: datapoint.Gauge},
- pgNTupCHotUpd: {Type: datapoint.Gauge},
- pgNTupCIns: {Type: datapoint.Gauge},
- pgNTupCUpd: {Type: datapoint.Gauge},
- pgNTupGDead: {Type: datapoint.Gauge},
- pgNTupGLive: {Type: datapoint.Gauge},
- pgNumbackends: {Type: datapoint.Gauge},
- pgScanIdx: {Type: datapoint.Gauge},
- pgScanIdxTupFetch: {Type: datapoint.Gauge},
- pgScanSeq: {Type: datapoint.Gauge},
- pgScanSeqTupRead: {Type: datapoint.Gauge},
- pgXactCommit: {Type: datapoint.Gauge},
- pgXactNumDeadlocks: {Type: datapoint.Gauge},
- pgXactRollback: {Type: datapoint.Gauge},
-}
-
-var defaultMetrics = map[string]bool{
- pgBlksHeapHit: true,
- pgBlksHeapRead: true,
- pgBlksIdxHit: true,
- pgBlksIdxRead: true,
- pgDbSize: true,
- pgNTupCDel: true,
- pgNTupCIns: true,
- pgNTupCUpd: true,
- pgNTupGLive: true,
- pgNumbackends: true,
- pgScanIdx: true,
- pgScanIdxTupFetch: true,
- pgScanSeq: true,
- pgScanSeqTupRead: true,
- pgXactCommit: true,
- pgXactRollback: true,
-}
-
-var groupMetricsMap = map[string][]string{}
-
-var monitorMetadata = monitors.Metadata{
- MonitorType: "collectd/postgresql",
- DefaultMetrics: defaultMetrics,
- Metrics: metricSet,
- SendUnknown: false,
- Groups: groupSet,
- GroupMetricsMap: groupMetricsMap,
- SendAll: false,
-}
diff --git a/internal/signalfx-agent/pkg/monitors/collectd/postgresql/metadata.yaml b/internal/signalfx-agent/pkg/monitors/collectd/postgresql/metadata.yaml
deleted file mode 100644
index 335d4e3349..0000000000
--- a/internal/signalfx-agent/pkg/monitors/collectd/postgresql/metadata.yaml
+++ /dev/null
@@ -1,159 +0,0 @@
-monitors:
-- dimensions:
- doc: |
- **This monitor is deprecated in favor of the [postgresql monitor](./postgresql.md).**
-
- Monitors a PostgreSQL database server using collectd's
- [PostgreSQL plugin](https://collectd.org/wiki/index.php/Plugin:PostgreSQL).
-
- You have to specify each database you want to monitor individually under the
- `databases` key. If you have a common authentication to all databases being
- monitored, you can specify that in the top-level `username`/`password`
- options, otherwise they can be specified at the database level.
-
- Sample YAML configuration:
-
- ```yaml
- monitors:
- - type: collectd/postgresql
- host: 127.0.0.1
- port: 5432
- username: "username1"
- password: "password1"
- databases:
- - name: "testdb"
- username: "test_user"
- password: "test_pwd"
- ```
-
- Sample YAML configuration with custom query:
-
- ```yaml
- monitors:
- - type: collectd/postgresql
- host: 127.0.0.1
- port: 5432
- username: "username1"
- password: "password1"
- queries:
- - name: "exampleQuery"
- params:
- - "hostname"
- statement: "Select * From test Where host = $1;"
- results:
- - type: "gauge"
- valuesFrom:
- - "test"
- instancePrefix: "test"
- databases:
- - name: "test"
- username: "username2"
- password: "password2"
- queries:
- - "exampleQuery"
-
- metricsToInclude:
- - metricNames:
- - gauge.test
- monitorType: collectd/postgresql
- ```
- Note that the metric names for the additional metrics picked up from the
- queries provided depend on the type, instancePrefix and/or instancesFrom
- parameters being passed in.
- See [PostgreSQL plugin](https://collectd.org/wiki/index.php/Plugin:PostgreSQL)
- for details.
- metrics:
- pg_blks.heap_hit:
- description: Number of buffer hits
- default: true
- type: gauge
- pg_blks.heap_read:
- description: Number of disk blocks read
- default: true
- type: gauge
- pg_blks.idx_hit:
- description: Number of index buffer hits
- default: true
- type: gauge
- pg_blks.idx_read:
- description: Number of index blocks read
- default: true
- type: gauge
- pg_blks.tidx_hit:
- description: Number of TOAST index buffer hits
- default: false
- type: gauge
- pg_blks.tidx_read:
- description: Number of TOAST index blocks read
- default: false
- type: gauge
- pg_blks.toast_hit:
- description: Number of TOAST buffer hits
- default: false
- type: gauge
- pg_blks.toast_read:
- description: Number of disk blocks read
- default: false
- type: gauge
- pg_db_size:
- description: Size of the database on disk, in bytes
- default: true
- type: gauge
- pg_n_tup_c.del:
- description: Number of delete operations
- default: true
- type: gauge
- pg_n_tup_c.hot_upd:
- description: Number of update operations not requiring index update
- default: false
- type: gauge
- pg_n_tup_c.ins:
- description: Number of insert operations
- default: true
- type: gauge
- pg_n_tup_c.upd:
- description: Number of update operations
- default: true
- type: gauge
- pg_n_tup_g.dead:
- description: Number of dead rows in the database
- default: false
- type: gauge
- pg_n_tup_g.live:
- description: Number of live rows in the database
- default: true
- type: gauge
- pg_numbackends:
- description: Number of server processes
- default: true
- type: gauge
- pg_scan.idx:
- description: Number of index scans
- default: true
- type: gauge
- pg_scan.idx_tup_fetch:
- description: Number of rows read from index scans
- default: true
- type: gauge
- pg_scan.seq:
- description: Number of sequential scans
- default: true
- type: gauge
- pg_scan.seq_tup_read:
- description: Number of rows read from sequential scans
- default: true
- type: gauge
- pg_xact.commit:
- description: Number of commits
- default: true
- type: gauge
- pg_xact.num_deadlocks:
- description: Number of deadlocks detected by the database
- default: false
- type: gauge
- pg_xact.rollback:
- description: Number of rollbacks
- default: true
- type: gauge
- monitorType: collectd/postgresql
- properties:
diff --git a/internal/signalfx-agent/pkg/monitors/collectd/postgresql/postgresql.go b/internal/signalfx-agent/pkg/monitors/collectd/postgresql/postgresql.go
deleted file mode 100644
index 3e698997b9..0000000000
--- a/internal/signalfx-agent/pkg/monitors/collectd/postgresql/postgresql.go
+++ /dev/null
@@ -1,138 +0,0 @@
-//go:build linux
-// +build linux
-
-package postgresql
-
-//go:generate ../../../../scripts/collectd-template-to-go postgresql.tmpl
-
-import (
- "errors"
-
- "github.com/signalfx/signalfx-agent/pkg/core/config"
- "github.com/signalfx/signalfx-agent/pkg/monitors"
- "github.com/signalfx/signalfx-agent/pkg/monitors/collectd"
-)
-
-func init() {
- monitors.Register(&monitorMetadata, func() interface{} {
- return &Monitor{
- *collectd.NewMonitorCore(CollectdTemplate),
- }
- }, &Config{})
-}
-
-// Database configures a particular PostgreSQL database
-type Database struct {
- // The name of the database
- Name string `yaml:"name" validate:"required"`
- // Username used to access the database
- Username string `yaml:"username"`
- // Password used to access the database
- Password string `yaml:"password" neverLog:"true"`
- // Interval to query the database in seconds
- Interval int `yaml:"interval"`
- // Skip expired values in query output
- ExpireDelay int `yaml:"expireDelay"`
- // Specify whether to use an ssl connection with PostgreSQL.
- // (prefer(default), disable, allow, require)
- SSLMode string `yaml:"sslMode"`
- // Specify the Kerberos service name used to authenticate with kerberos 5 or
- // GSSAPI
- KRBSrvName string `yaml:"krbSrvName"`
- // Queries used to generate metrics. These will override the default set.
- // If no queries are specified, the default set will be used
- // [`custom_deadlocks`, `backends`, `transactions`, `queries`, `queries_by_table`,
- // `query_plans`, `table_states`, `query_plans_by_table`, `table_states_by_table`,
- // `disk_io`, `disk_io_by_table`, `disk_usage`]
- Queries []string `yaml:"queries"`
-}
-
-// Result maps values from a query to a metric
-type Result struct {
- // Type defines a metric type
- Type string `yaml:"type" validate:"required"`
- // Specifies columns in the SQL result to use as the metric
- // value. The number of columns must match the expected number of values
- // for the metric type.
- ValuesFrom []string `yaml:"valuesFrom" validate:"required"`
- // A prefix for the type instance
- InstancePrefix string `yaml:"instancePrefix"`
- // Specifies columns in the SQL result to uses for the type
- // instance. Multiple columns are joined with a hyphen "-".
- InstancesFrom []string `yaml:"instancesFrom"`
-}
-
-// Query adds a new query for retrieving metrics
-type Query struct {
- // Name used to refer to the query in the database block
- Name string `yaml:"name" validate:"required"`
- // Statement is a SQL statement to execute
- Statement string `yaml:"statement" validate:"required"`
- // Result blocks that define mappings of SQL query results to
- // metrics
- Results []Result `yaml:"results" validate:"required"`
- // Parameters used to fill in $1,$2,$... tokens in the SQL
- // statement. Acceptable values are hostname, database, instance, username,
- // interval
- Params []string `yaml:"params"`
- // Specifies the column that should be used to populate
- // plugin instance
- PluginInstanceFrom string `yaml:"pluginInstanceFrom"`
- // The minimum version of PostgreSQL that the query is
- // compatible with. The version must be specified as a two decimal digit.
- // Ex. 7.2.3 -> 70203
- MinVersion int `yaml:"minVersion"`
- // The maximum version of PostgreSQL that the query is
- // compatible with. The version must be specified as a two decimal digit.
- // Ex. 7.2.3 -> 70203
- MaxVersion int `yaml:"maxVersion"`
-}
-
-// Config is the monitor-specific config with the generic config embedded
-type Config struct {
- config.MonitorConfig `yaml:",inline" acceptsEndpoints:"true"`
- Host string `yaml:"host" validate:"required"`
- Port uint16 `yaml:"port" validate:"required"`
- // A list of databases along with optional authentication credentials.
- Databases []Database `yaml:"databases" validate:"required"`
- // PostgreSQL queries and metric mappings
- Queries []Query `yaml:"queries"`
- // A username that serves as a default for all databases if not overridden
- Username string `yaml:"username"`
- // A password that serves as a default for all databases if not overridden
- Password string `yaml:"password" neverLog:"true"`
- // A SignalFx extension to the plugin that allows us to disable the normal
- // behavior of the PostgreSQL collectd plugin where the `host` dimension is set
- // to the hostname of the PostgreSQL database server. When `false` (the
- // recommended and default setting), the globally configured `hostname`
- // config is used instead.
- ReportHost bool `yaml:"reportHost"`
-}
-
-// Validate will check the config for correctness.
-func (c *Config) Validate() error {
- if len(c.Databases) == 0 {
- return errors.New("you must specify at least one database for PostgreSQL")
- }
-
- for _, db := range c.Databases {
- if db.Username == "" && c.Username == "" {
- return errors.New("username is required for PostgreSQL monitoring")
- }
- }
- return nil
-}
-
-func (c *Config) GetExtraMetrics() []string {
- return nil
-}
-
-// Monitor is the main type that represents the monitor
-type Monitor struct {
- collectd.MonitorCore
-}
-
-// Configure configures and runs the plugin in collectd
-func (am *Monitor) Configure(conf *Config) error {
- return am.SetConfigurationAndRun(conf, collectd.WithDeprecationWarningLog("postgresql"))
-}
diff --git a/internal/signalfx-agent/pkg/monitors/collectd/postgresql/postgresql.tmpl b/internal/signalfx-agent/pkg/monitors/collectd/postgresql/postgresql.tmpl
deleted file mode 100644
index b0599223b8..0000000000
--- a/internal/signalfx-agent/pkg/monitors/collectd/postgresql/postgresql.tmpl
+++ /dev/null
@@ -1,69 +0,0 @@
-
- Interval {{.IntervalSeconds}}
-
-
-
-
- Statement "SELECT deadlocks as num_deadlocks \
- FROM pg_stat_database \
- WHERE datname = $1;"
- Param database
-
- Type "pg_xact"
- InstancePrefix "num_deadlocks"
- ValuesFrom "num_deadlocks"
-
-
- {{range $q := .Queries}}
-
- Statement "{{$q.Statement}}"
- {{range $param := $q.Params -}}
- Param "{{$param}}"
- {{- end}}
- {{with $q.PluginInstanceFrom}}PluginInstanceFrom "{{.}}"{{- end}}
- {{with $q.MinVersion}}MinVersion {{.}}{{- end}}
- {{with $q.MaxVersion}}MaxVersion {{.}}{{- end}}
- {{range $r := $q.Results -}}
-
- Type "{{$r.Type}}"
- {{with $r.InstancePrefix -}}InstancePrefix "{{.}}"{{- end}}
- {{if $r.InstancesFrom -}}InstancesFrom {{range $from := $r.InstancesFrom}}"{{$from}}" {{end}}{{- end}}
- ValuesFrom {{range $v := $r.ValuesFrom}}"{{$v}}" {{- end}}
-
- {{- end}}
-
- {{end}}
- {{range $db := .Databases}}
-
- Host "{{$.Host}}"
- Port "{{$.Port}}"
- ReportHost {{toBool $.ReportHost}}
- {{if $db.Username -}}User "{{$db.Username}}"{{else if $.Username}}User "{{$.Username}}"{{- end}}
- {{if $db.Password -}}Password "{{$db.Password}}"{{else if $.Password}}Password "{{$.Password}}"{{- end}}
- Instance "{{$db.Name}}[monitorID={{$.MonitorID}}]"
- {{with $db.Interval -}}Interval {{.}}{{- end}}
- {{with $db.ExpireDelay -}}ExpireDelay {{.}}{{- end}}
- {{with $db.SSLMode -}}SSLMode "{{.}}"{{- end}}
- {{with $db.KRBSrvName -}}KRBSrvName "{{.}}"{{- end}}
- {{if $db.Queries}}
- {{range $q := $db.Queries -}}
- Query "{{$q}}"
- {{end}}
- {{- else}}
- Query custom_deadlocks
- Query backends
- Query transactions
- Query queries
- Query queries_by_table
- Query query_plans
- Query table_states
- Query query_plans_by_table
- Query table_states_by_table
- Query disk_io
- Query disk_io_by_table
- Query disk_usage
- {{end}}
-
- {{end}}
- DefaultQueryConfigPath "{{ bundleDir }}/postgresql_default.conf"
-
diff --git a/internal/signalfx-agent/pkg/monitors/collectd/postgresql/template.go b/internal/signalfx-agent/pkg/monitors/collectd/postgresql/template.go
deleted file mode 100644
index 7c398aa3fc..0000000000
--- a/internal/signalfx-agent/pkg/monitors/collectd/postgresql/template.go
+++ /dev/null
@@ -1,85 +0,0 @@
-//go:build linux
-// +build linux
-
-package postgresql
-
-// AUTOGENERATED BY scripts/collectd-template-to-go. DO NOT EDIT!!
-
-import (
- "text/template"
-
- "github.com/signalfx/signalfx-agent/pkg/monitors/collectd"
-)
-
-// CollectdTemplate is a template for a postgresql collectd config file
-var CollectdTemplate = template.Must(collectd.InjectTemplateFuncs(template.New("postgresql")).Parse(`
-
- Interval {{.IntervalSeconds}}
-
-
-
-
- Statement "SELECT deadlocks as num_deadlocks \
- FROM pg_stat_database \
- WHERE datname = $1;"
- Param database
-
- Type "pg_xact"
- InstancePrefix "num_deadlocks"
- ValuesFrom "num_deadlocks"
-
-
- {{range $q := .Queries}}
-
- Statement "{{$q.Statement}}"
- {{range $param := $q.Params -}}
- Param "{{$param}}"
- {{- end}}
- {{with $q.PluginInstanceFrom}}PluginInstanceFrom "{{.}}"{{- end}}
- {{with $q.MinVersion}}MinVersion {{.}}{{- end}}
- {{with $q.MaxVersion}}MaxVersion {{.}}{{- end}}
- {{range $r := $q.Results -}}
-
- Type "{{$r.Type}}"
- {{with $r.InstancePrefix -}}InstancePrefix "{{.}}"{{- end}}
- {{if $r.InstancesFrom -}}InstancesFrom {{range $from := $r.InstancesFrom}}"{{$from}}" {{end}}{{- end}}
- ValuesFrom {{range $v := $r.ValuesFrom}}"{{$v}}" {{- end}}
-
- {{- end}}
-
- {{end}}
- {{range $db := .Databases}}
-
- Host "{{$.Host}}"
- Port "{{$.Port}}"
- ReportHost {{toBool $.ReportHost}}
- {{if $db.Username -}}User "{{$db.Username}}"{{else if $.Username}}User "{{$.Username}}"{{- end}}
- {{if $db.Password -}}Password "{{$db.Password}}"{{else if $.Password}}Password "{{$.Password}}"{{- end}}
- Instance "{{$db.Name}}[monitorID={{$.MonitorID}}]"
- {{with $db.Interval -}}Interval {{.}}{{- end}}
- {{with $db.ExpireDelay -}}ExpireDelay {{.}}{{- end}}
- {{with $db.SSLMode -}}SSLMode "{{.}}"{{- end}}
- {{with $db.KRBSrvName -}}KRBSrvName "{{.}}"{{- end}}
- {{if $db.Queries}}
- {{range $q := $db.Queries -}}
- Query "{{$q}}"
- {{end}}
- {{- else}}
- Query custom_deadlocks
- Query backends
- Query transactions
- Query queries
- Query queries_by_table
- Query query_plans
- Query table_states
- Query query_plans_by_table
- Query table_states_by_table
- Query disk_io
- Query disk_io_by_table
- Query disk_usage
- {{end}}
-
- {{end}}
- DefaultQueryConfigPath "{{ bundleDir }}/postgresql_default.conf"
-
-`)).Option("missingkey=error")
diff --git a/pkg/receiver/smartagentreceiver/config.go b/pkg/receiver/smartagentreceiver/config.go
index 4a9df2d35f..db13e25ac8 100644
--- a/pkg/receiver/smartagentreceiver/config.go
+++ b/pkg/receiver/smartagentreceiver/config.go
@@ -42,7 +42,7 @@ var (
"collectd/genericjmx": true, "collectd/hadoopjmx": true, "collectd/kafka": true, "collectd/kafka_consumer": true,
"collectd/kafka_producer": true, "collectd/load": true, "collectd/memcached": true, "collectd/memory": true,
"collectd/mysql": true, "collectd/nginx": true, "collectd/php-fpm": true,
- "collectd/postgresql": true, "collectd/processes": true, "collectd/protocols": true,
+ "collectd/processes": true, "collectd/protocols": true,
"collectd/signalfx-metadata": true, "collectd/statsd": true, "collectd/uptime": true,
}
)
diff --git a/tests/receivers/smartagent/collectd-postgresql/collectd_postgresql_test.go b/tests/receivers/smartagent/collectd-postgresql/collectd_postgresql_test.go
deleted file mode 100644
index 0558bfa56e..0000000000
--- a/tests/receivers/smartagent/collectd-postgresql/collectd_postgresql_test.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright Splunk, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//go:build integration
-
-package tests
-
-import (
- "path"
- "testing"
-
- "github.com/signalfx/splunk-otel-collector/tests/testutils"
-)
-
-func TestCollectdPostgresReceiverProvidesAllMetrics(t *testing.T) {
- containers := []testutils.Container{
- testutils.NewContainer().WithContext(
- path.Join("..", "postgresql", "testdata", "server"),
- ).WithEnv(map[string]string{
- "POSTGRES_DB": "test_db",
- "POSTGRES_USER": "postgres",
- "POSTGRES_PASSWORD": "postgres",
- }).WithExposedPorts(
- "5432:5432",
- ).WithName("postgres-server").WithNetworks(
- "postgres",
- ).WillWaitForPorts("5432").WillWaitForLogs(
- "database system is ready to accept connections",
- ),
-
- testutils.NewContainer().WithContext(
- path.Join("..", "postgresql", "testdata", "client"),
- ).WithEnv(map[string]string{
- "POSTGRES_SERVER": "postgres-server",
- }).WithName("postgres-client").WithNetworks(
- "postgres",
- ).WillWaitForLogs("Beginning psql requests"),
- }
-
- testutils.AssertAllMetricsReceived(
- t, "all.yaml", "all_metrics_config.yaml", containers, nil,
- )
-}
diff --git a/tests/receivers/smartagent/collectd-postgresql/testdata/all_metrics_config.yaml b/tests/receivers/smartagent/collectd-postgresql/testdata/all_metrics_config.yaml
deleted file mode 100644
index 9f1b0f9225..0000000000
--- a/tests/receivers/smartagent/collectd-postgresql/testdata/all_metrics_config.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-receivers:
- smartagent/collectd_postgresql:
- type: collectd/postgresql
- host: localhost
- port: 5432
- username: test_user
- password: test_password
- databases:
- - name: test_db
- - name: postgres
- extraMetrics: ["*"]
- intervalSeconds: 1
-
-exporters:
- otlp:
- endpoint: "${OTLP_ENDPOINT}"
- tls:
- insecure: true
-
-service:
- pipelines:
- metrics:
- receivers:
- - smartagent/collectd_postgresql
- exporters: [otlp]
diff --git a/tests/receivers/smartagent/collectd-postgresql/testdata/resource_metrics/all.yaml b/tests/receivers/smartagent/collectd-postgresql/testdata/resource_metrics/all.yaml
deleted file mode 100644
index 490f2adc3d..0000000000
--- a/tests/receivers/smartagent/collectd-postgresql/testdata/resource_metrics/all.yaml
+++ /dev/null
@@ -1,121 +0,0 @@
-resource_metrics:
- - scope_metrics:
- - metrics:
- - name: pg_blks.heap_hit
- type: IntMonotonicCumulativeSum
- - name: pg_blks.heap_hit-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_blks.heap_hit-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_blks.heap_read
- type: IntMonotonicCumulativeSum
- - name: pg_blks.heap_read-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_blks.heap_read-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_blks.idx_hit
- type: IntMonotonicCumulativeSum
- - name: pg_blks.idx_hit-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_blks.idx_hit-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_blks.idx_read
- type: IntMonotonicCumulativeSum
- - name: pg_blks.idx_read-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_blks.idx_read-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_blks.tidx_hit
- type: IntMonotonicCumulativeSum
- - name: pg_blks.tidx_hit-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_blks.tidx_hit-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_blks.tidx_read
- type: IntMonotonicCumulativeSum
- - name: pg_blks.tidx_read-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_blks.tidx_read-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_blks.toast_hit
- type: IntMonotonicCumulativeSum
- - name: pg_blks.toast_hit-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_blks.toast_hit-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_blks.toast_read
- type: IntMonotonicCumulativeSum
- - name: pg_blks.toast_read-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_blks.toast_read-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_db_size
- type: IntGauge
- - name: pg_n_tup_c.del
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.del-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.del-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.hot_upd
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.hot_upd-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.hot_upd-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.ins
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.ins-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.ins-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.upd
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.upd-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_c.upd-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_n_tup_g.dead
- type: IntGauge
- - name: pg_n_tup_g.dead-test_schema-table_one
- type: IntGauge
- - name: pg_n_tup_g.dead-test_schema-table_two
- type: IntGauge
- - name: pg_n_tup_g.live
- type: IntGauge
- - name: pg_n_tup_g.live-test_schema-table_one
- type: IntGauge
- - name: pg_n_tup_g.live-test_schema-table_two
- type: IntGauge
- - name: pg_numbackends
- type: IntGauge
- - name: pg_scan.idx
- type: IntMonotonicCumulativeSum
- - name: pg_scan.idx-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_scan.idx-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_scan.idx_tup_fetch
- type: IntMonotonicCumulativeSum
- - name: pg_scan.idx_tup_fetch-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_scan.idx_tup_fetch-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_scan.seq
- type: IntMonotonicCumulativeSum
- - name: pg_scan.seq-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_scan.seq-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_scan.seq_tup_read
- type: IntMonotonicCumulativeSum
- - name: pg_scan.seq_tup_read-test_schema-table_one
- type: IntMonotonicCumulativeSum
- - name: pg_scan.seq_tup_read-test_schema-table_two
- type: IntMonotonicCumulativeSum
- - name: pg_xact.commit
- type: IntMonotonicCumulativeSum
- - name: pg_xact.num_deadlocks
- type: IntMonotonicCumulativeSum
- - name: pg_xact.rollback
- type: IntMonotonicCumulativeSum
\ No newline at end of file