question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GraphiteWriterFactory does not actually write

See original GitHub issue

The GraphiteWriter outputs to Graphite properly with a configuration like the following:

{
 "servers" : [
  {
   "port" : "PPPPP",
   "host" : "AAA.BBB.CCC",
   "queries" : [
    {
     "outputWriters" : [
      {
       "@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",
       "rootPrefix" : "jmx",
       "port" : "2003",
       "host" : "127.0.0.1"
      }
     ],
     "obj" : "java.lang:type=Memory",
     "attr" : [ "HeapMemoryUsage", "NonHeapMemoryUsage" ],
     "resultAlias": "heap"
    }
   ]
  }
 ]
}

Changing the line

       "@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriter",

to

       "@class" : "com.googlecode.jmxtrans.model.output.GraphiteWriterFactory",

let the output not working: no data reach the carbon-cache listener.

Excluding the deprecation of GraphiteWriter, there is nothing strange in the log, even at DEBUG level.

I found the behaviour in version 254 (I treid both .rpm and .jar flavour) and in version 255-SNAPSHOT20160511200238 (I tried rpm only).

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
gehelcommented, Nov 3, 2016

Always flushing is probably not a very good default. It would mean that we send a very small packet with a single metric each time a metric is collected. It is more efficient to batch multiple metrics in a single TCP packet. If you collect enough metrics, never flushing (and letting the underlying TCP implementation handle the buffering) is the most efficient choice. If you collect less metrics, flushing periodically make sense. It is more expensive, but allow you to get results in a timely fashion.

A better default might be to flush every minute.

2reactions
marcoc610commented, Nov 3, 2016

I am currently testing these parameters and the Graphite database is receiving data using GraphiteWriterFactory. I leave the parameters running for some time, then I will report again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

YAML outputWriter config for GraphiteWriterFactory requires ...
When using outputWriters configuration in YAML settings wrapper key is required. Thus produced JSON config for GraphiteWriterFactory outputWriter is created ...
Read more >
jmxtrans - Bountysource
I have now tried to add in simple attribute data collection for a JBOSS datasource/pool. JBOSS seems configured correctly, as when I run...
Read more >
FileWriter is not writing into a file - java - Stack Overflow
You must close the FileWriter , otherwise it won't flush the current buffer. You can call the flush method directly.. fileWriter.flush() fileWriter.close().
Read more >
All the things we can do with JMX - S. Derosiaux
JMX is an API used to expose data from any Java program to the outside. It's used by tons of softwares and libraries...
Read more >
Use jmx-exporter && jmxtrans && nexus jmx exposed nexus ...
jmxtrans.json jmx query is a simple configuration, can be configured according to the actual. {. "servers": [{. "port": "8044",.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found