Add a logs dashboard to Kibana

View your microservice logs in kibana and add a custom dashboard

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

Build a Kibana dashboard

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

Note: the withSlowMongoQuery() snippet adds a panel that surfaces slow MongoDB queries. Remove it if you don’t need this.

Test locally that your dashboard was generated

  1. In a terminal, run:
    sbt "run production"
  2. Verify a JSON file exists for your microservice:
    ls target/output/dashboard/<microservice-name>.json

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:

kibana-dashboards-pipeline (Jenkins)

Kibana URLs

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

Check you’ve completed this step successfully

  1. Open the Kibana URL for your environment.
  2. Use the burger menu (top left) and open Analytics.
  3. Select Dashboard.
  4. Search for your digital service name and open the 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 logs dashboard to Kibana

View your microservice logs in kibana and add a custom dashboard

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

Build a Kibana dashboard

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

Note: the withSlowMongoQuery() snippet adds a panel that surfaces slow MongoDB queries. Remove it if you don’t need this.

Test locally that your dashboard was generated

  1. In a terminal, run:
    sbt "run production"
  2. Verify a JSON file exists for your microservice:
    ls target/output/dashboard/<microservice-name>.json

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:

kibana-dashboards-pipeline (Jenkins)

Kibana URLs

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

Check you’ve completed this step successfully

  1. Open the Kibana URL for your environment.
  2. Use the burger menu (top left) and open Analytics.
  3. Select Dashboard.
  4. Search for your digital service name and open the 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 logs dashboard to Kibana

View your microservice logs in kibana and add a custom dashboard

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

Build a Kibana dashboard

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

Note: the withSlowMongoQuery() snippet adds a panel that surfaces slow MongoDB queries. Remove it if you don’t need this.

Test locally that your dashboard was generated

  1. In a terminal, run:
    sbt "run production"
  2. Verify a JSON file exists for your microservice:
    ls target/output/dashboard/<microservice-name>.json

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:

kibana-dashboards-pipeline (Jenkins)

Kibana URLs

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

Check you’ve completed this step successfully

  1. Open the Kibana URL for your environment.
  2. Use the burger menu (top left) and open Analytics.
  3. Select Dashboard.
  4. Search for your digital service name and open the 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.