Challenge - 5 Problems
Grafana Dashboard Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of this Docker command for Grafana container logs?
You run the command
What will be the exact output of the command?
docker logs grafana_container --tail 3. The last three log lines are:t=2024-06-01T12:00:00Z lvl=info msg="Starting Grafana"
t=2024-06-01T12:00:01Z lvl=info msg="HTTP Server Listen"
t=2024-06-01T12:00:02Z lvl=warn msg="Data source not found"What will be the exact output of the command?
Docker
docker logs grafana_container --tail 3
Attempts:
2 left
💡 Hint
The --tail option limits the number of log lines shown, but the output includes full log lines.
✗ Incorrect
The command shows the last 3 log lines exactly as they appear in the container logs. Option B matches all three lines with timestamps and levels.
❓ Configuration
intermediate2:00remaining
Which Docker Compose snippet correctly sets up Grafana with Prometheus as a data source?
You want to run Grafana and Prometheus containers together. Grafana should connect to Prometheus at
http://prometheus:9090. Which Docker Compose service configuration for Grafana is correct?Docker
version: '3.8' services: prometheus: image: prom/prometheus ports: - 9090:9090 grafana: image: grafana/grafana ports: - 3000:3000 environment: - GF_SECURITY_ADMIN_PASSWORD=admin depends_on: - prometheus # Which environment variable below correctly sets Prometheus as data source URL?
Attempts:
2 left
💡 Hint
Grafana uses environment variables starting with GF_DATASOURCE_ to configure data sources.
✗ Incorrect
The correct environment variable to set Prometheus URL as a data source is GF_DATASOURCE_PROMETHEUS_URL. Option A sets this correctly.
🔀 Workflow
advanced2:30remaining
What is the correct order to create a Grafana dashboard for Docker container metrics?
Arrange these steps in the correct order to set up a Grafana dashboard that shows Docker container CPU and memory usage:
Attempts:
2 left
💡 Hint
You need data collection before adding data source and dashboards.
✗ Incorrect
First, Prometheus with Docker metrics exporter must run to collect data. Then add Prometheus as Grafana data source. Next create dashboard and add panels with queries.
❓ Troubleshoot
advanced2:00remaining
Why does Grafana show 'Data source not found' error for Prometheus?
You have Grafana and Prometheus running in Docker containers. Grafana shows an error:
Data source not found when trying to load Prometheus metrics. Which is the most likely cause?Attempts:
2 left
💡 Hint
Grafana needs network access to Prometheus to find the data source.
✗ Incorrect
If Prometheus is not running or Grafana cannot reach it, Grafana will show 'Data source not found'. Other options do not cause this error.
✅ Best Practice
expert3:00remaining
Which practice is best for maintaining Grafana dashboards for multiple Docker environments?
You manage Grafana dashboards for several Docker environments (dev, staging, production). What is the best practice to keep dashboards consistent and easy to update?
Attempts:
2 left
💡 Hint
Think about automation and tracking changes.
✗ Incorrect
Exporting dashboards as JSON and managing them with version control allows easy updates, sharing, and rollback. Manual edits or no backups risk inconsistency and loss.