Skip to content

Conversation

@YannRobert
Copy link
Contributor

When an application is stopped, the ApplicationContext stops all of the OutputWriters.
Export tasks that were already scheduled or running then was trying to export to OutputWriters that were closed.
This could produce some errors (alarming Exceptions in the logs), depending on the implementation of the OutputWriters. For instance, the GraphiteWriter closes it's internal connection pool when stopped, so that it cannot be used after that. Some others OutputWriters are fine with that because there stop method does nothing. (ConsoleWriter or GraphiteHttpWriter for instance)
This PR introduces a state management class that ensures that a stopped OutputWriter is never written.
Concurrent writes (to same OutputWriter by multiple Threads) are still supported.

Add Spring javadocs URL in pom.xml's maven-javadoc-plugin configuration
* implement ignore-configuration-noy-found
* add <jmxtrans:configuration /> sub elements
Enhance <jmxtrans:jmxtrans /> spring namespace
* implement ignore-configuration-noy-found
* add <jmxtrans:configuration /> sub elements
Fix Spring ObjectFactory implementation
…d instead of outputting millis for the timestamp.
Use Graphite's output format as in jmxtrans for Console and SLF4J writers
Migrate from BuildHive to CloudBees FOSS Program
YannRobert and others added 20 commits July 17, 2015 14:18
…ol and GlobalRequestProcessor.

http-nio and ajp-nio Thread Pools and GlobalRequestProcessor MBean's names are always suffixed with the port number (for instance http-nio-8080). When the port number is randomly assigned (running in a PaaS like CloudFoundry), metrics will have different names every times tomcat is (re)started. This can be an issue in case you have a metric quota on the backend (when using hosted service like hostedgraphite.com). Even in the absence of a quota, it will simply fillup the backend disk partition really quickly. Also the metrics will be shortlive, and won't be easy to aggregate in the long run.

In order to fix that, we match each individual ObjectName with its prefix (commonly "http-nio-" and "ajp-nio-" in Tomcat) followed with a wildcard for the port number we don't know in advance. The resultAlias will not contain the port number at all, but transform to "http-nio" and "ajp-nio" respectively.

Note that when using a wildcard in a litteral attribute matcher, the value should be enclosed in double-quotes.
…a "tlsInsecure" flag to support invalid x509 certificates (server Root CA not trusted by the client, expired cert ...)
…etricNames

Predictable Tomcat NIO Metric Names
…hite-writer

[GraphiteWriter] Add support for TLS/SSL for TCP connections
Using clear() reset the limit to the ByteBuffer capacity.
The rewind() is unnecessary after the flip(): position is already set
to zero.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must say I prefer the previous implementation here, better to give running tasks a chance to finish.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to await for the tasks termination, as one last collect and export will be executed anyways. If a collect and/or export is interrupted, not data will be lost, because we will collect again then export again.
awaitTermination is only making the application (and the JVM) longer to stop.

YannRobert and others added 4 commits September 28, 2015 15:03
….felix:maven-bundle-plugin, in order to allow the project to build with Java 6
explicitly set the version for plugin maven-bundle-plugin, in order to allow the project to build with Java 6
@YannRobert
Copy link
Contributor Author

Just updated the PR branch with the changes from master

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

Successfully merging this pull request may close these issues.

10 participants