Releases: palantir/go-baseapp
v0.5.2
v0.5.1
Add Prometheus metrics emitter (#187)
The appmetrics/emitter/prometheus
package provides a prometheus.Collector
implementation to expose the metrics in a rcrowley/go-metrics
registry and a helper function to register an HTTP handler using the collector. The collector transforms metrics to a format that better matches Prometheus best practices; see the package documentation for details.
Other Changes
- Minor dependency and build tool upgrades
v0.5.0
Add the appmetrics
package (#182)
The appmetrics
package provides utilities to define and create metrics struct. A metrics struct contains all the metric instances (counters, gauges, histograms, etc.) for a package or application and defines how those metrics appear in a registry. For example:
type Metrics struct {
Requests metrics.Counter `metric:"requests"`
FailedRequests metrics.Counter `metric:"requests.error"`
}
Applications usually define a single global instance of their metrics struct, which they reference in all other packages that report metrics. See the package documentation for more details and examples.
Add ability to ignore requests in logs and metrics (#185)
Calling baseapp.Ignore(*http.Request, baseapp.IgnoreRule)
from a request handler can disable logging or metrics for a particular request. This may be useful if there are certain common requests, like health checks, that are uninteresting or distracting. Custom middleware can check for ignored requests using the baseapp.IsIgnored(*http.Request, baseapp.IgnoreRule) bool
function.
Other Changes
- Report request rates and latencies by status code in the default metrics (#181)
- Add the ability to change
metrics.Timer
units when exporting metrics to Datadog (#184) - Move the
baseapp/datadog
package toappmetrics/emitter/datadog
and deprecate the old package (#183) - Minor dependency and build tool upgrades
v0.4.2
v0.4.1
v0.4.0
Handle additional types of stack traces in errfmt.Print
(#87)
In addition to stack traces from pkg/errors
, print stacks for errors that define a StackTrace() []runtime.Frame
method. Errors in other packages may implement this interface to add stack trace support. This change also applies to the default error formatter for logs.
Build with Go 1.17 (#77)
While the library does not currently use any Go 1.17 features, this is the only version we test against and is now reflected in go.mod
.
Other Changes
- Upgrade
DataDog/datadog-go
tov5
(#73) - Other minor dependency and build tool updates