sensu-plugins / sensu-plugins-docker

This plugin provides native Docker instrumentation for monitoring and metrics collection, including: container status, container number, and container metrics via `docker ps`.
http://sensu-plugins.io
MIT License
35 stars 57 forks source link

add basic ability to split a docker name #50

Closed jameslegg closed 7 years ago

jameslegg commented 7 years ago

Pull Request Checklist

General

Purpose

We use long docker names such as:

ecs-fc-prod-deploy-for-periodic_task_agent-4-deploy-for-alteration16-periodictaskagent-b2ffdab8f1aceae85300

This enables the metrics plugin to split the names on a delimiter and output stats in a potentially more useful namespace.

$ ./metrics-docker-stats.rb --scheme sensu.docker -p unix -H /var/run/docker.sock -m 5

sensu.docker.periodic_task_agent.networks.eth0.rx_packets 52281 1494943538
jameslegg commented 7 years ago

I've updated as requested. Please let me know if you would like any other changes. Thank you for taking a look.

majormoses commented 7 years ago

@jameslegg sorry if it was unclear we need a changelog entry so add back everything you had under Added

jameslegg commented 7 years ago

ah I understand know, makes more sense. I've added that back, let me know if you would like anything else. Thanks once again for helping.

majormoses commented 7 years ago

@jameslegg ping me if I do not release within 24 hours.

majormoses commented 7 years ago

sorry I forgot to circle back and do a release, I just released: https://rubygems.org/gems/sensu-plugins-docker/versions/1.3.0 which includes your changes.