Merge pull request #26035 from awanlin/docs/refactor-otel-and-prom

Updated Prometheus and OpenTelemetry Guides
This commit is contained in:
Andre Wanlin
2024-08-15 11:18:56 -05:00
committed by GitHub
2 changed files with 25 additions and 0 deletions
@@ -1,5 +1,8 @@
# Prometheus
> [!NOTE]
> The Prometheus metrics have been marked as deprecated and will be removed at a later point. The recommendation is to use the OpenTelemetry metrics by following the [Setup OpenTelemetry](https://backstage.io/docs/tutorials/setup-opentelemetry) documentation
## Overview
This is a small tutorial that goes over how to setup your Backstage instance to output metrics in a format that can be pulled in by Prometheus.
+22
View File
@@ -83,6 +83,28 @@ CMD ["node", "--require", "./instrumentation.js", "packages/backend", "--config"
If you need to disable/configure some OpenTelemetry feature there are lots of [environment variables](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/) which you can tweak.
### Available Metrics
The following metrics are available:
- `catalog_entities_count`: Total amount of entities in the catalog
- `catalog_registered_locations_count`: Total amount of registered locations in the catalog
- `catalog_relations_count`: Total amount of relations between entities
- `catalog.processed.entities.count`: Amount of entities processed
- `catalog.processing.duration`: Time spent executing the full processing flow
- `catalog.processors.duration`: Time spent executing catalog processors
- `catalog.processing.queue.delay`: The amount of delay between being scheduled for processing, and the start of actually being processed
- `catalog.stitched.entities.count`: Amount of entities stitched
- `catalog.stitching.duration`: Time spent executing the full stitching flow
- `catalog.stitching.queue.length`: Number of entities currently in the stitching queue
- `catalog.stitching.queue.delay`: The amount of delay between being scheduled for stitching, and the start of actually being stitched
- `scaffolder.task.count`: Count of task runs
- `scaffolder.task.duration`: Duration of a task run
- `scaffolder.step.count`: Count of step runs
- `scaffolder.step.duration`: Duration of a step runs
- `backend_tasks.task.runs.count`: Total number of times a task has been run
- `backend_tasks.task.runs.duration`: Histogram of task run durations
## References
- [Getting started with OpenTelemetry Node.js](https://opentelemetry.io/docs/instrumentation/js/getting-started/nodejs/)