HTTP Sink Apache

HTTP Sink for metrics client using the Apache HTTP library.

License

License

Categories

Categories

Net Metrics Application Testing & Monitoring Monitoring Networking
GroupId

GroupId

com.arpnetworking.metrics
ArtifactId

ArtifactId

sink-http-apache
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

HTTP Sink Apache
HTTP Sink for metrics client using the Apache HTTP library.
Project URL

Project URL

https://github.com/ArpNetworking/metrics-sink-http-apache
Source Code Management

Source Code Management

https://github.com/arpnetworking/metrics-sink-http-apache

Download sink-http-apache

How to add to project

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

Dependencies

compile (7)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.12
com.google.protobuf : protobuf-java jar 3.0.0
com.arpnetworking.metrics : metrics-client jar 0.4.5
com.inscopemetrics.client : protocol jar 0.9.3
org.apache.httpcomponents : httpclient jar 4.5.2
org.apache.httpcomponents : httpcore jar 4.4.4
com.google.code.findbugs : jsr305 jar 3.0.1

provided (1)

Group / Artifact Type Version
com.arpnetworking.build : build-resources jar 1.0.5

test (4)

Group / Artifact Type Version
org.hamcrest : java-hamcrest jar 2.0.0.0
junit : junit jar 4.12
org.mockito : mockito-core jar 1.10.19
com.github.tomakehurst : wiremock jar 1.57

Project Modules

There are no modules declared in this project.

Metrics Client Apache HTTP Sink

License: Apache 2 Travis Build Maven Artifact Javadocs

Apache HTTP sink for metrics client.

Usage

Add Dependency

Determine the latest version of the library in Maven Central.

Maven

Add a dependency to your pom:

<dependency>
    <groupId>com.arpnetworking.metrics.extras</groupId>
    <artifactId>apache-http-sink-extra</artifactId>
    <version>VERSION</version>
</dependency>

The Maven Central repository is included by default.

Gradle

Add a dependency to your build.gradle:

compile group: 'com.arpnetworking.metrics.extras', name: 'apache-http-sink-extra', version: 'VERSION'

Add the Maven Central Repository into your build.gradle:

repositories {
    mavenCentral()
}

SBT

Add a dependency to your project/Build.scala:

val appDependencies = Seq(
    "com.arpnetworking.metrics.extras" % "apache-http-sink-extra" % "VERSION"
)

The Maven Central repository is included by default.

Set as Sink on MetricsFactory

To override the default sink on the MetricsFactory do the following:

final MetricsFactory metricsFactory = new TsdMetricsFactory.Builder()
        .setSinks(Collections.singletonList(new ApacheHttpSink.Builder().build())
        .build();

In most cases the default arguments are sufficien; however, you may also customize the ApacheHttpSink like this:

final MetricsFactory metricsFactory = new TsdMetricsFactory.Builder()
        .setSinks(Collections.singletonList(
                new ApacheHttpSink.Builder()
                        .setMaxBatchSize(1000)
                        .setEmptyQueueInterval(Duration.ofMillis(1000))
                        .setParallelism(4)
                        .setUri(URI.create("http://remote-mad.example.com")
                        .setBufferSize(100000)
                        .build())
        .build();

For more information on configuring MetricsFactory please see metrics-client-java.

Building

Prerequisites:

  • JDK8 (Or Invoke with JDKW)

Building:

metrics-apache-http-sink-extra> ./mvnw verify

To use the local version you must first install it locally:

metrics-apache-http-sink-extra> ./mvnw install

You can determine the version of the local build from the pom file. Using the local version is intended only for testing or development.

You may also need to add the local repository to your build in order to pick-up the local version:

  • Maven - Included by default.
  • Gradle - Add mavenLocal() to build.gradle in the repositories block.
  • SBT - Add resolvers += Resolver.mavenLocal into project/plugins.sbt.

License

Published under Apache Software License 2.0, see LICENSE

© Inscope Metrics Inc., 2016

Versions

Version
0.1.1