Instrumental is a application monitoring platform built for developers who want a better understanding of their production software. Powerful tools, like the Instrumental Query Language, combined with an exploration-focused interface allow you to get real answers to complex questions, in real-time.
This agent supports custom metric monitoring for Java applications. It provides high-data reliability at high scale, without ever blocking your process or causing an exception.
Add the following to your pom.xml
:
<dependency>
<groupId>com.instrumentalapp</groupId>
<artifactId>instrumental_agent</artifactId>
<version>1.0.1</version>
</dependency>
Visit instrumentalapp.com and create an account, then initialize the agent with your project API token.
import com.instrumentalapp.*;
Agent agent = new Agent(new AgentOptions().setApiKey("PROJECT_API_TOKEN").setEnabled(isProduction));
You'll probably want something like the above, only enabling the agent in production mode so you don't have development and production data writing to the same value. Or you can setup two projects, so that you can verify stats in one, and release them to production in another.
Now you can begin to use Instrumental to track your application.
agent.gauge("load", 1.23); // value at a point in time
agent.increment("signups"); // increasing value, think "events"
agent.time("query_time", new Runnable() { // time execution
public void run() {
// Do something
}});
agent.time("query_time", new Runnable() { // prefer milliseconds?
public void run() {
// Do something
}});
Note: For your app's safety, the agent is meant to isolate your app from any problems our service might suffer. If it is unable to connect to the service, it will discard data after reaching a low memory threshold.
Want to track an event (like an application deploy, or downtime)? You can capture events that are instantaneous, or events that happen over a period of time.
agent.notice('Jeffy deployed rev ef3d6a'); // instantaneous event
agent.notice('Testing socket buffer increase', System.currentTimeMillis() / 1000 - 60 * 10, 60*10); // an event with a duration
Want server stats like load, memory, etc.? Check out InstrumentalD.
We are here to help. Email us at support@instrumentalapp.com.
- Pull latest master
- Merge feature branch(es) into master
script/test
- Increment version in code:
src/main/java/com/instrumentalapp/Agent.java
pom.xml
README.md
- Update CHANGELOG.md
- Commit "Release vX.Y.Z"
- Push to GitHub
- Tag version:
git tag 'vX.Y.Z' && git push --tags
eval $(gpg-agent --daemon)
gpg --use-agent --armor --detach-sign
and press ^C after authenticating- Until maven gpg 1.7 is released, you may need to do this instead:
gpg --use-agent --armor --detach-sign --output $(mktemp) pom.xml
mvn clean deploy
- Use the git tag and make a new release with
target/instrumental_agent-*
attached, https://github.com/instrumental/instrumental_agent-java/tags - Refresh documentation on instrumentalapp.com
Somewhere around the gpg step in the release process, things will break unless you have all the right bits twiddled:
- Install gnupg
brew install gnupg
- If you don't have a key in gpg,
gpg --gen-key
- Look at your key
gpg --list-secret-keys
- Send that key to ubuntu using the ID from the previous step:
gpg --keyserver hkp://keyserver.ubuntu.com:80 --send-keys YOURKEYIDGOESHERE
- Create a settings.xml file in ~/.m2/settings.xml that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>YOURUSERNAMEHERE</username>
<password>YOURPASSWORDHERE</password>
</server>
</servers>
</settings>
After doing all this, if you get an error indicating that your credentials are not working, talk to @esquivalient.
This library follows Semantic Versioning 2.0.0.