open-vault/helper
Christopher Swenson c57d053d28
Add database plugin metrics around connections (#16048)
Add database plugin metrics around connections

This is a replacement for #15923 that takes into account recent lock
cleanup.

I went ahead and added back in the hanging plugin test, which I meant to
add in #15944 but forgot.

I tested this by spinning up a statsd sink in the tests and verifying I
got a stream of metrics:

```
$ nc -u -l 8125 | grep backend
test.swenson-Q9Q0L72D39.secrets.database.backend.connections.count.pgx.5.:1.000000|g
test.swenson-Q9Q0L72D39.secrets.database.backend.connections.count.pgx.5.:0.000000|g
test.swenson-Q9Q0L72D39.secrets.database.backend.connections.count.pgx.5.:1.000000|g
test.swenson-Q9Q0L72D39.secrets.database.backend.connections.count.pgx.5.:0.000000|g
```

We have to rework the shared gauge code to work without a full
`ClusterMetricSink`, since we don't have access to the core metrics from
within a plugin.

This only reports metrics every 10 minutes by default, but it solves
some problems we would have had with the gauge values becoming stale and
needing to be re-sent.

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2022-06-27 09:34:45 -07:00
..
benchhelpers Update deps for consul-template 0.29.0 (#15293) 2022-05-05 10:30:40 -07:00
builtinplugins Adding vault-plugin-secrets-kubernetes v0.1.0 (#15551) 2022-05-20 14:13:33 -07:00
constants Introduce fips build tag (#14495) 2022-03-15 13:04:21 -04:00
dhutil Remove spurious fmt.Printf calls including one of a key (#15344) 2022-05-19 12:27:02 -07:00
fairshare VAULT-4240 time.After() in a select statement can lead to memory leak (#14814) 2022-04-01 10:17:11 -04:00
flag-kv
flag-slice
forwarding Adds Vault version prerelease and metadata to logical.PluginEnvironment (#14851) 2022-04-04 22:31:01 -07:00
hostutil Convert to Go 1.17 go:build directive (#13579) 2022-01-05 12:02:03 -06:00
identity Correct drift between ENT and OSS (#15966) 2022-06-14 17:53:19 -07:00
metricsutil Add database plugin metrics around connections (#16048) 2022-06-27 09:34:45 -07:00
monitor api/monitor: Adding log format to monitor command and debug (#15536) 2022-05-24 13:10:53 -04:00
namespace When tainting a route during setup, pre-calculate the namespace specific path (#15067) 2022-04-26 09:13:45 -07:00
osutil Fix nightly tests and debug (#14970) 2022-04-12 06:08:28 +05:30
parseip Move to go 1.17 (#12868) 2021-10-21 09:32:03 -04:00
pgpkeys helper: deprecate errwrap.Wrapf() (#11556) 2021-05-07 08:53:20 -04:00
policies Run a more strict formatter over the code (#11312) 2021-04-08 09:43:39 -07:00
proxyutil remove mount accessor from MFA config (#14406) 2022-03-09 09:14:30 -08:00
random Only use additional entropy source when configured within transit and sys random (#15734) 2022-06-01 14:56:39 -04:00
storagepacker Adds Vault version prerelease and metadata to logical.PluginEnvironment (#14851) 2022-04-04 22:31:01 -07:00
testhelpers postgres: replace the package lib/pq with pgx (#15343) 2022-05-23 12:49:18 -07:00
timeutil Fix Racy Activity Log Tests (#10484) 2020-12-02 13:48:13 -07:00