Librato Metrics API Java Library

A set of libraries to facilitate posting data to the Librato Metrics Api

License

License

Categories

Categories

Java Languages Metrics Application Testing & Monitoring Monitoring
GroupId

GroupId

com.librato.metrics
ArtifactId

ArtifactId

librato-java
Last Version

Last Version

2.1.3
Release Date

Release Date

Type

Type

jar
Description

Description

Librato Metrics API Java Library
A set of libraries to facilitate posting data to the Librato Metrics Api
Project URL

Project URL

https://github.com/librato/librato-java
Source Code Management

Source Code Management

https://github.com/librato/librato-java

Download librato-java

How to add to project

<!-- https://jarcasting.com/artifacts/com.librato.metrics/librato-java/ -->
<dependency>
    <groupId>com.librato.metrics</groupId>
    <artifactId>librato-java</artifactId>
    <version>2.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.librato.metrics/librato-java/
implementation 'com.librato.metrics:librato-java:2.1.3'
// https://jarcasting.com/artifacts/com.librato.metrics/librato-java/
implementation ("com.librato.metrics:librato-java:2.1.3")
'com.librato.metrics:librato-java:jar:2.1.3'
<dependency org="com.librato.metrics" name="librato-java" rev="2.1.3">
  <artifact name="librato-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.librato.metrics', module='librato-java', version='2.1.3')
)
libraryDependencies += "com.librato.metrics" % "librato-java" % "2.1.3"
[com.librato.metrics/librato-java "2.1.3"]

Dependencies

compile (4)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-core jar 2.8.8
com.fasterxml.jackson.core : jackson-databind jar 2.8.8
com.fasterxml.jackson.core : jackson-annotations jar 2.8.8
org.slf4j : slf4j-api jar 1.7.25

test (4)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.25
junit : junit jar 4.12
org.mockito : mockito-core jar 1.10.19
org.assertj : assertj-core jar 2.7.0

Project Modules

There are no modules declared in this project.

DEPRECATED: If you are using AppOptics please refer to appoptics-api-java.

librato-java

Java language bindings for the Librato Metrics API.

Looking for a previous version?

You can find documentation for versions < 2.x.x here.

Maven Dependency

<dependency>
    <groupId>com.librato.metrics</groupId>
    <artifactId>librato-java</artifactId>
    <version>2.1.0</version>
</dependency>

Setup

You must first initialize the client:

LibratoClient client = LibratoClient.builder(email, apiToken)
    // these are optional
    .setConnectTimeout(new Duration(5, SECONDS))
    .setReadTimeout(new Duration(5, SECONDS))
    .setAgentIdentifier("my app name")
    // and finally build
    .build();

Once your client has been built, you can submit measures to the Librato API:

PostMeasuresResult result = client.postMeasures(new Measures()
    .add(new GaugeMeasure(name, value))
    .add(new GaugeMeasure(name, value).setSource("uid:43"))
    .add(new GaugeMeasure(name, sum, count, min, max))
    .add(new GaugeMeasure(name, sum, count, min, max, sumSquares))
    .add(new CounterMeasure(name, value))
    .add(new TaggedMeasure(name, value, tag, tag))
    .add(new TaggedMeasure(name, sum, count, min, max, tag, tag ,tag)));

for (PostResult postResult : result.results) {
    if (result.isError()) {
        log.error(result.toString);
    }
}

Note that if you wish to submit tagged measures you need to first contact [email protected] to get early access to this new feature.

com.librato.metrics

Librato

Versions

Version
2.1.3
2.1.2
2.1.0
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.2
1.0.1
1.0.0
0.1.2
0.1.1
0.1.0
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1