You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow subclasses of DropwizardExports to deal with validation errors
In the current form, if e.g. a Counter contains invalid data the entire
`collect` calls fails with InvalidArgumentException.
In large applications, it may be preferable to gracefully degrade the
available metrics and report the failure via e.g. logging. This change
allows just that - by changing the access modifiers to the `fromXYZ` methods
subclasses can now handle the errors.
Finally, to allow for skipping of invalid metrics, we follow the example
in `fromGauge` to interpret the meaning of a returned null to be that the
metric should be skipped.
Copy file name to clipboardExpand all lines: prometheus-metrics-instrumentation-dropwizard/src/main/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExports.java
Copy file name to clipboardExpand all lines: prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExportsTest.java
0 commit comments