-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move from prom-client to OpenTelemetry metrics
Signed-off-by: Jessica He <[email protected]>
- Loading branch information
1 parent
096947a
commit 5b9e1f9
Showing
8 changed files
with
1,351 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This is an example configuration file for Prometheus, that is set to scrape | ||
# the metrics endpoint exposed by the example backend. | ||
# | ||
# If you want to run a docker based Prometheus instance locally to try it out, | ||
# run the following command in the Backstage root: | ||
# | ||
# docker run --mount type=bind,source=./packages/backend/prometheus.yml,destination=/etc/prometheus/prometheus.yml --publish published=9090,target=9090,protocol=tcp prom/prometheus | ||
# | ||
# After this, you have a Prometheus instance on http://localhost:9090 | ||
|
||
global: | ||
scrape_interval: 15s | ||
evaluation_interval: 15s | ||
|
||
scrape_configs: | ||
- job_name: 'prometheus' | ||
static_configs: | ||
# This target address specifically works on Docker for MacOS - you may | ||
# need to change it to another host depending on your OS and Docker | ||
# engine. | ||
- targets: ['host.docker.internal:9464'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const { NodeSDK } = require('@opentelemetry/sdk-node'); | ||
const { | ||
getNodeAutoInstrumentations, | ||
} = require('@opentelemetry/auto-instrumentations-node'); | ||
const { | ||
RuntimeNodeInstrumentation, | ||
} = require('@opentelemetry/instrumentation-runtime-node'); | ||
const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus'); | ||
|
||
// Metrics on exported to localhost:9464/metrics | ||
const prometheus = new PrometheusExporter(); | ||
const sdk = new NodeSDK({ | ||
metricReader: prometheus, | ||
instrumentations: [ | ||
getNodeAutoInstrumentations(), | ||
new RuntimeNodeInstrumentation(), | ||
], | ||
}); | ||
|
||
sdk.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export * from './authProvidersModule'; | ||
export * from './rbacDynamicPluginsModule'; | ||
export * from './healthcheck'; | ||
export * from './metrics'; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.