-
Run Docker container:
docker run --name sleepy-busybox -d busybox sleep infinity
-
Read the Docker Stats Receiver documentation
-
Add the
docker_statsreceiver to the config.yaml file. Set thecollection_intervalto 3s. -
Run otelcol-contrib for a short amount of time, you should see metrics coming in with the similar log line:
2022-05-21T19:01:37.982+0200 INFO loggingexporter/logging_exporter.go:56 MetricsExporter {"#metrics": 53} -
Open the newly created
metrics.jsonfile with the text editor of your choice. See what metrics have been collected. -
Run second container which is based on Ubuntu this time:
docker run --name sleepy-ubuntu -d ubuntu sleep infinity
-
Again run
otelcol-contribfor a short amount of time, collect some metrics. -
Open the
metrics.jsonfile. Notice if you have metrics about both containers. -
Change the config.yaml file by adding the
exclude_imageskey. Exclude thebusyboximages. Runotelcol-contribfor some time. -
Open the
metrics.jsonfile. Notice that metrics about thebusyboximage based container were not collected. -
Remove both running containers:
docker rm -f sleepy-ubuntu sleepy-busybox
dockerstats
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||