com.expedia.www:haystack-log4j-metrics-appender

A log4j appender that sends an error count to a graphite endpoint

License

License

Categories

Categories

Metrics Application Testing & Monitoring Monitoring
GroupId

GroupId

com.expedia.www
ArtifactId

ArtifactId

haystack-log4j-metrics-appender
Last Version

Last Version

1.0.7
Release Date

Release Date

Type

Type

jar
Description

Description

com.expedia.www:haystack-log4j-metrics-appender
A log4j appender that sends an error count to a graphite endpoint
Source Code Management

Source Code Management

http://github.com/ExpediaDotCom/haystack-log4j-metrics-appender

Download haystack-log4j-metrics-appender

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
com.expedia.www : haystack-metrics jar 2.0.1
com.netflix.servo : servo-core jar 0.12.17
com.netflix.servo : servo-graphite jar 0.12.17

provided (1)

Group / Artifact Type Version
org.apache.logging.log4j : log4j-core jar 2.10.0

test (4)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-all jar 1.9.5
com.fasterxml.jackson.core : jackson-databind jar 2.9.8
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.9.8

Project Modules

There are no modules declared in this project.

Coverage Status Build Status

haystack-log4j-metrics-appender

A log4j appender that sends an error count to a graphite endpoint

Overview

To facilitate counting errors and alarming when they occur, this package contains a Log4j 2 Appender that sends a Graphite plaintext protocol message to a Graphite endpoint. The intent of this Appender is to make it easier to alarm on error messages, using the Grafana alert notifications, or a similar metrics-based mechanism.

Metric Message Format

Graphite plain text protocol messages are of the form <name> <value> <timestamp> where <name> is typically a period-delimited String, <value> is a number (either integer or floating point) and <timestamp> is a Linux epoch style number (milliseconds since January 1, 1970, midnight GMT). The format of the <name> created by EmitToGraphiteLog4jAppender is used in the data.influxdb.templates array here and is of the following format:

haystack.errors.<subsystem>.<fully-qualified-class-name>.<server>.<lineNumber>.<ERROR_TYPE>_<suffix>

where

  • <subsystem> is the name of the subsystem (like pipes, collector, etc.).
  • <fully-qualified-class-name> is something like com-foo-MyClass (com.foo is the package, MyClass is the name of the class, and all the periods in the package have been replaced by hyphens).
  • <server> is the name of the server where the error occurred.
  • <lineNumber> is the line number in MyClass.java or MyClass.scala where the call to log the error was made.
  • ERROR_TYPE is either ERROR or FATAL.
  • <suffix> is TODO list the metric suffixes added by Servo.

Building

Simply run mvn clean package from the root directory of the cloned repository.

Releases

  1. Decide what kind of version bump is necessary, based on Semantic Versioning conventions. In the items below, the version number you select will be referred to as x.y.z.
  2. Update the pom.xml, changing the version element to <version>x.y.z-SNAPSHOT</version>. Note the -SNAPSHOT suffix.
  3. Make your code changes, including unit tests. This package requires 100% unit test code coverage for the build to succeed.
  4. Update the ReleaseNotes.md file with details of your changes.
  5. Create a pull request with your changes.
  6. Ask for a review of the pull request; when it is approved, the Travis CI build will upload the resulting jar file to the SonaType Staging Repository.
  7. Tag the build with the version number: from a command line, executed in the root directory of the project:
git tag x.y.z
git push --tags

This will cause the jar file to be released to the SonaType Release Repository.

com.expedia.www

Expedia.com

Versions

Version
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
0.1.13
0.1.12
0.1.11
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0