Skip to content

Commit

Permalink
Updates after review
Browse files Browse the repository at this point in the history
  • Loading branch information
tsegismont committed Jun 10, 2015
1 parent 981e173 commit 9dd5dc7
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions clients/ptranslator/README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= ptrans - An Hawkular Metrics proxy
= ptrans - A Hawkular Metrics proxy
:type: article

This is a proxy server taking in metrics data in several common formats and emitting
Expand All @@ -10,9 +10,11 @@ them as REST requests into Hawkular Metrics backend for storage.

This module contains a simple proxy server that also listens on UDP port 5140
for syslog messages. If a message is of the format:

----
type=metric thread.count=7 thread.active=5 heap.permgen.size=20000000
----

Then it is taken and the individual key-value-pairs are broken apart and
sent as individual metrics to a hawkular-metrics rest server. The timestamp
is the current time on the proxy when the udp packet was received.
Expand All @@ -21,6 +23,7 @@ is the current time on the proxy when the udp packet was received.

You need to configure syslog to forward you the messages.
For this you need to edit `/ec/syslog.conf` and add a line like this:

----
*.info @127.0.0.1:5140
----
Expand All @@ -30,19 +33,24 @@ For this you need to edit `/ec/syslog.conf` and add a line like this:
==== Manually testing

On a *nix command line you can run:

[source,bash]
----
$ logger -p local3.info "type=metric thread.count=7 thread.active=5 heap.permgen.size=20000000"
logger -p local3.info "type=metric thread.count=7 thread.active=5 heap.permgen.size=20000000"
----

to add entries to syslog for testing purposes.

=== Graphite

The converter also accepts Graphite plaintext format:

----
path value timestamp_in_s
----

Or with multiple entries per message:

----
path1 value1 timestamp_in_s1
path2 value2 timestamp_in_s2
Expand All @@ -55,6 +63,7 @@ to `gmond` udp mlticast packets.
For this to work, the packets from Ganglia need to have a large enough TTL to be seen on the host where you run pTrans.

Excerpt from gmond.conf:

----
udp_send_channel {
mcast_join = 239.2.11.71
Expand All @@ -67,20 +76,24 @@ udp_send_channel {

The converter accepts statsD packets sent via UDP (to the UDP port).
Format is:

----
key:value|type
----

Where only key and value are accepted and the type is ignored (for now).

Example command:

[source,bash]
----
$ echo "my_time:100|ms" | nc -u4 localhost 8125
echo "my_time:100|ms" | nc -u4 localhost 8125
----

=== collectd

You must configure the collectd network plugin to send UDP packets.

----
LoadPlugin network
<Plugin network>
Expand All @@ -91,29 +104,34 @@ LoadPlugin network

== Running ptrans for development

Don't forget to start an Hawkular Metrics web server as well.
TIP: Don't forget to start a Hawkular Metrics web server as well.

=== With the start script

You can use the provided `start.sh` script to start the server (this will build the source first).

Make sure to specify a configuration file on the command line:

[source,bash]
----
$ ./start.sh -c ptrans.conf
./start.sh -c ptrans.conf
----

This method does not allow to configure logging and works on *nix systems only.

=== With Maven ===
=== With Maven

Once the project is built, simply run the following command:

[source,bash]
----
mvn exec:java
----

By default, the log4j and ptrans.conf files at the project base directory will be used.
If you want to use your own files:

[source,bash]
----
mvn exec:java -Ddev.log4j.configuration=<path to log4j file> -Ddev.ptrans.conf=<path to ptrans.conf>
----

0 comments on commit 9dd5dc7

Please sign in to comment.