Commit 31251754 authored by Michael Droettboom's avatar Michael Droettboom
Browse files

1540725: Make labeled metrics invididual metric types

parent 7b83e922
......@@ -522,13 +522,14 @@ This is useful when you need to break down metrics by a label known at build tim
**Note**: Be careful with using arbitrary strings as labels and make sure they can't accidentally contain identifying data (like directory paths or user input).
All metric types except events have labeled variants. For example, for a labeled counter, use `type: labeled_counter`.
Say you're adding a new counter for errors that can occur when loading a resource from a REST API. First you need to add an entry for the counter to the `metrics.yaml` file:
```YAML
updater:
load_error:
type: counter
labeled: true # This makes it a labeled counter.
type: labeled_counter
labels: # This is optional, if provided it limits the set of labels you can use.
- timeout
- not_found
......
......@@ -208,8 +208,7 @@ glean.internal.metrics:
glean.error:
invalid_value:
type: counter
labeled: true
type: labeled_counter
description:
Counts the number of times a metric was set to an invalid value.
The labels are the `category.name` identifier of the metric.
......@@ -222,8 +221,7 @@ glean.error:
expires: never
invalid_label:
type: counter
labeled: true
type: labeled_counter
description:
Counts the number of times a metric was set with an invalid label.
The labels are the `category.name` identifier of the metric.
......
......@@ -20,7 +20,7 @@ import groovy.json.JsonOutput
// so that it will be shared between all libraries that use glean. This is
// important because it is approximately 300MB in installed size.
String GLEAN_PARSER_VERSION = "0.21.0"
String GLEAN_PARSER_VERSION = "0.22.0"
// The version of Miniconda is explicitly specified.
// Miniconda3-4.5.12 is known to not work on Windows.
String MINICONDA_VERSION = "4.5.11"
......
......@@ -30,6 +30,10 @@ permalink: /changelog/
intended for public use, part of the glean API has been renamed from
`mozilla.components.service.glean.metrics` to
`mozilla.components.service.glean.private`.
* ⚠️ **This is a breaking API change**: Labeled metrics are now their own
distinct metric types in the `metrics.yaml` file. For example, for a
labeled counter, rather than using `type: counter` and `labeled: true`, use
`type: labeled_counter`. See bugzilla 1540725.
# 0.49.0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment