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

Multiple Collector instances #39

Closed
pablolb opened this issue Mar 6, 2012 · 6 comments
Closed

Multiple Collector instances #39

pablolb opened this issue Mar 6, 2012 · 6 comments

Comments

@pablolb
Copy link
Contributor

pablolb commented Mar 6, 2012

Hi,

Today I was trying to setup Diamond to collect data from several servers, each containing multiple instances of memcached.

I cannot see how to accomplish this right now, as the collectors are added to a dict with their class name as key.

I have created a branch in my fork with a solution: https://github.com/pablolb/Diamond/tree/multiple-collector-instances.

But maybe you have a workaround or you'd prefer a better way to solve this...?

In the first commit (pablolb@f2397aa) I scan collectors config directory and schedule new instances of the collector.

In the second commit, I use MemcachedCollector as an example as how this can be used... I've seen this used in Genttoo network scripts I think (using symlinks and interpreting the actual name)

pablo@localhost collectors $ ls -l
total 4
-rw-r--r-- 1 root root 61 Mar  5 22:40 MemcachedCollector.conf
lrwxrwxrwx 1 root root 23 Mar  5 22:40 MemcachedCollector-localhost:11212.conf -> MemcachedCollector.conf

pablo@localhost collectors $ cat MemcachedCollector.conf

enabled=True
override_hostname=True
custom_name_is_host=True
@kormoc
Copy link
Contributor

kormoc commented Mar 6, 2012

Yes, Gentoo uses that way for it's init.d network scripts

That said, I think the preferred solution would be to setup the config file to use subkeys

Example

[MemcachedCollector]

[[Identifier A]]
host = localhost
port = 11211

[[Identifier B]]
host = localhost
port = 22122

I feel that would be much easier for systems like bcfg2 or chef to manage.

Would that work for your usage?

@pablolb
Copy link
Contributor Author

pablolb commented Mar 6, 2012

Yes, this would work fine.

I browsed over the current collectors, and I saw that at leas one uses sub-sections in their configuration.

Maybe a special named section would be required for named instances? I have pushed a commit to the same branch as an example.

@kormoc kormoc closed this as completed in 3a7ae9a Mar 13, 2012
@kormoc
Copy link
Contributor

kormoc commented Mar 13, 2012

I think this should do the trick really well. Please let me know if you run into any issues at all.

Thanks!

@keen99
Copy link
Contributor

keen99 commented Jun 12, 2014

just a note for future readers who are looking for something like this and find this in a search:

this is NOT supported syntax for current (june 2014) diamond.

:-)

@kovyrin
Copy link

kovyrin commented Jun 26, 2014

So, do I understand it correctly: there is no way to monitor more than one instance of a service unless the author of a collector invented a special syntax for defining multiple sources of metrics? :-(

@kormoc
Copy link
Contributor

kormoc commented Jun 27, 2014

As of now, that is correct. A PR that implements a generic solution would be welcome

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

No branches or pull requests

4 participants