Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Fix Custom Metrics Documentation
Browse files Browse the repository at this point in the history
The documentation for custom metrics contained an error in the
Prometheus metrics example JSON, and was also somewhat unclear
as to how the labels worked.
  • Loading branch information
DirectXMan12 committed Dec 10, 2015
1 parent d11dd29 commit 89e656d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docs/application_metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,18 @@ Another sample config that collects only selected metrics:
{
"endpoint" : "http://localhost:8000/metrics",
"metrics_config" : [
{
"scheduler_binding_latency",
"scheduler_e2e_scheduling_latency",
"scheduling_algorithm_latency"
}
"scheduler_binding_latency",
"scheduler_e2e_scheduling_latency",
"scheduling_algorithm_latency"
]
}
```

## Passing the configuration to cAdvisor

cAdvisor can discover any configurations for a container using Docker labels. Any label starting with ```io.cadvisor.metric``` is parsed as a cadvisor application-metric label.
cAdvisor uses the value as an indicator of where the configuration can be found.
cAdvisor can discover any configurations for a container using Docker container labels. Any label starting with ```io.cadvisor.metric``` is parsed as a cadvisor application-metric label.
cAdvisor uses the value as an indicator of where the configuration can be found. Labels of the form ```io.cadvisor.metric.prometheus-xyz``` indicate that the configuration points to a
Prometheus metrics endpoint.

The configuration file can either be part of the container image or can be added on at runtime with a volume. This makes sure that there is no connection between the host where the container is running and the application metrics configuration. A container is self-contained for its metric information.

Expand All @@ -88,6 +87,9 @@ Dockerfile (or runtime):

cAdvisor will then reach into the container image at runtime, process the config, and start collecting and exposing application metrics.

Note that cAdvisor specifically looks at the container labels to extract this information. In Docker 1.8, containers don't inherit labels
from their images, and thus you must specify the label at runtime.

## API access to application-specific metrics

A new endpoint is added for collecting application-specific metrics for a particular container:
Expand Down

0 comments on commit 89e656d

Please sign in to comment.