chore: clear Prometheus todo and rename ReadableMetric -> MetricRecord (#799)

This commit is contained in:
Mayur Kale 2020-02-19 21:47:59 -08:00 committed by GitHub
parent 6616bb1791
commit cdec5574d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -43,7 +43,7 @@ The `MetricExporter` defines the interface that protocol-specific exporters must
The current `MetricExporter` interface (`0.2.0`) defines 2 methods:
- `export`: Exports a batch of telemetry data. In this method youll process and translate `ReadableMetric` Data into the data that your metric backend accepts.
- `export`: Exports a batch of telemetry data. In this method youll process and translate `MetricRecord` Data into the data that your metric backend accepts.
- `shutdown`: Shuts down the exporter. This is an opportunity for exporter to do any cleanup required. `Shutdown` should be called only once for each Exporter instance. After the call to `Shutdown` subsequent calls to Export are not allowed and should return `FailedNotRetryable` error.

View File

@ -74,14 +74,14 @@ export class PrometheusExporter implements MetricExporter {
}
/**
* Saves the current values of all exported {@link ReadableMetric}s so that they can be pulled
* by the Prometheus backend.
* Saves the current values of all exported {@link MetricRecord}s so that
* they can be pulled by the Prometheus backend.
*
* @todo reach into metrics to pull metric values on endpoint
* In its current state, the exporter saves the current values of all metrics when export
* is called and returns them when the export endpoint is called. In the future, this should
* be a no-op and the exporter should reach into the metrics when the export endpoint is
* called. As there is currently no interface to do this, this is our only option.
* In its current state, the exporter saves the current values of all metrics
* when export is called and returns them when the export endpoint is called.
* In the future, this should be a no-op and the exporter should reach into
* the metrics when the export endpoint is called. As there is currently no
* interface to do this, this is our only option.
*
* @param records Metrics to be sent to the prometheus backend
* @param cb result callback to be called on finish
@ -127,7 +127,7 @@ export class PrometheusExporter implements MetricExporter {
if (metric instanceof Counter) {
// Prometheus counter saves internal state and increments by given value.
// ReadableMetric value is the current state, not the delta to be incremented by.
// MetricRecord value is the current state, not the delta to be incremented by.
// Currently, _registerMetric creates a new counter every time the value changes,
// so the increment here behaves as a set value (increment from 0)
metric.inc(this._getLabelValues(labelKeys, record.labels), value as Sum);
@ -162,7 +162,7 @@ export class PrometheusExporter implements MetricExporter {
/**
* Prometheus library does aggregation, which means its inc method must be called with
* the value to be incremented by. It does not have a set method. As our ReadableMetric
* the value to be incremented by. It does not have a set method. As our MetricRecord
* contains the current value, not the value to be incremented by, we destroy and
* recreate counters when they are updated.
*