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

statsd support #76

Merged
merged 4 commits into from
Oct 26, 2012
Merged

statsd support #76

merged 4 commits into from
Oct 26, 2012

Conversation

mreiferson
Copy link
Member

we'd like to support pretty charts and stats via nsqadmin with as little built in work as possible.

the simplest initial approach seems to be that nsqd can write UDP packets directly to a statsd node (which eventually gets into graphite, which can then be queried by nsqadmin).

in terms of the impact to the nsqd codebase, a lot of the foundational work would be necessary regardless of whether the output was statsd format or whether it was a new command on the V2 protocol that pushed some internal format over the wire to a client.

It seems that statsd is a common and supported enough platform to build on top of.

cc @jehiah

@mreiferson
Copy link
Member Author

work in progress

@mreiferson
Copy link
Member Author

ok, ready for review @jehiah

return errors.New("not connected")
}
stat = fmt.Sprintf(c.prefix, stat)
format = fmt.Sprintf("%s:%s", stat, format)
Copy link
Member

Choose a reason for hiding this comment

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

why not just add a %s to the beinning of this and remove the need to enforce that the client specifies that on the command line? (they prefix because exactly that, just a prefix).

format = fmt.Sprintf("%s%s:%s", c.prefix, stat, format)

Copy link
Member Author

Choose a reason for hiding this comment

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

hah, good idea :)

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

@mreiferson
Copy link
Member Author

squashed

mreiferson and others added 2 commits October 26, 2012 11:24
* cleanup stats collection code to separate retrieval from formatting
* add options for statsd
* add statsd client
* add statsdLoop that pushes diffs over UDP to a configured statsd address
* add --graphite-url command line parameter
* add --use-statsd-prefix command line parameter
* readme/statsd docs
jehiah added a commit that referenced this pull request Oct 26, 2012
@jehiah jehiah merged commit 6e194c0 into nsqio:master Oct 26, 2012
arussellsaw pushed a commit to arussellsaw/nsq that referenced this pull request Mar 5, 2018
config: normalize opt names to underscores
absolute8511 added a commit to absolute8511/nsq that referenced this pull request Jan 12, 2023
fix npe when trace log does not belong to nsqd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants