Commit Graph

9 Commits

Author SHA1 Message Date
Mike Palmiotto
fa4153dc1f backports for ActivityLog and Reporting 1.13.x (#21140)
* backport of commit 9f7f8d5bfa

* backport of commit e3c59773e9

* backport of commit b4fab6ac2a

* backport of commit 54904e4cd6

* backport of commit 4b6ec4079d

* backport of commit 05ba6bbddd

* backport of commit 002a59a370

* backport of commit 77f83d9fe8

* backport of commit 730d0e2821

* backport of commit 35e2c1665f

* backport of commit 810d504e4f

* backport of commit 5b23dd506f

* backport of commit 018ea84997

* backport of commit 541f18eeb7

* backport of commit b4e2751a09

* backport of commit dc5dd71c72

* backport of commit 5002489d27

---------

Co-authored-by: miagilepner <mia.epner@hashicorp.com>
Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
2023-06-14 17:07:26 -04:00
Christopher Swenson
53bfb72eca 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
Chris Capurso
6f47088845 Fix max measurements gauge test (#14024)
* make streamGaugesToSink batch size a const

* attempt to fix for timeout failures for TestGauge_MaximumMeasurements
2022-02-23 13:36:25 -05:00
Brian Kassouf
a24653cc5c Run a more strict formatter over the code (#11312)
* Update tooling

* Run gofumpt

* go mod vendor
2021-04-08 09:43:39 -07:00
Brian Kassouf
d1373dce12 helper/metricsutil: Prevent potential Ticker leak (#10913) 2021-02-18 20:31:53 -08:00
Brian Kassouf
f5be0716db Revert "Migrate internalshared out (#9727)" (#10141)
This reverts commit ee6391b691.
2020-10-13 16:38:21 -07:00
Jeff Mitchell
ee6391b691 Migrate internalshared out (#9727)
* Migrate internalshared out

* fix merge issue

* fix merge issue

* go mod vendor

Co-authored-by: Brian Kassouf <bkassouf@hashicorp.com>
2020-10-12 11:56:24 -07:00
ncabatoff
4b81ede3e3 Don't assume that time.Duration can be represented by an int. (#9554) 2020-07-22 12:04:52 -04:00
Mark Gritter
72afe55906 Utility for collecting new gauge metrics (#9017) 2020-05-19 17:54:43 -05:00