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
- Create a feature branch in the kibana-dashboards repository for your changes.
- 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
- 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
- In a terminal, run:
sbt "run production"
- 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
Check you’ve completed this step successfully
- Open the Kibana URL for your environment.
- Use the burger menu (top left) and open Analytics.
- Select Dashboard.
- 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
- Create a feature branch in the kibana-dashboards repository for your changes.
- 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
- 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
- In a terminal, run:
sbt "run production"
- 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
Check you’ve completed this step successfully
- Open the Kibana URL for your environment.
- Use the burger menu (top left) and open Analytics.
- Select Dashboard.
- 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
- Create a feature branch in the kibana-dashboards repository for your changes.
- 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
- 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
- In a terminal, run:
sbt "run production"
- 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
Check you’ve completed this step successfully
- Open the Kibana URL for your environment.
- Use the burger menu (top left) and open Analytics.
- Select Dashboard.
- 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.