Skip to content

Commit

Permalink
Collect max_connections metric (#9770)
Browse files Browse the repository at this point in the history
This will further allow us to expose this metric to users
  • Loading branch information
myrrc authored Nov 15, 2024
1 parent 7880c24 commit e12628f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions compute/etc/neon_collector.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import 'sql_exporter/compute_backpressure_throttling_seconds.libsonnet',
import 'sql_exporter/compute_current_lsn.libsonnet',
import 'sql_exporter/compute_logical_snapshot_files.libsonnet',
import 'sql_exporter/compute_max_connections.libsonnet',
import 'sql_exporter/compute_receive_lsn.libsonnet',
import 'sql_exporter/compute_subscriptions_count.libsonnet',
import 'sql_exporter/connection_counts.libsonnet',
Expand Down
10 changes: 10 additions & 0 deletions compute/etc/sql_exporter/compute_max_connections.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
metric_name: 'compute_max_connections',
type: 'gauge',
help: 'Max connections allowed for Postgres',
key_labels: null,
values: [
'max_connections',
],
query: importstr 'sql_exporter/compute_max_connections.sql',
}
1 change: 1 addition & 0 deletions compute/etc/sql_exporter/compute_max_connections.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT current_setting('max_connections') as max_connections;

1 comment on commit e12628f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5490 tests run: 5246 passed, 1 failed, 243 skipped (full report)


Failures on Postgres 17

# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_sharding_split_failures[debug-pg17-failure10]"
Flaky tests (1)

Postgres 17

Test coverage report is not available

The comment gets automatically updated with the latest test results
e12628f at 2024-11-15T18:35:57.331Z :recycle:

Please sign in to comment.