Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zebrafishlabs/nginx-statsd
An nginx module for sending stats to statsd.
https://github.com/zebrafishlabs/nginx-statsd
Last synced: 3 months ago
JSON representation
An nginx module for sending stats to statsd.
- Host: GitHub
- URL: https://github.com/zebrafishlabs/nginx-statsd
- Owner: zebrafishlabs
- License: other
- Created: 2012-02-01T00:17:50.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2019-08-14T20:04:39.000Z (about 5 years ago)
- Last Synced: 2024-07-17T18:55:38.110Z (4 months ago)
- Language: C
- Homepage: http://www.zebrafishlabs.com
- Size: 36.1 KB
- Stars: 366
- Watchers: 37
- Forks: 109
- Open Issues: 18
-
Metadata Files:
- Readme: README.mkd
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - nginx-statsd - An nginx module for sending stats to statsd. (C)
README
nginx-statsd
============An nginx module for sending statistics to statsd.
This is how to use the nginx-statsd module:
http {
# Set the server that you want to send stats to.
statsd_server your.statsd.server.com;# Randomly sample 10% of requests so that you do not overwhelm your statsd server.
# Defaults to sending all statsd (100%).
statsd_sample_rate 10; # 10% of requestsserver {
listen 80;
server_name www.your.domain.com;
# Increment "your_product.requests" by 1 whenever any request hits this server.
statsd_count "your_product.requests" 1;location / {
# Increment the key by 1 when this location is hit.
statsd_count "your_product.pages.index_requests" 1;# Increment the key by 1, but only if $request_completion is set to something.
statsd_count "your_product.pages.index_responses" 1 "$request_completion";# Send a timing to "your_product.pages.index_response_time" equal to the value
# returned from the upstream server. If this value evaluates to 0 or empty-string,
# it will not be sent. Thus, there is no need to add a test.
statsd_timing "your_product.pages.index_response_time" "$upstream_response_time";# Increment a key based on the value of a custom header. Only sends the value if
# the custom header exists in the upstream response.
statsd_count "your_product.custom_$upstream_http_x_some_custom_header" 1
"$upstream_http_x_some_custom_header";proxy_pass http://some.other.domain.com;
}
}
}