DCA Data Analysis & Reporting 3 — Questions and Answers
Question 1: You want to filter `docker events` to only show events for a specific container image. Which flag do you use?
- --container
- --filter image=<name> (Correct answer)
- --select image=<name>
- --match
Correct answer: --filter image=<name>
`docker events --filter image=<name>` restricts output to events involving that specific image.
Question 2: Which metric is NOT reported by `docker stats`?
- CPU percentage
- Memory usage and limit
- Number of open file descriptors (Correct answer)
- Network I/O
Correct answer: Number of open file descriptors
`docker stats` reports CPU %, memory, network I/O, and block I/O but does not show open file descriptor counts.
Question 3: When using the `gelf` log driver, logs are sent to which type of endpoint?
- Elasticsearch HTTP endpoint
- A Graylog Extended Log Format UDP/TCP endpoint (Correct answer)
- A Redis queue
- Amazon CloudWatch
Correct answer: A Graylog Extended Log Format UDP/TCP endpoint
The `gelf` driver sends logs in Graylog Extended Log Format to a Graylog or compatible GELF endpoint.
Question 4: A container's health check is reporting `unhealthy`. Which command gives you the detailed health check output history?
- docker stats <container>
- docker logs --health <container>
- docker inspect <container> (Correct answer)
- docker events --filter health
Correct answer: docker inspect <container>
`docker inspect` includes a `Health` field with the last five health check results and their output.
Question 5: What format does `docker inspect` use to output container metadata by default?
- YAML
- XML
- JSON (Correct answer)
- TOML
Correct answer: JSON
`docker inspect` outputs container metadata as a JSON array by default.
Question 6: Which command would show how much reclaimable space can be freed by removing unused Docker objects?
- docker system prune --dry-run
- docker system df (Correct answer)
- docker volume ls --size
- docker image ls --dangling
Correct answer: docker system df
`docker system df` shows both total and reclaimable sizes for images, containers, and volumes.
Question 7: To export Prometheus-compatible metrics from the Docker daemon, which configuration option must be enabled?
- "log-driver": "prometheus"
- "experimental": true and "metrics-addr" (Correct answer)
- "metrics": true in daemon.json
- "telemetry": "prometheus"
Correct answer: "experimental": true and "metrics-addr"
Enabling experimental mode and setting `metrics-addr` in `daemon.json` exposes a Prometheus metrics endpoint.
You want to filter `docker events` to only show events for a specific container image.
Which flag do you use?