Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build & Start containers
run: docker compose up --build --force-recreate --detach
run: |
sudo chmod 666 /var/run/docker.sock
docker compose up --build --force-recreate --detach

- name: Run tests
run: |
Expand All @@ -53,6 +55,8 @@ jobs:
curl --fail http://127.0.0.1:9091/api/v1/query?query=dns_query_result_code | grep dns_query_result_code
curl --fail http://127.0.0.1:9091/api/v1/query?query=ethtool_duplex | grep ethtool_duplex
curl --fail http://127.0.0.1:9091/api/v1/query?query=kernel_boot_time_total | grep kernel_boot_time_total
curl --fail http://127.0.0.1:9091/api/v1/query?query=docker_container_mem_limit | grep docker_container_mem_limit
curl --fail http://127.0.0.1:9091/api/v1/query?query=interrupts_total | grep interrupts_total

- name: Logs
if: always()
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ curl --fail http://127.0.0.1:9091/api/v1/query?query=netstat_tcp_listen | grep n
curl --fail http://127.0.0.1:9091/api/v1/query?query=dns_query_result_code | grep dns_query_result_code
curl --fail http://127.0.0.1:9091/api/v1/query?query=ethtool_duplex | grep ethtool_duplex
curl --fail http://127.0.0.1:9091/api/v1/query?query=kernel_boot_time_total | grep kernel_boot_time_total
curl --fail http://127.0.0.1:9091/api/v1/query?query=docker_container_mem_limit | grep docker_container_mem_limit
curl --fail http://127.0.0.1:9091/api/v1/query?query=interrupts_irq | grep interrupts_irq
```

## Running example
Expand Down
21 changes: 21 additions & 0 deletions config/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@
servers = ["8.8.8.8"]
include_fields = ["all_ips"]

[[inputs.interrupts]]

[[inputs.docker]]

endpoint = "unix:///var/run/docker.sock"
gather_services = false

source_tag = false

container_name_include = []
container_name_exclude = []
container_state_include = ["created", "restarting", "running", "removing", "paused", "exited", "dead"]
timeout = "5s"
total = false

docker_label_include = []
docker_label_exclude = []

## Which environment variables should we use as a tag
tag_env = ["JAVA_HOME", "HEAP_SIZE"]

[[outputs.file]]
files = ["stdout"]
data_format = "influx"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ services:
volumes:
- /:/hostfs:ro
- ./config/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/run/docker.sock:/var/run/docker.sock
environment:
- HOST_MOUNT_PREFIX=/hostfs
- HOST_PROC=/hostfs/proc
Expand Down