Comments (3)
I just wrote my own sink that sends the data to multiple sinks
Just add a sink to statsite like:
stream_cmd = python statsite/sinks/multiplex.py /etc/multiplex.conf
and a config for multiplex
python /statsite/sinks/graphite.py graphite01 2003 statsd.
python /statsite/sinks/graphite.py graphite02 2003 statsd.
Here is the python code:
"""
Supports sending metrics to multiple sinks
"""
import os
import sys
import subprocess
def main():
# Read from config
with open(*sys.argv[1:]) as configFile:
sinkList = configFile.readlines()
# Remove newlines
sinkList = [sink.strip() for sink in sinkList]
# Gather the metrics
metrics = ""
while True:
try:
metrics += raw_input() + '\n'
except EOFError:
break
# Send metrics to each of our sinks
for sink in sinkList:
proc = subprocess.Popen(sink, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
proc.stdin.write(metrics)
proc.stdin.close()
if __name__ == "__main__":
main()
from statsite.
would you mind pointing me to the documentation where that is stated? from the code it certainly doesn't seem to be the case.
some clever use of the tee command might be able to accomplish the same task as a workaround or really any script that pipes stdin to multiple processes.
from statsite.
Thank you
from statsite.
Related Issues (20)
- travis.ci build badge needs updating from armon/statsite => statsite/statsite HOT 2
- Failure in configure script HOT 5
- Support Librato "stat level tags" HOT 1
- Sink subprocesses not exiting HOT 10
- Document `aligned_flush` flag HOT 2
- unable to start statsite using ./statsite -f statsite.conf HOT 7
- Config CSV parsing doesn't work with spaces HOT 2
- when i try compile, arise this error HOT 3
- Health check for statsite
- Unable to configure on ARMv7 HOT 10
- it seems that the stdin of stream_cmd has no EOF HOT 1
- Flushing explanation HOT 3
- Question: behavior on gauge flush HOT 1
- Internal health metrics HOT 1
- Some metrics received are silently ignored (do not appear in output) HOT 1
- Tests seem failed HOT 1
- Suppress log `statsite[12503]: Failed parse metric! Input: S.None` HOT 1
- Doc error: default listen_address HOT 3
- statsite showing straming processes HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statsite.