Hi,
I'm using Elastic Agent in standalone mode (without Fleet) on RHEL 9, version 8.14.3. I aim to collect the max_connections value from pg_settings in PostgreSQL 17.2 and correlate it with the number of active connections from pg_stat_activity.
Setup:
- Elastic Agent: 8.14.3 (standalone mode)
- PostgreSQL: 17.2 (server and client)
- Elastic Stack: 8.14.3
- OS: RHEL 9
Configuration:
- type: sql/metrics
id: sql-postgres-max-connections-my_app
data_stream.namespace: my_app
streams:
- data_stream.dataset: sql.postgresql_custom
driver: "postgres"
hosts:
- postgres://postgres@localhost:5432/?sslmode=disable
metricsets:
- query
period: 1m
result:
format: table
result_column_name: max_connections
sql_query: >
SELECT setting::int AS max_connections FROM pg_settings WHERE name = 'max_connections';
Issue:
Despite the configuration, no data is ingested into Elasticsearch. The index .ds-metrics-sql.postgresql_custom-*
is created, but documents only contain the SQL query string without any result fields.
Troubleshooting Steps Taken:
- Verified PostgreSQL connectivity and authentication.
- Executed the SQL query manually via
psql
successfully. - Tried both
format: table
andformat: document
in theresult
section. - Tested with a simple query:
SELECT 42 AS test_value;
— same issue. - Enabled debug logging with
selectors: ["*"]
— no relevant errors or warnings. - Checked the components directory:
postgresql
module is present, but nosql
module found. - Attempted to run the agent with
--dev
flag — not supported.
Questions:
- Is the
sql/metrics
input officially supported in Elastic Agent 8.14.3 standalone mode? - Are there known issues or limitations with this input in the specified version?
- Should the result of the SQL query appear directly in the
_source
of the document? - Is there an internal component or module required for
sql/metrics
that might be missing? - Would upgrading to Elastic Agent 8.15 or 9.0 resolve this issue, even if the Elastic Stack remains at 8.14.3?
Any insights or assistance would be greatly appreciated - thanks a lot in advance.