Add a metrics dashboard to Grafana

View your microservice metrics in Grafana and add a custom dashboard using the MDTP DSL.

Tip: pull the latest changes before you start. git checkout main && git pull

Build a Grafana dashboard

  1. Create a feature branch in the grafana-dashboards repository.
  2. Create a Scala file (or use an existing file) inside the dashboards folder and add your digital service. This file contains your dashboard definition. The path is:
    grafana-dashboards/src/main/scala/uk/gov/hmrc/grafanadashboards/dashboards
  3. In that Scala file, create an object that extends DigitalService. Replace the placeholders and remove angle brackets:
    • <MyDigitalService>
    • <my-digital-service>
    • <microservice-name>
    • <MicroserviceDeploymentZone>
    object <MyDigitalService> extends DigitalService(
      digitalServiceDashboard("<MyDigitalService>", List("<microservice-name>", "<microservice-name>")),
      microserviceDashboard(microservice("<microservice-name>"), <MicroserviceDeploymentZone>),
      microserviceDashboard(microservice("<microservice-name>"), <MicroserviceDeploymentZone>)
    )

Test locally that your dashboard was generated

  1. Generate dashboards:
    sbt run
  2. Verify output files exist:
    ls target/output/grafana

Merge and deploy

Raise a pull request and get it reviewed/approved. After merge, the Jenkins job below generates and deploys the dashboards to each environment:

grafana-dashboards-pipeline (Jenkins)

Grafana URLs

EnvironmentGrafana URL
Developmenthttps://grafana.mdtp-development.telemetry.tax.service.gov.uk/
QAhttps://grafana.mdtp-qa.telemetry.tax.service.gov.uk/
Staginghttps://grafana.mdtp-staging.telemetry.tax.service.gov.uk/
External testhttps://grafana.mdtp-externaltest.telemetry.tax.service.gov.uk/
Productionhttps://grafana.mdtp-production.telemetry.tax.service.gov.uk/

Check you’ve completed this step successfully

Open the relevant Grafana environment above and search for your microservice dashboard.


Need support?

Ask in #team-telemetry on Slack.

Got feedback?

We’re always improving our documentation. Share your feedback using the team channel above.

Add a metrics dashboard to Grafana

View your microservice metrics in Grafana and add a custom dashboard using the MDTP DSL.

Tip: pull the latest changes before you start. git checkout main && git pull

Build a Grafana dashboard

  1. Create a feature branch in the grafana-dashboards repository.
  2. Create a Scala file (or use an existing file) inside the dashboards folder and add your digital service. This file contains your dashboard definition. The path is:
    grafana-dashboards/src/main/scala/uk/gov/hmrc/grafanadashboards/dashboards
  3. In that Scala file, create an object that extends DigitalService. Replace the placeholders and remove angle brackets:
    • <MyDigitalService>
    • <my-digital-service>
    • <microservice-name>
    • <MicroserviceDeploymentZone>
    object <MyDigitalService> extends DigitalService(
      digitalServiceDashboard("<MyDigitalService>", List("<microservice-name>", "<microservice-name>")),
      microserviceDashboard(microservice("<microservice-name>"), <MicroserviceDeploymentZone>),
      microserviceDashboard(microservice("<microservice-name>"), <MicroserviceDeploymentZone>)
    )

Test locally that your dashboard was generated

  1. Generate dashboards:
    sbt run
  2. Verify output files exist:
    ls target/output/grafana

Merge and deploy

Raise a pull request and get it reviewed/approved. After merge, the Jenkins job below generates and deploys the dashboards to each environment:

grafana-dashboards-pipeline (Jenkins)

Grafana URLs

EnvironmentGrafana URL
Developmenthttps://grafana.mdtp-development.telemetry.tax.service.gov.uk/
QAhttps://grafana.mdtp-qa.telemetry.tax.service.gov.uk/
Staginghttps://grafana.mdtp-staging.telemetry.tax.service.gov.uk/
External testhttps://grafana.mdtp-externaltest.telemetry.tax.service.gov.uk/
Productionhttps://grafana.mdtp-production.telemetry.tax.service.gov.uk/

Check you’ve completed this step successfully

Open the relevant Grafana environment above and search for your microservice dashboard.


Need support?

Ask in #team-telemetry on Slack.

Got feedback?

We’re always improving our documentation. Share your feedback using the team channel above.

Add a metrics dashboard to Grafana

View your microservice metrics in Grafana and add a custom dashboard using the MDTP DSL.

Tip: pull the latest changes before you start. git checkout main && git pull

Build a Grafana dashboard

  1. Create a feature branch in the grafana-dashboards repository.
  2. Create a Scala file (or use an existing file) inside the dashboards folder and add your digital service. This file contains your dashboard definition. The path is:
    grafana-dashboards/src/main/scala/uk/gov/hmrc/grafanadashboards/dashboards
  3. In that Scala file, create an object that extends DigitalService. Replace the placeholders and remove angle brackets:
    • <MyDigitalService>
    • <my-digital-service>
    • <microservice-name>
    • <MicroserviceDeploymentZone>
    object <MyDigitalService> extends DigitalService(
      digitalServiceDashboard("<MyDigitalService>", List("<microservice-name>", "<microservice-name>")),
      microserviceDashboard(microservice("<microservice-name>"), <MicroserviceDeploymentZone>),
      microserviceDashboard(microservice("<microservice-name>"), <MicroserviceDeploymentZone>)
    )

Test locally that your dashboard was generated

  1. Generate dashboards:
    sbt run
  2. Verify output files exist:
    ls target/output/grafana

Merge and deploy

Raise a pull request and get it reviewed/approved. After merge, the Jenkins job below generates and deploys the dashboards to each environment:

grafana-dashboards-pipeline (Jenkins)

Grafana URLs

EnvironmentGrafana URL
Developmenthttps://grafana.mdtp-development.telemetry.tax.service.gov.uk/
QAhttps://grafana.mdtp-qa.telemetry.tax.service.gov.uk/
Staginghttps://grafana.mdtp-staging.telemetry.tax.service.gov.uk/
External testhttps://grafana.mdtp-externaltest.telemetry.tax.service.gov.uk/
Productionhttps://grafana.mdtp-production.telemetry.tax.service.gov.uk/

Check you’ve completed this step successfully

Open the relevant Grafana environment above and search for your microservice dashboard.


Need support?

Ask in #team-telemetry on Slack.

Got feedback?

We’re always improving our documentation. Share your feedback using the team channel above.