Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhance the demo with disk telemetries #139

Merged
merged 1 commit into from
Jun 26, 2024
Merged

feat: enhance the demo with disk telemetries #139

merged 1 commit into from
Jun 26, 2024

Conversation

Kevin222004
Copy link
Contributor

Part of #5

I have added the disk telemetry. https://github.com/influxdata/telegraf/tree/master/plugins/inputs/disk

Testing data that it works

$ cd config                                                                           
               
 [~/Desktop/opi/otel/config]
$ telegraf --config telegraf.conf > telegraph.txt 
                            
                            
 [~/Desktop/opi/otel/config]
 $ cat telegraph.txt | grep disk
disk,device=nvme0n1p2,fstype=ext4,host=kevin-Inspiron-15-5510,mode=rw,path=/ inodes_free=27164985i,inodes_used=4030151i,inodes_used_percent=12.919164705677193,total=501809635328i,free=235259224064i,used=240984608768i,used_percent=50.60109804151729,inodes_total=31195136i 1719322320000000000
disk,device=efivarfs,fstype=efivarfs,host=kevin-Inspiron-15-5510,mode=rw,path=/sys/firmware/efi/efivars used_percent=69.72437234617055,inodes_total=0i,inodes_free=0i,inodes_used=0i,inodes_used_percent=0,total=382876i,free=114368i,used=263388i 1719322320000000000
disk,device=nvme0n1p1,fstype=vfat,host=kevin-Inspiron-15-5510,mode=rw,path=/boot/efi inodes_total=0i,inodes_free=0i,inodes_used=0i,inodes_used_percent=0,total=1124999168i,free=1060528128i,used=64471040i,used_percent=5.730763349328984 1719322320000000000
disk,device=nvme0n1p2,fstype=ext4,host=kevin-Inspiron-15-5510,mode=rw,path=/ free=235259174912i,used=240984657920i,used_percent=50.601108362280854,inodes_total=31195136i,inodes_free=27164985i,inodes_used=4030151i,inodes_used_percent=12.919164705677193,total=501809635328i 1719322330000000000
disk,device=efivarfs,fstype=efivarfs,host=kevin-Inspiron-15-5510,mode=rw,path=/sys/firmware/efi/efivars inodes_used_percent=0,total=382876i,free=114368i,used=263388i,used_percent=69.72437234617055,inodes_total=0i,inodes_free=0i,inodes_used=0i 1719322330000000000
disk,device=nvme0n1p1,fstype=vfat,host=kevin-Inspiron-15-5510,mode=rw,path=/boot/efi free=1060528128i,used=64471040i,used_percent=5.730763349328984,inodes_total=0i,inodes_free=0i,inodes_used=0i,inodes_used_percent=0,total=1124999168i 1719322330000000000
disk,device=nvme0n1p2,fstype=ext4,host=kevin-Inspiron-15-5510,mode=rw,path=/ inodes_free=27164985i,inodes_used=4030151i,inodes_used_percent=12.919164705677193,total=501809635328i,free=235259154432i,used=240984678400i,used_percent=50.601112662599014,inodes_total=31195136i 1719322340000000000
disk,device=efivarfs,fstype=efivarfs,host=kevin-Inspiron-15-5510,mode=rw,path=/sys/firmware/efi/efivars used=263388i,used_percent=69.72437234617055,inodes_total=0i,inodes_free=0i,inodes_used=0i,inodes_used_percent=0,total=382876i,free=114368i 1719322340000000000
disk,device=nvme0n1p1,fstype=vfat,host=kevin-Inspiron-15-5510,mode=rw,path=/boot/efi used=64471040i,used_percent=5.730763349328984,inodes_total=0i,inodes_free=0i,inodes_used=0i,inodes_used_percent=0,total=1124999168i,free=1060528128i 1719322340000000000

@Kevin222004 Kevin222004 requested a review from a team as a code owner June 25, 2024 13:51
Copy link
Member

@glimchb glimchb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @Kevin222004 for the contribution

please fix https://commitlint.js.org/ checker failing

please also add curl call here to test we actually getting correct metrics :

curl --fail http://127.0.0.1:9091/api/v1/query?query=nginx_requests | grep nginx_requests

and also same here, just for documentation:

otel/README.md

Line 115 in f161093

curl --fail http://127.0.0.1:9091/api/v1/query?query=nginx_requests | grep nginx_requests

also when runnign in docker, we need to document for this specific disc plugin we need to fix hostfs like this
and fix compose

otel/docker-compose.yml

Lines 43 to 44 in f161093

volumes:
- ./config/telegraf.conf:/etc/telegraf/telegraf.conf:ro

, for example:

  telegraf:
    image: docker.io/library/telegraf:1.29
    volumes:
      - /:/hostfs:ro
      - ./config/telegraf.conf:/etc/telegraf/telegraf.conf:ro
    environment:
      HOST_MOUNT_PREFIX: /hostfs
      HOST_PROC: /hostfs/proc

Copy link
Member

@glimchb glimchb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

@Kevin222004
Copy link
Contributor Author

@glimchb Thanks for reviewing.

I have updated the readme, added curl command for testing and added volume and env in docker-compose.

docker-compose.yml Outdated Show resolved Hide resolved
@Kevin222004 Kevin222004 changed the title monitoring: enhance the demo with disk telemetries feat: enhance the demo with disk telemetries Jun 26, 2024
Copy link
Member

@glimchb glimchb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from CI i see:

+ curl --fail 'http://127.0.0.1:9091/api/v1/query?query=disk_used_percent'
+ grep disk_used_percent
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1069  100  1069    0     0   927k      0 --:--:-- --:--:-- --:--:-- 1043k
{"status":"success","data":{"resultType":"vector","result":[{"metric":{"__name__":"disk_used_percent","device":"nsfs","fstype":"nsfs","host":"36a8694974a0","instance":"otel-gw-collector:8889","job":"otel-collector","label1":"value1","mode":"rw","path":"/run/snapd/ns/lxd.mnt"},"value":[1719420750.837,"0.054752331251604065"]},{"metric":{"__name__":"disk_used_percent","device":"sda1","fstype":"ext4","host":"36a8694974a0","instance":"otel-gw-collector:8889","job":"otel-collector","label1":"value1","mode":"rw","path":"/"},"value":[1719420750.837,"74.89278022464133"]},{"metric":{"__name__":"disk_used_percent","device":"sda15","fstype":"vfat","host":"36a8694974a0","instance":"otel-gw-collector:8889","job":"otel-collector","label1":"value1","mode":"rw","path":"/boot/efi"},"value":[1719420750.837,"5.789958954053813"]},{"metric":{"__name__":"disk_used_percent","device":"sdb1","fstype":"ext4","host":"36a8694974a0","instance":"otel-gw-collector:8889","job":"otel-collector","label1":"value1","mode":"rw","path":"/mnt"},"

looks good

@glimchb glimchb added the Merge Candidate in the open merge window, next candidate for merge label Jun 26, 2024
@glimchb glimchb merged commit 4316536 into opiproject:main Jun 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merge Candidate in the open merge window, next candidate for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants