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

Commit 7e22f53

Browse files
authored
Exporter/Stats/Prometheus: Sanitize metric names (#217)
* Exporter/Stats/Prometheus: Sanitize metric names * fix review comments
1 parent 26ad2cf commit 7e22f53

File tree

6 files changed

+1007
-316
lines changed

6 files changed

+1007
-316
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
All notable changes to this project will be documented in this file.
44

55
## Unreleased
6-
- Enforce `--noUnusedLocals` Compiler Options on opencensus-core package.
6+
- Enforce `--noUnusedLocals` Compiler Options on [opencensus-core] package.
77
- Fix bugs related to Stackdriver Metrics Descriptor and TimeSeries.
88
- Add Resource API.
99
- Add Metrics API.
1010
- Remove support for `min`/`max` in the stats Distribution to make it compatible with Metrics.
1111
- Add Gauges (`DoubleGauge`, `LongGauge`) APIs.
12+
- Remove default prefix from [exporter-prometheus]. This could be a breaking change if you have Prometheus metrics from OpenCensus Prometheus exporter of previous versions, please point to the new metrics with no prefix instead.
1213

1314
## 0.0.7 - 2018-11-12
1415
**Contains API breaking changes for stats/metrics implementations**
1516

16-
- The histogram bucket boundaries (BucketBoundaries) and values (Count and Sum) are no longer supported for negative values. The Record API drops the negative value and logs the warning. This could be a breaking change if you are recording negative value for any measure.
17+
- The histogram bucket boundaries (BucketBoundaries) and values (Count and Sum) are no longer
18+
supported for negative values. The Record API drops the negative value and logs the warning. This could be a breaking change if you are recording negative value for any measure.
1719
- Use setInterval to upload metrics to Stackdriver periodically.
1820
- fix spanId format.
1921

packages/opencensus-core/test/test-view.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ describe('BaseView', () => {
215215
}
216216
const {descriptor, timeseries} = view.getMetric();
217217

218+
before(() => {
219+
process.hrtime = () => [1000, 1e7];
220+
});
221+
218222
describe(
219223
`Aggregation type: ${aggregationTestCase.aggregationType}`, () => {
220224
it('should has descriptor', () => {

packages/opencensus-exporter-prometheus/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# OpenCensus Prometheus Exporter for Node.js
2-
[![Gitter chat][gitter-image]][gitter-url] ![Node Version][node-img] [![NPM Published Version][npm-img]][npm-url]
2+
[![Gitter chat][gitter-image]][gitter-url] ![Node Version][node-img] [![NPM Published Version][npm-img]][npm-url] ![dependencies Status][dependencies-status] ![devDependencies Status][devdependencies-status] ![Apache License][license-image]
33

44
The OpenCensus Prometheus Exporter allows the user to send collected stats with [OpenCensus Node.js](https://github.com/census-instrumentation/opencensus-node) to Prometheus.
55

@@ -75,6 +75,10 @@ With the above you should now be able to navigate to the Prometheus UI at: <http
7575
[npm-url]: https://www.npmjs.com/package/@opencensus/exporter-prometheus
7676
[npm-img]: https://badge.fury.io/js/%40opencensus%2Fexporter-prometheus.svg
7777
[node-img]: https://img.shields.io/node/v/@opencensus/exporter-prometheus.svg
78+
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
79+
[dependencies-status]: https://david-dm.org/census-instrumentation/opencensus-node/status.svg?path=packages/opencensus-exporter-prometheus
80+
[devdependencies-status]:
81+
https://david-dm.org/census-instrumentation/opencensus-node/dev-status.svg?path=packages/opencensus-exporter-prometheus
7882

7983
## LICENSE
8084

0 commit comments

Comments
 (0)