-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Yair Ogen edited this page Mar 20, 2014
·
6 revisions
Monitoring is a set of API's that expose some custom interfaces as MBeans and also enable registering custom application MBeans.
The current supported interfaces are:
- Application Info - Name, Instance Name, Version etc.
- ServerConnection - monitor server connections on a client process
- Services - monitor server side services
- Notifications
The only current implementation is jmx based with default RMI Connector. We plan on adding support for JMX Over HTTP in the future.
The main API you can use is one of the following:
- register() - enables registering your app using standard environment variables:
- _RPM_SOFTWARE_NAME - key for setting the application name
- _ARTIFACT_VERSION - key for setting the application version for the instance name you can set a system property called: "app_instance_name" or the library will "Instance1" for you.
- register(Configuration configuration) - same as register, but allows to pass in your own commons confioguration implementation. Default behavior expects configuration-lib to be in your classpath. For more info on this library refer to the Configuration Wiki
- register(Mbean bean) - expose specific applicative MBean in cae the default monitoring data exposed is not enough.
The API exposes transaction monitoring specific API for the client side server connections and server side services statistics. Client side Server Connections Example:
ServerConnectionDetails connectionDetails = new ServerConnectionDetails(apiName, "HTTP:" + request.getHttpMethod(), request.getUri().getHost(), -1, request.getUri().getPort());
CommunicationInfo.getCommunicationInfo().transactionStarted(connectionDetails, getMonioringApiName(request));
.
.
.
CommunicationInfo.getCommunicationInfo().transactionFinished(connectionDetails, getMonioringApiName(request), false, "");
Server side Services Example:
ServiceDetails serviceDetails = new ServiceDetails(description, serviceName, "HTTP", port);
CommunicationInfo.getCommunicationInfo().transactionStarted(reqServiceDetails, methodName, threadPool.getThreads());
.
.
.
CommunicationInfo.getCommunicationInfo().transactionFinished(reqServiceDetails, methodName, false, "");