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

LibratoWriter includes descriptive User-Agent #85

Closed
cyrille-leclerc opened this issue Jan 23, 2015 · 6 comments
Closed

LibratoWriter includes descriptive User-Agent #85

cyrille-leclerc opened this issue Jan 23, 2015 · 6 comments

Comments

@cyrille-leclerc
Copy link
Member

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

@cyrille-leclerc
Copy link
Member Author

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.

@mheffner
Copy link

@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.

@cyrille-leclerc
Copy link
Member Author

@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

@mheffner
Copy link

@cyrille-leclerc

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?

@cyrille-leclerc
Copy link
Member Author

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

@cyrille-leclerc
Copy link
Member Author

Release 1.0.13 is cut, it will soon be available in Maven Central Repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants