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

Add a monitoring collector #25

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

arifintahu
Copy link

Add support to retrieve metrics from DigitalOcean monitoring agent.

# HELP digitalocean_monitoring_bandwidth Droplet's bandwidth metrics in megabits per second
# TYPE digitalocean_monitoring_bandwidth gauge
digitalocean_monitoring_bandwidth{direction="inbound",id="331890131",interface="private",name="monitoring",region="sgp1"} 3.5e-06
digitalocean_monitoring_bandwidth{direction="inbound",id="331890131",interface="public",name="monitoring",region="sgp1"} 0.08891845
digitalocean_monitoring_bandwidth{direction="inbound",id="335103642",interface="private",name="relayer",region="sgp1"} 4.028776978417266e-06
digitalocean_monitoring_bandwidth{direction="inbound",id="335103642",interface="public",name="relayer",region="sgp1"} 0.48691528057553957
digitalocean_monitoring_bandwidth{direction="outbound",id="331890131",interface="private",name="monitoring",region="sgp1"} 0
digitalocean_monitoring_bandwidth{direction="outbound",id="331890131",interface="public",name="monitoring",region="sgp1"} 0.0102715
digitalocean_monitoring_bandwidth{direction="outbound",id="335103642",interface="private",name="relayer",region="sgp1"} 0
digitalocean_monitoring_bandwidth{direction="outbound",id="335103642",interface="public",name="relayer",region="sgp1"} 0.006332489208633094
# HELP digitalocean_monitoring_cpu Droplet's CPU metrics in seconds
# TYPE digitalocean_monitoring_cpu gauge
digitalocean_monitoring_cpu{id="331890131",mode="idle",name="monitoring",region="sgp1"} 5.13550726e+06
digitalocean_monitoring_cpu{id="331890131",mode="iowait",name="monitoring",region="sgp1"} 2804.8
digitalocean_monitoring_cpu{id="331890131",mode="irq",name="monitoring",region="sgp1"} 0
digitalocean_monitoring_cpu{id="331890131",mode="nice",name="monitoring",region="sgp1"} 576.9
digitalocean_monitoring_cpu{id="331890131",mode="softirq",name="monitoring",region="sgp1"} 362.29999999999995
digitalocean_monitoring_cpu{id="331890131",mode="steal",name="monitoring",region="sgp1"} 3786.93
digitalocean_monitoring_cpu{id="331890131",mode="system",name="monitoring",region="sgp1"} 7947.02
digitalocean_monitoring_cpu{id="331890131",mode="user",name="monitoring",region="sgp1"} 27535.48
digitalocean_monitoring_cpu{id="335103642",mode="idle",name="relayer",region="sgp1"} 1.3431176400000001e+06
digitalocean_monitoring_cpu{id="335103642",mode="iowait",name="relayer",region="sgp1"} 311.35
digitalocean_monitoring_cpu{id="335103642",mode="irq",name="relayer",region="sgp1"} 0
digitalocean_monitoring_cpu{id="335103642",mode="nice",name="relayer",region="sgp1"} 279.19
digitalocean_monitoring_cpu{id="335103642",mode="softirq",name="relayer",region="sgp1"} 280.32
digitalocean_monitoring_cpu{id="335103642",mode="steal",name="relayer",region="sgp1"} 3024.91
digitalocean_monitoring_cpu{id="335103642",mode="system",name="relayer",region="sgp1"} 3412.04
digitalocean_monitoring_cpu{id="335103642",mode="user",name="relayer",region="sgp1"} 15711.099999999999
# HELP digitalocean_monitoring_filesystem_free Droplet's filesystem free metrics in bytes
# TYPE digitalocean_monitoring_filesystem_free gauge
digitalocean_monitoring_filesystem_free{device="/dev/vda1",fstype="ext4",id="331890131",mountpoint="/",name="monitoring",region="sgp1"} 4.8162512896e+10
digitalocean_monitoring_filesystem_free{device="/dev/vda1",fstype="ext4",id="335103642",mountpoint="/",name="relayer",region="sgp1"} 4.7189798912e+10
# HELP digitalocean_monitoring_filesystem_size Droplet's filesystem size metrics in bytes
# TYPE digitalocean_monitoring_filesystem_size gauge
digitalocean_monitoring_filesystem_size{device="/dev/vda1",fstype="ext4",id="331890131",mountpoint="/",name="monitoring",region="sgp1"} 6.2254768128e+10
digitalocean_monitoring_filesystem_size{device="/dev/vda1",fstype="ext4",id="335103642",mountpoint="/",name="relayer",region="sgp1"} 6.2254768128e+10
# HELP digitalocean_monitoring_memory_available Droplet's available memory metrics in bytes
# TYPE digitalocean_monitoring_memory_available gauge
digitalocean_monitoring_memory_available{id="331890131",name="monitoring",region="sgp1"} 1.401225216e+09
digitalocean_monitoring_memory_available{id="335103642",name="relayer",region="sgp1"} 1.463861248e+09
# HELP digitalocean_monitoring_memory_cached Droplet's cached memory metrics in bytes
# TYPE digitalocean_monitoring_memory_cached gauge
digitalocean_monitoring_memory_cached{id="331890131",name="monitoring",region="sgp1"} 1.342271488e+09
digitalocean_monitoring_memory_cached{id="335103642",name="relayer",region="sgp1"} 1.065623552e+09
# HELP digitalocean_monitoring_memory_free Droplet's free memory metrics in bytes
# TYPE digitalocean_monitoring_memory_free gauge
digitalocean_monitoring_memory_free{id="331890131",name="monitoring",region="sgp1"} 1.37990144e+08
digitalocean_monitoring_memory_free{id="335103642",name="relayer",region="sgp1"} 3.16162048e+08
# HELP digitalocean_monitoring_memory_total Droplet's total memory metrics in bytes
# TYPE digitalocean_monitoring_memory_total gauge
digitalocean_monitoring_memory_total{id="331890131",name="monitoring",region="sgp1"} 2.079367168e+09
digitalocean_monitoring_memory_total{id="335103642",name="relayer",region="sgp1"} 2.079367168e+09

@DazWilkin
Copy link
Contributor

Arifin -- Have you tried to contact @metalmatze out-of-band for a review of this PR?

@metalmatze
Copy link
Owner

Oh. This ping is already helpful.
I seem to have somehow missed or forgotten this. I'll take a look.

Copy link
Owner

@metalmatze metalmatze left a comment

Choose a reason for hiding this comment

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

Some metric names should be updated to follow Prometheus naming conventions. That'd be good. Otherwise it looks great!

timeout: timeout,

CPUMetrics: prometheus.NewDesc(
"digitalocean_monitoring_cpu",
Copy link
Owner

Choose a reason for hiding this comment

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

Going with the other Prometheus metrics in the process Exporter this should probably have a _seconds_total suffix.

append(labels, "mode"), nil,
),
MemoryTotalMetrics: prometheus.NewDesc(
"digitalocean_monitoring_memory_total",
Copy link
Owner

Choose a reason for hiding this comment

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

Should probably be bytes_total suffix

labels, nil,
),
MemoryFreeMetrics: prometheus.NewDesc(
"digitalocean_monitoring_memory_free",
Copy link
Owner

Choose a reason for hiding this comment

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

_bytes suffix would be great.

labels, nil,
),
MemoryAvailableMetrics: prometheus.NewDesc(
"digitalocean_monitoring_memory_available",
Copy link
Owner

Choose a reason for hiding this comment

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

_bytes suffix would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants