0
0
Microservicessystem_design~10 mins

Dashboards (Grafana) in Microservices - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the data source type in a Grafana dashboard JSON.

Microservices
{
  "datasources": [
    {
      "name": "MyDataSource",
      "type": "[1]"
    }
  ]
}
Drag options to blanks, or click blank then click option'
Amysql
Bprometheus
Cmongodb
Dredis
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a database type like mysql or mongodb instead of a metrics data source.
2fill in blank
medium

Complete the code to set the panel type to display a time series graph in Grafana.

Microservices
{
  "panels": [
    {
      "type": "[1]",
      "title": "Service Latency"
    }
  ]
}
Drag options to blanks, or click blank then click option'
Astat
Btable
Ctext
Dgraph
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'table' or 'text' which do not show time series graphs.
3fill in blank
hard

Fix the error in the query expression to select the average response time metric.

Microservices
{
  "targets": [
    {
      "expr": "avg([1])"
    }
  ]
}
Drag options to blanks, or click blank then click option'
Aavg_response_time
BresponseTime
Cresponse_time_seconds
Dlatency_ms
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase or incorrect metric names that Prometheus does not recognize.
4fill in blank
hard

Fill both blanks to create a dashboard variable that filters by service name using a regex.

Microservices
{
  "templating": {
    "list": [
      {
        "name": "service",
        "query": "label_values([1], service)",
        "regex": "/[2]/"
      }
    ]
  }
}
Drag options to blanks, or click blank then click option'
Aup
Bhttp_requests_total
C^auth.*
D.*prod$
Attempts:
3 left
💡 Hint
Common Mistakes
Using an incorrect metric name or wrong regex pattern.
5fill in blank
hard

Fill all three blanks to define a panel that shows the 95th percentile latency for a service.

Microservices
{
  "panels": [
    {
      "title": "95th Percentile Latency",
      "type": "graph",
      "targets": [
        {
          "expr": "histogram_quantile([1], sum(rate([2][5m])) by (le, [3]))"
        }
      ]
    }
  ]
}
Drag options to blanks, or click blank then click option'
A0.95
Brequest_latency_seconds_bucket
Cservice
Dinstance
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong quantile values or incorrect metric names.
Grouping by instance instead of service.