https://github.com/runtimetools/javametrics
Application Metrics for Java™ instruments the Java runtime for performance monitoring, providing the monitoring data visually with its built in dashboard
https://github.com/runtimetools/javametrics
agent application-metrics dashboard debug java java-8 java-application-metrics java-sdk java8 metrics metrics-gathering metrics-visualization monitoring monitoring-data performance-metrics performance-monitoring performance-visualization websphere-liberty
Last synced: about 2 months ago
JSON representation
Application Metrics for Java™ instruments the Java runtime for performance monitoring, providing the monitoring data visually with its built in dashboard
- Host: GitHub
- URL: https://github.com/runtimetools/javametrics
- Owner: RuntimeTools
- License: apache-2.0
- Created: 2017-06-21T09:26:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-07-11T21:06:06.000Z (almost 3 years ago)
- Last Synced: 2024-04-17T00:36:04.730Z (about 1 year ago)
- Topics: agent, application-metrics, dashboard, debug, java, java-8, java-application-metrics, java-sdk, java8, metrics, metrics-gathering, metrics-visualization, monitoring, monitoring-data, performance-metrics, performance-monitoring, performance-visualization, websphere-liberty
- Language: Java
- Homepage: https://developer.ibm.com/javasdk/application-metrics-java/
- Size: 1.75 MB
- Stars: 21
- Watchers: 15
- Forks: 14
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/RuntimeTools/javametrics)
[](https://codebeat.co/projects/github-com-runtimetools-javametrics-master)
[](https://codecov.io/gh/RuntimeTools/javametrics)

[](https://developer.ibm.com/javasdk/application-metrics-java/)# Application Metrics for Java™
Application Metrics for Java™ instruments the Java runtime for performance monitoring, providing the monitoring data visually with its built in dashboard
The following data collection sources are built-in:
Source | Description
:-------------------|:-------------------------------------------
Environment | Machine and runtime environment information
CPU | Process and system CPU
GC | Percentage time spent in garbage collection
Memory | Java native and non-native memory usage
HTTP | HTTP request information## Getting Started
### PrerequisitesThe Application Metrics for Java agent requires Java version 8.
### Releases
Download the latest Application Metrics for Java release zip from [Github](http://github.com/runtimetools/javametrics/releases).
This contains:
* `webapp/dashboard/javametrics-dash-x.x.x.war` - Javametrics Web Application
* `webapp/prometheus/javametrics-prometheus-x.x.x.war` - Javametrics Prometheus Endpoint
* `agent/javametrics-agent-x.x.x.jar` - Javametrics agent and required ASM libraries
* `spring/javametrics-spring-x.x.x.jar` - Javametrics spring
* `rest/javametrics-rest-x.x.x.war` - Javametrics REST api package### Building with Maven
To build with maven
```
git clone --recursive https://github.com/RuntimeTools/javametrics
cd javametrics
mvn install
```To use the agent built locally, you will need to reference the your local javametrics directory when setting the javaagent parameter later in the instructions.
Javametrics is also released on Maven Central with the following artifacts
```
javametrics-agent
com.ibm.runtimetools
javametrics-agentjavametrics-dash
com.ibm.runtimetools
javametrics-dashjavametrics-prometheus
com.ibm.runtimetools
javametrics-prometheusjavametrics-spring
com.ibm.runtimetools
javametrics-springjavametrics-rest
com.ibm.runtimetools
javametrics-restjavametrics-codewind
com.ibm.runtimetools
javametrics-codewindjavametrics-codewind-spring
com.ibm.runtimetools
javametrics-codewind-spring
```### Websphere Liberty
Unpack the release `.zip` archive that you downloaded in the previous step.Javametrics requires a Java option to be set in order to load the agent. A [jvm.options](https://www.ibm.com/support/knowledgecenter/en/SSAW57_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/twlp_admin_customvars.html) file is the best way to configure this for Websphere Liberty. It should contain the following entry, where `path_to_javametrics_agent_dir` is replaced with the actual path containing the javametrics file:
```
# Load Javametrics Java agent
-javaagent:/javametrics-agent-1.8.0.jar
```
If you have built the agent locally, your path_to_javametrics_agent_dir will need to point to your clone of javametrics.
e.g.
```
-javaagent:/javametrics/javaagent/target/javametrics-agent-1.8.0.jar
```
* NOTE, if you move the javametrics-agent to another directory you need to make sure you take the asm folder with it. The asm folder is required for the agent to run as it contains files that the agent needsCopy the required war files into your [Websphere Liberty](https://developer.ibm.com/wasdev/websphere-liberty/) 'dropins' directory.
- `javametrics-dash-x.x.x.war` to use the Javametrics dashboard
- `javametrics-rest-x.x.x.war` to use the Javametrics REST api
- `javametrics-prometheus-x.x.x.war` to use Prometheus supportThe URL for the dashboard consists of the server's default HTTP endpoint plus `/javametrics-dash/`. E.g. Running locally it might be: http://localhost:9080/javametrics-dash/
The URL for the prometheus endpoint consists of the server's default HTTP endpoint plus the default prometheus metrics path `/metrics`. E.g. Running locally it might be: http://localhost:9080/metrics/
The URL for the REST API context root consists of the server's default HTTP endpoint plus `/javametrics`. E.g. Running locally it might be: http://localhost:9080/javametrics/api/v1/collections
### Open Liberty
Follow all the steps for [Websphere Liberty](#websphere-liberty) and in addition, make sure that the `websocket-1.0` feature is installed on the server. To do this, open the `server.xml` for the server in question, and in the `` tags add the following line
```xml
websocket-1.0
```### Spring Boot
To enable Javametrics in a Spring Boot application you need to add an extra annotation to your main application class:
```
@ComponentScan(basePackages = {"com.ibm.javametrics.spring", "mypackage"})
```
In a Spring Boot starter project this goes above or below the `@SpringBootApplication` annotation and you will need to add the package that that class is in to the list of `basePackages` (in place of __mypackage__ above).You also need to add the following dependencies to your pom.xml:
```
com.ibm.runtimetools
javametrics-spring
1.8.0com.ibm.runtimetools
javametrics-agent
1.8.0org.glassfish
javax.json
1.0.4```
Once you have launched your application you will find the dashboard at the server's default HTTP endpoint plus `/javametrics-dash/`. E.g. running locally with Spring Boot it might be: http://localhost:8080/javametrics-dash/
The URL for the REST API context root consists of the server's default HTTP endpoint plus `/javametrics/`. e.g. http://localhost:9080/javametrics/api/v1/collections
### Apache Tomcat
Coming soon## API Documentation
- [API Documentation](API-DOCUMENTATION.md)## REST API Documentation
- [REST API](REST-API.md)## Source code
The source code for Application Metrics for Java is available in the [Javametrics Github project](http://github.com/RuntimeTools/javametrics).## License
This project is released under an Apache 2.0 open source license.## Versioning scheme
This project uses a semver-parsable X.0.Z version number for releases, where X is incremented for breaking changes to the public API described in this document and Z is incremented for bug fixes **and** for non-breaking changes to the public API that provide new function.## Version
1.8.0