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

Commit 4af1cdb

Browse files
committed
add optional params
1 parent d5ef933 commit 4af1cdb

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

metrics/Gauge.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ The value that is published for gauges is an instantaneous measurement of an `in
1010
The following general operations MUST be provided by the API:
1111
* Defining a `name`, `description`, `unit`, `labelKeys`, `resource` and `constantLabels` which are fixed labels that always apply to a gauge. This should give back the gauge object to get or create time series, remove time series and clear all time series.
1212
* `name`: a string describing the name of the metric, e.g. "vm_cpu_cycles" or "queue_size". Names MUST be unique within the library. It is recommended to use names compatible with the intended end usage.
13-
* `description`: a string describing the metric, e.g."Virtual cycles executed on VM".
14-
* `unit`: a string describing the unit used for the metric (default set to "1"). Follows the format described by
15-
[Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html).
16-
* `labelKeys`: the list of the label keys to track different types of metric.
17-
* `constantLabels`: the map of label keys and label values. The keys in `labelKeys` must not be present in this map.
18-
* `resource`: the optional associated monitored resource information.
13+
* `description`: an optional string describing the metric, e.g."Virtual cycles executed on VM". The default is set to "".
14+
* `unit`: an optional string describing the unit used for the metric. Follows the format described by
15+
[Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html). The default set to "1".
16+
* `labelKeys`: an optional list of the label keys to track different types of metric. The default is set to empty list.
17+
* `constantLabels`: an optional map of label keys and label values. The default is set to empty map.
18+
* `resource`: an optional associated monitored resource information.
1919
* Add a new time series with label values, which returns a `Point` (which is part of the `TimeSeries`). Each point represents an instantaneous measurement of a varying gauge value. Each Gauge Metric has one or more time series for a single metric.
2020
* `labelValues`: the list of label values. The number of label values must be the same to that of the label keys.
2121
* The `Point` class should provide functionalities to manually increment/decrement values. Example: `add(long amt)`, `set(long value)`.
@@ -48,7 +48,7 @@ void doSomeWork() {
4848
point.set(15);
4949
}
5050
```
51-
It is recommended to keep a reference of a point for manual operations instead of always calling `getOrCreateTimeSeries` method.
51+
It is recommended to keep a reference of a point for manual operations instead of always calling `getOrCreateTimeSeries` method. The keys in `labelKeys` must not be present in `constantLabels` map. Also, `constantLabels` will be added to all the timeseries for the Metric.
5252

5353
## Derived Gauge API
5454

@@ -57,12 +57,12 @@ The value that is published for gauges is an instantaneous measurement of an `in
5757
The following general operations MUST be provided by the API:
5858
* Defining a `name`, `description`, `unit`, `labelKeys`, `resource` and `constantLabels` which are fixed labels that always apply to a gauge. This should give back gauge object to add new time series, remove time series and clear all time series.
5959
* `name`: a string describing the name of the metric, e.g. "vm_cpu_cycles". Names MUST be unique within the library. It is recommended to use names compatible with the intended end usage.
60-
* `description`: a string describing the metric, e.g."Virtual cycles executed on VM".
61-
* `unit`: a string describing the unit used for the metric (default set to "1"). Follows the format described by
62-
[Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html).
63-
* `labelKeys`: the list of the label keys to track different types of metric.
64-
* `constantLabels`: the map of label keys and label values. The keys in `labelKeys` must not be present in this map.
65-
* `resource`: the optional associated monitored resource information.
60+
* `description`: an optional string describing the metric, e.g."Virtual cycles executed on VM". The default is set to "".
61+
* `unit`: an optional string describing the unit used for the metric. Follows the format described by
62+
[Unified Code for Units of Measure](http://unitsofmeasure.org/ucum.html). The default set to "1".
63+
* `labelKeys`: an optional list of the label keys to track different types of metric. The default is set to empty list.
64+
* `constantLabels`: an optional map of label keys and label values. The default is set to empty map.
65+
* `resource`: an optional associated monitored resource information.
6666
* Add a new time series with label values, an `object` and a `callback function`. The number of label values must be the same to that of the label keys.
6767
* `labelValues`: the list of label values. The number of label values must be the same to that of the label keys.
6868
* `object`: the state object from which the function derives a measurement.

0 commit comments

Comments
 (0)