LibratoWriter includes descriptive User-Agent
Closed this issue · 6 comments
Copy of jmxtrans/jmxtrans#216
@mheffner said
I'm from the Librato team. It would help us to include a descriptive User-Agent header in the LibratoWriter that includes "jmxtrans" and the version number of jmxtrans, eg. "jmxtrans/1.2.3". This would assist in our debugging when working with users that are sending data with jmxtrans to Librato.
We have a full write-up here: http://support.metrics.librato.com/knowledgebase/articles/175825-how-to-set-a-custom-user-agent-when-integrating-wi
Hi @mheffner, is there a way to test on our Librato account (email: admin@jmxtrans.org)? I can't wireshark an HTTPS call :-(.
test-with-one-counter.singleresult
has been emitted with this User-Agent.
I want to output the HTTP Request Header:
User-Agent: embedded-jmxtrans/1 (Java HotSpot(TM) 64-Bit Server VM/1.8.0_25; Mac OS X-x86_64/10.10.1)
Which is the result of:
"embedded-jmxtrans/1 " + "(" +
System.getProperty("java.vm.name") + "/" + System.getProperty("java.version") + "; " +
System.getProperty("os.name") + "-" + System.getProperty("os.arch") + "/" + System.getProperty("os.version")
+ ")";
- I am aware of the "double starting parenthesis caused by
Java HotSpot(TM)
, it is the JVM name that contains this noisy starting parenthesis. - The version
embedded-jmxtrans/1
is hardcoded, we will introspect the "real" version in jmxtrans2.
@cyrille-leclerc Yes, I can check what appears in our log files (we log the UA) for your account. Can you give me a time you are testing and if possible the IP address of the sending machine? You can email me at mike_at_librato_com privately too.
@mheffner I just purged my metrics and re-injected around 4:25 PM GMT on our Librato account (email: admin@jmxtrans.org):
test-with-one-counter.singleresult counter
test-with-one-gauge.singleresult gauge
test-with-three-counters.first counter
test-with-three-counters.second counter
test-with-two-counters.first counter
test-with-two-counters.second counter
test-with-two-gauges.first gauge
test-with-two-gauges.second gauge
This is the UA I see: embedded-jmxtrans/1 (Java HotSpot(TM) 64-Bit Server VM/1.8.0_25; Mac OS X-x86_64/10.10.1)
Looks good to me. Is "1" an accurate representation of the current version or is that a placeholder?
Thanks @mheffner,
This looks pretty good. I wanted to have the details of the JVM as embedded-jmxtrans is using the HTTP connection provided by the JVM.
"1" is "1.x" because I did not yet implement the lookup of the maven version in the jar file.
@gehel is working on jmxtrans2 which will be able to clearly mention the version of the library.
Cyrille
Release 1.0.13 is cut, it will soon be available in Maven Central Repository.