Skip to content

Conversation

@JiahuiWho
Copy link
Contributor

  • metrics endpoints and the environment variables
  • steps to launch the bundled Prometheus + Grafana stack
  • instructions for importing Grafana dashboard JSON or wiring into user's own.
  • links to Grafana README.md that explains metrics

@stellar-jenkins
Copy link

Copy link
Contributor

@philipliu philipliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


Both the Dashboard API and the Transaction Submission Service (TSS) expose Prometheus-compatible `/metrics` endpoints. The HTTP server is defined in `internal/serve/serve_metrics.go` and is controlled through the following environment variables:

- `METRICS_PORT` – Port used by the Dashboard API metrics server (defaults to [8002](https://github.com/stellar/stellar-disbursement-platform-backend/blob/develop/dev/docker-compose-sdp.yml)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the port that Prometheus will scrape the metrics from, right?

Copy link
Contributor Author

@JiahuiWho JiahuiWho Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. METRICS_PORT is the port where the Dashboard API exposes its /metrics endpoint, and that’s the same port Prometheus scrapes (see prometheus here, which targets host.docker.internal:8002/metrics by default).

- `METRICS_PORT` – Port used by the Dashboard API metrics server (defaults to [8002](https://github.com/stellar/stellar-disbursement-platform-backend/blob/develop/dev/docker-compose-sdp.yml)).
- `METRICS_TYPE` – Monitoring backend in use (currently `PROMETHEUS`).
- `TSS_METRICS_PORT` – Port used by the TSS metrics server (defaults to [9002](https://github.com/stellar/stellar-disbursement-platform-backend/blob/develop/dev/docker-compose-tss.yml)).
- `TSS_METRICS_TYPE` – Monitoring backend for the TSS (defaults to `TSS_PROMETHEUS`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should rename this to PROMETHEUS for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TSS_METRICS_TYPE is currently TSS_PROMETHEUS because that’s the value the CLI, env vars, and Helm chart expect. Renaming it to PROMETHEUS would require code/config changes, so the doc needs to reflect the existing TSS_PROMETHEUS name until that work happens.


### Integrating with External Prometheus Instances

If you already operate a Prometheus cluster, add scrape jobs equivalent to the ones in [prometheus config](https://github.com/stellar/stellar-disbursement-platform-backend/blob/develop/dev/prometheus/prometheus.yml). Each subsystem exposes metrics at `http://<host>:<METRICS_PORT>/metrics` (Dashboard API) and `http://<host>:<TSS_METRICS_PORT>/metrics` (TSS). [Helm](https://github.com/stellar/stellar-disbursement-platform-backend/blob/develop/helmchart/sdp/values.yaml) deployments expose the same configuration knobs through `sdp.configMap.data.METRICS_*` and `tss.configMap.data.TSS_METRICS_*`. Once the new jobs are present, you can import the same dashboard JSON into your existing Grafana deployment or adapt the PromQL queries to your preferred observability suite.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the new jobs are present

What does this mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you already run Prometheus elsewhere, add equivalent scrape jobs (one for the Dashboard API /metrics endpoint on METRICS_PORT, and optionally another for the TSS endpoint on TSS_METRICS_PORT). After you’ve added those jobs to your own prometheus.yml, you can import the Grafana dashboard JSON and it will work because Prometheus now collects the same metrics the dashboard expects.

@stellar-jenkins
Copy link

@JiahuiWho JiahuiWho merged commit 8891792 into docpoc-sdp-main Nov 24, 2025
3 checks passed
@JiahuiWho JiahuiWho deleted the docpoc-sdp-monitoring branch November 24, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants