Skip to content

Add support for an ingest pipeline and resource file loading for configuration. #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ If you want to see this in action, go to the `samples/` directory and read the r

| Metrics-elasticsearch-reporter | elasticsearch | Release date |
|-----------------------------------|---------------------|:------------:|
| 2.3.0-SNAPSHOT | 2.3.0 -> master | NONE |
| 5.1.1-SNAPSHOT | 5.0.0 -> 5.1.x | master |
| 2.3.0 | 2.3.0 -> 2.4.x | TBD |
| 2.2.0 | 2.2.0 -> 2.2.x | 2016-02-10 |
| 2.0 | 1.0.0 -> 1.7.x | 2014-02-16 |
| 1.0 | 0.90.7 -> 0.90.x | 2014-02-05 |
Expand All @@ -27,7 +28,7 @@ You can simply add a dependency in your `pom.xml` (or whatever dependency resolu
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>metrics-elasticsearch-reporter</artifactId>
<version>2.2.0</version>
<version>2.3.0</version>
</dependency>
```

Expand Down Expand Up @@ -62,6 +63,10 @@ incomingRequestsMeter.mark(1);
* `index()`: The name of the index to write to, defaults to `metrics`
* `indexDateFormat()`: The date format to make sure to rotate to a new index, defaults to `yyyy-MM`
* `timestampFieldname()`: The field name of the timestamp, defaults to `@timestamp`, which makes it easy to use with kibana
* `templateResource()`: The path to a resource file containing the index template
* `ingestPipeline()`: An ingest pipeline to use at document creation
* `pipelineResource()`: The path to a resource file containing an ingest pipeline definition
* `scriptResources()`: A list of paths to resources containing one or more scripts (intended to be associated with the ingest pipeline)

### Mapping

Expand Down Expand Up @@ -90,7 +95,7 @@ public class PagerNotifier implements Notifier {
}
```

Add a percolation
Add a percolation _(elasticsearch < 5.0)_

```
curl http://localhost:9200/metrics/.percolator/http-monitor -X PUT -d '{
Expand All @@ -105,6 +110,21 @@ curl http://localhost:9200/metrics/.percolator/http-monitor -X PUT -d '{
}'
```

Add a percolation _(elasticsearch >= 5.0)_

```
curl http://localhost:9200/metrics/queries/http-monitor -X PUT -d '{
"query" : {
"bool" : {
"must": [
{ "term": { "name" : "incoming-http-requests" } },
{ "range": { "m1_rate": { "to" : "10" } } }
]
}
}
}'
```

## JSON Format of metrics

This is how the serialized metrics looks like in elasticsearch
Expand Down Expand Up @@ -194,4 +214,3 @@ This is how the serialized metrics looks like in elasticsearch
## Next steps

* Integration with Kibana would be awesome

48 changes: 34 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<groupId>org.elasticsearch</groupId>
<artifactId>metrics-elasticsearch-reporter</artifactId>
<version>2.3.0-SNAPSHOT</version>
<version>5.4.3-SNAPSHOT</version>

<properties>
<lucene.version>5.5.0</lucene.version>
<elasticsearch.version>2.3.1</elasticsearch.version>
<lucene.version>6.5.1</lucene.version>
<elasticsearch.version>5.4.3</elasticsearch.version>
<jackson.version>2.7.3</jackson.version>
<randomized.testrunner.version>2.3.3</randomized.testrunner.version>
<log4j.version>2.7</log4j.version>
<slf4j.version>1.7.2</slf4j.version>
</properties>

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -96,18 +98,35 @@
<artifactId>jackson-module-afterburner</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-test-framework</artifactId>
<version>${lucene.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<groupId>org.elasticsearch.test</groupId>
<artifactId>framework</artifactId>
<version>${elasticsearch.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
Expand All @@ -116,17 +135,18 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.carrotsearch.randomizedtesting</groupId>
<artifactId>randomizedtesting-runner</artifactId>
<version>${randomized.testrunner.version}</version>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>transport-netty4-client</artifactId>
<version>${elasticsearch.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.19</version>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>percolator-client</artifactId>
<version>${elasticsearch.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -147,4 +167,4 @@
</dependency>
</dependencies>

</project>
</project>
Loading