Skip to content

Commit 9e982f2

Browse files
feat: adding docker and interrupts
Signed-off-by: Mohamed Asif <142201466+mohamedasifs123@users.noreply.github.com> fix: fixing curl Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com> fix: fixing curl Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com> feat: giving access to docker socket Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com> feat: adding query examples Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com> feat: adding query examples Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com> feat: adding volume for docker on telegraf Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com> feat: adding docker and interrupts metrics Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>
1 parent e95eb91 commit 9e982f2

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

.github/workflows/docker-publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
uses: docker/setup-buildx-action@v3
3131

3232
- name: Build & Start containers
33-
run: docker compose up --build --force-recreate --detach
33+
run: |
34+
sudo chmod 666 /var/run/docker.sock
35+
docker compose up --build --force-recreate --detach
3436
3537
- name: Run tests
3638
run: |
@@ -53,6 +55,8 @@ jobs:
5355
curl --fail http://127.0.0.1:9091/api/v1/query?query=dns_query_result_code | grep dns_query_result_code
5456
curl --fail http://127.0.0.1:9091/api/v1/query?query=ethtool_duplex | grep ethtool_duplex
5557
curl --fail http://127.0.0.1:9091/api/v1/query?query=kernel_boot_time_total | grep kernel_boot_time_total
58+
curl --fail http://127.0.0.1:9091/api/v1/query?query=docker_container_mem_limit | grep docker_container_mem_limit
59+
curl --fail http://127.0.0.1:9091/api/v1/query?query=interrupts_total | grep interrupts_total
5660
5761
- name: Logs
5862
if: always()

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ curl --fail http://127.0.0.1:9091/api/v1/query?query=netstat_tcp_listen | grep n
119119
curl --fail http://127.0.0.1:9091/api/v1/query?query=dns_query_result_code | grep dns_query_result_code
120120
curl --fail http://127.0.0.1:9091/api/v1/query?query=ethtool_duplex | grep ethtool_duplex
121121
curl --fail http://127.0.0.1:9091/api/v1/query?query=kernel_boot_time_total | grep kernel_boot_time_total
122+
curl --fail http://127.0.0.1:9091/api/v1/query?query=docker_container_mem_limit | grep docker_container_mem_limit
123+
curl --fail http://127.0.0.1:9091/api/v1/query?query=interrupts_irq | grep interrupts_irq
122124
```
123125

124126
## Running example

config/telegraf.conf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,27 @@
4949
servers = ["8.8.8.8"]
5050
include_fields = ["all_ips"]
5151

52+
[[inputs.interrupts]]
53+
54+
[[inputs.docker]]
55+
56+
endpoint = "unix:///var/run/docker.sock"
57+
gather_services = false
58+
59+
source_tag = false
60+
61+
container_name_include = []
62+
container_name_exclude = []
63+
container_state_include = ["created", "restarting", "running", "removing", "paused", "exited", "dead"]
64+
timeout = "5s"
65+
total = false
66+
67+
docker_label_include = []
68+
docker_label_exclude = []
69+
70+
## Which environment variables should we use as a tag
71+
tag_env = ["JAVA_HOME", "HEAP_SIZE"]
72+
5273
[[outputs.file]]
5374
files = ["stdout"]
5475
data_format = "influx"

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ services:
4343
volumes:
4444
- /:/hostfs:ro
4545
- ./config/telegraf.conf:/etc/telegraf/telegraf.conf:ro
46+
- /var/run/docker.sock:/var/run/docker.sock
4647
environment:
4748
- HOST_MOUNT_PREFIX=/hostfs
4849
- HOST_PROC=/hostfs/proc

0 commit comments

Comments
 (0)