Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit cfc6ea5

Browse files
committed
update README
1 parent 15b6334 commit cfc6ea5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ In general the author of this package would recommend instrumenting custom metri
1212

1313
This package is intended as a way to publish metrics for applications that are _already_ instrumented with `go-metrics` without having to use a sidecar process like [stackdriver-prometheus-sidecar](https://github.com/Stackdriver/stackdriver-prometheus-sidecar).
1414

15+
## 🚨 Upgrading
16+
17+
Between v0.5.0 and v0.6.0, the behavior of the `IncrCounter` method changed: previously it would create a `GAUGE` [metric kind](https://cloud.google.com/monitoring/api/v3/kinds-and-types), but from v0.6.0 forward it will create a `CUMULATIVE` metric kind. (See https://github.com/google/go-metrics-stackdriver/issues/18 for a discussion.)
18+
19+
However, once a [MetricDescriptor](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#MetricDescriptor) has been created in Google Cloud Monitoring, its `metricKind` field cannot be changed. So if you have any _existing_ `GAUGE` metrics that were created by `IncrCounter`, you will see errors in your logs when the v0.6.0 client attempts to update them and fails. Your options for handling this are:
20+
21+
1. Change the name of the metric you are passing to `IncrCounter` (creating a new metricDescriptor with a different name), or:
22+
2. Delete the existing metricDescriptor using the [delete API](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors/delete) and let go-metrics re-create it as a `CUMULATIVE` metric
23+
1524
## Details
1625

1726
[stackdriver.NewSink](https://godoc.org/github.com/google/go-metrics-stackdriver#NewSink)'s return value satisfies the go-metrics library's [MetricSink](https://godoc.org/github.com/armon/go-metrics#MetricSink) interface. When providing a `stackdriver.Sink` to libraries and applications instrumented against `MetricSink`, the metrics will be aggregated within this library and written to stackdriver as [Generic Task](https://cloud.google.com/monitoring/api/resources#tag_generic_task) timeseries metrics.

0 commit comments

Comments
 (0)