https://github.com/marcbachmann/opentelemetry-node-metrics
https://github.com/marcbachmann/opentelemetry-node-metrics
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/marcbachmann/opentelemetry-node-metrics
- Owner: marcbachmann
- License: apache-2.0
- Created: 2020-12-25T04:23:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:54:12.000Z (over 2 years ago)
- Last Synced: 2024-12-28T10:31:02.763Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 66.4 KB
- Stars: 11
- Watchers: 4
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# opentelemetry-node-metrics
This module is an adoption of the metric set of [`prom-client`](https://www.npmjs.com/package/prom-client) for [`@opentelemetry/metrics`](https://www.npmjs.com/package/@opentelemetry/metrics).
There's no node cluster support as `@opentelemetry/metrics` doesn't support it.
### Usage
```js
const {MeterProvider} = require('@opentelemetry/metrics');
const {PrometheusExporter} = require('@opentelemetry/exporter-prometheus');
const exporter = new PrometheusExporter({startServer: true}, () => {
console.log(
`prometheus scrape endpoint: http://localhost:${PrometheusExporter.DEFAULT_OPTIONS.port}${PrometheusExporter.DEFAULT_OPTIONS.endpoint}`,
)
})
const meterProvider = new MeterProvider({
exporter,
interval: 2000,
})
require('./index')(meterProvider)
```
## License
This project heavily relies on code from https://github.com/siimon/prom-client
and therefore I'd like to thank to all the contributors.
The `prom-client` project is using an APACHE v2.0 LICENSE and threfore it's best to apply the same license to this project.
This module is only a proof of concept to get opentelemetry to work with the metrics support of `prom-client`.