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
Add more info about filters to docs and rename struct fields (#198)
* Add more info about filters to docs and rename struct fields
* Single startup log with more context
* ToLower extra fitler prefixes to avoid casing issues with user config
* Switch extra filters to apply by prefix instead of contains
---------
Signed-off-by: Kyle Eckhart <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+23-3
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ If you are still using the legacy [Access scopes][access-scopes], the `https://w
85
85
|`monitoring.metrics-type-prefixes`| Yes || Comma separated Google Stackdriver Monitoring Metric Type prefixes (see [example][metrics-prefix-example] and [available metrics][metrics-list]) |
86
86
|`monitoring.metrics-interval`| No |`5m`| Metric's timestamp interval to request from the Google Stackdriver Monitoring Metrics API. Only the most recent data point is used |
87
87
|`monitoring.metrics-offset`| No |`0s`| Offset (into the past) for the metric's timestamp interval to request from the Google Stackdriver Monitoring Metrics API, to handle latency in published metrics |
88
-
|`monitoring.filters`| No ||Formatted string to allow filtering on certain metrics type |
88
+
|`monitoring.filters`| No ||Additonal filters to be sent on the Monitoring API call. Add multiple filters by providing this parameter multiple times. See [monitoring.filters](#using-filters) for more info.|
89
89
|`monitoring.aggregate-deltas`| No || If enabled will treat all DELTA metrics as an in-memory counter instead of a gauge. Be sure to read [what to know about aggregating DELTA metrics](#what-to-know-about-aggregating-delta-metrics)|
90
90
|`monitoring.aggregate-deltas-ttl`| No |`30m`| How long should a delta metric continue to be exported and stored after GCP stops producing it. Read [slow moving metrics](#slow-moving-metrics) to understand the problem this attempts to solve |
91
91
|`monitoring.descriptor-cache-ttl`| No |`0s`| How long should the metric descriptors for a prefixed be cached for |
The structure for a filter is `<targeted_metric_prefix>:<filter_query>`
153
+
154
+
The `targeted_metric_prefix` is used to ensure the filter is only applied to the metric_prefix(es) where it makes sense.
155
+
It does not explicitly have to match a value from `metric_prefixes` but the `targeted_metric_prefix` must be at least a prefix to one or more `metric_prefixes`
pubsub.googleapis.com (apply to all defined prefixes) \
161
+
pubsub.googleapis.com/snapshot (apply to only snapshot metrics) \
162
+
pubsub.googleapis.com/subscription (apply to only subscription metrics) \
163
+
pubsub.googleapis.com/subscription/num_undelivered_messages (apply to only the specific subscription metric) \
164
+
165
+
The `filter_query` will be applied to a final metrics API query when querying for metric data. You can read more about the metric API filter options in GCPs documentation https://cloud.google.com/monitoring/api/v3/filters
166
+
167
+
The final query sent to the metrics API already includes filters for project and metric type. Each applicable `filter_query` will be appended to the query with an AND
0 commit comments