All Projects → MaibornWolff → elcep

MaibornWolff / elcep

Licence: Apache-2.0 license
Elastic Log Counter Exporter for Prometheus

Projects that are alternatives of or similar to elcep

X509 Certificate Exporter
A Prometheus exporter to monitor x509 certificates expiration in Kubernetes clusters or standalone
Stars: ✭ 40 (+185.71%)
Mutual labels:  prometheus-exporter, monitoring-tool
kafka-consumer-lag-monitoring
Client tool that exports the consumer lag of Kafka consumer groups to Prometheus or your terminal
Stars: ✭ 45 (+221.43%)
Mutual labels:  prometheus-exporter, monitoring-tool
Kube Opex Analytics
🎨 Kubernetes Cost Allocation and Capacity Planning Analytics Tool. Hourly, daily, monthly reports - Prometheus exporter - Built-in & Grafana dashboard.
Stars: ✭ 232 (+1557.14%)
Mutual labels:  prometheus-exporter
ansitheus
Ansible playbook - Containerize, configure and deploy Prometheus ecosystem
Stars: ✭ 19 (+35.71%)
Mutual labels:  prometheus-exporter
OctoPrint-Prometheus-Exporter
An octoprint plugin for prometheus compatible metrics endpoint
Stars: ✭ 36 (+157.14%)
Mutual labels:  prometheus-exporter
Collectd
The system statistics collection daemon. Please send Pull Requests here!
Stars: ✭ 2,700 (+19185.71%)
Mutual labels:  prometheus-exporter
domain exporter
Prometheus WHOIS domain details exporter.
Stars: ✭ 73 (+421.43%)
Mutual labels:  prometheus-exporter
Aliyun Exporter
Prometheus exporter for Alibaba Cloud Monitor
Stars: ✭ 210 (+1400%)
Mutual labels:  prometheus-exporter
extatus
App to report metrics to Prometheus from Elixir GenServers
Stars: ✭ 18 (+28.57%)
Mutual labels:  prometheus-exporter
github releases exporter
Exports GitHub release metrics to the Prometheus format
Stars: ✭ 21 (+50%)
Mutual labels:  prometheus-exporter
fortigate exporter
Prometheus exporter for Fortigate firewalls
Stars: ✭ 133 (+850%)
Mutual labels:  prometheus-exporter
mongodb-query-exporter
Prometheus MongoDB aggregation query exporter
Stars: ✭ 74 (+428.57%)
Mutual labels:  prometheus-exporter
Mikrotik Exporter
prometheus mikrotik device(s) exporter
Stars: ✭ 248 (+1671.43%)
Mutual labels:  prometheus-exporter
ha cluster exporter
Prometheus exporter for Pacemaker based Linux HA clusters
Stars: ✭ 63 (+350%)
Mutual labels:  prometheus-exporter
Github Exporter
Prometheus exporter for github metrics
Stars: ✭ 231 (+1550%)
Mutual labels:  prometheus-exporter
lustre exporter
Prometheus exporter for use with the Lustre parallel filesystem
Stars: ✭ 25 (+78.57%)
Mutual labels:  prometheus-exporter
Ssl exporter
Exports Prometheus metrics for SSL certificates
Stars: ✭ 211 (+1407.14%)
Mutual labels:  prometheus-exporter
ansible-snmp-exporter
Provision SNMP metrics exporter for prometheus monitoring
Stars: ✭ 18 (+28.57%)
Mutual labels:  prometheus-exporter
ExDeMon
A general purpose metrics monitor implemented with Apache Spark. Kafka source, Elastic sink, aggregate metrics, different analysis, notifications, actions, live configuration update, missing metrics, ...
Stars: ✭ 19 (+35.71%)
Mutual labels:  monitoring-tool
app-stores-prometheus-exporter
Prometheus exporter that exports metrics (score, ratings, reviews, app version, etc.) from the Apple App Store and Google Play Store
Stars: ✭ 80 (+471.43%)
Mutual labels:  prometheus-exporter

ELCEP - Elastic Log Counter Exporter for Prometheus

Go Report Card Release

What does it do?

ELCEP is a small go service which provides prometheus metrics based on custom lucene queries to an elastic search instance.

How do I use it?

Most convenient is running it as the docker image published here: https://hub.docker.com/r/maibornwolff/elcep/ eg:

docker run maibornwolff/elcep --url <address to elastic search instance (protocol://hostname:port)>

To familiarize yourself with ELCEP, check out examples/README.md.

How do I configure it?

ELCEP accepts the following arguments:

-f, --freq=30s              The elastic search polling interval
-u, --url=http://elasticsearch:9200
                            The elastic search endpoint
-p, --port=8080             The port to listen on for HTTP requests
-c, --config=config.yml     Location of the config file
    --plugin-dir=plugins    Directory containing all the plugins
    --path="/metrics"       The resource path for the prometheus endpoint
    --timekey="@timestamp"  The timekey to use for the elasticsearch queries
-v, --version               Show application version and exit.
-h, --help                  Show help and exit.

These arguments can also be set via environment variables:

environment variable argument shorthand default value
ELCEP_POLL_FREQUENCY --freq -f 30s
ELCEP_ELASTIC_URL --url -u http://elasticsearch:9200
ELCEP_PORT --port -p 8080
ELCEP_CONFIG --config -c config.yml
ELCEP_PLUGIN_DIR --plugin-dir N/A plugins
ELCEP_METRICS_ENDPOINT --path N/A /metrics
ELCEP_TIME_KEY --time-key N/A @timestamp

To configure the metrics, use the config file (config.yml). It has the following structure:

plugins:
  # You can give configuration for the plugins here, if necessary.
  counter:
    someOption: "foo"
  bucket: true

metrics:
  # logical groups
  exceptions:
    # the targeted plugin
    counter:
      # Syntax 1: `name: query` (shorthand for syntax 2)
      all: "log:exception"
      # Syntax 2: `name: configObject`
      npe:
        # query is required for all queries
        # some plugins may require more configuration for each query, e.g. for bucket aggregation
        query: "log:NullPointerException"
    # now target another plugin
    bucket:
      by_type:
        query: "log:exception"
        # you can give more options specific for that plugin
        aggregations:
          - "type"
  
  images:
    counter:
      all: "log:image"
      uploaded: "Receiving new image" 

Example:

Above configuration yields to the following metrics exposed:

# HELP elcep_logs_matched_exceptions_all_total Counts number of matched logs for exceptions_all
# TYPE elcep_logs_matched_exceptions_all_total counter
elcep_logs_matched_exceptions_all_total 13
# HELP elcep_logs_matched_exceptions_npe_total Counts number of matched logs for exceptions_npe
# TYPE elcep_logs_matched_exceptions_npe_total counter
elcep_logs_matched_exceptions_npe_total 0
# HELP elcep_logs_matched_exceptions_by_type_buckets Aggregates logs matching log:exception AND bucket:true to buckets
# TYPE elcep_logs_matched_exceptions_by_type_buckets counter
elcep_logs_matched_exceptions_by_type_buckets{type="0"} 2
elcep_logs_matched_exceptions_by_type_buckets{type="1"} 2
elcep_logs_matched_exceptions_by_type_buckets{type="2"} 1
elcep_logs_matched_exceptions_by_type_buckets{type="4"} 3
elcep_logs_matched_exceptions_by_type_buckets{type="5"} 1
elcep_logs_matched_exceptions_by_type_buckets{type="7"} 1
elcep_logs_matched_exceptions_by_type_buckets{type="8"} 1
elcep_logs_matched_exceptions_by_type_buckets{type="10"} 1
elcep_logs_matched_exceptions_by_type_buckets{type="12"} 1
# HELP elcep_logs_matched_images_all_total Counts number of matched logs for images_all
# TYPE elcep_logs_matched_images_all_total counter
elcep_logs_matched_images_all_total 0
# HELP elcep_logs_matched_images_uploaded_total Counts number of matched logs for images_uploaded
# TYPE elcep_logs_matched_images_uploaded_total counter
elcep_logs_matched_images_uploaded_total 0

The query for elastic search and the content of the metrics depends on the used plugins

Which plugins can I use?

Out of the box, the following plugins are provided:

Counter

The counter plugin exposes a simple Counter metric to prometheus. It counts the total of all matched log lines since the start of ELCEP.

Configuration

The plugin has no global configuration.

Each query only needs a name and a query string (which is required by default anyway).

The configured query exceptions: "log:exception" will match all logs that contain the string "exception" in the log-field. It will count up starting from 0 at program start.

Bucket aggregation

The bucket aggregation plugin allows to aggregate the matches by a field in the logs. You may sub-aggregate by more fields, if necessary. Please be aware of an exponential grow in the number of buckets when you use multiple aggregations.

Configuration

Each query needs an aggregation configured. The configuration for a query might look like this:

my_query:
    query: "log:searchstring"
    aggregations: ["microservice"]

The resulting metric will be a vector, grouping the count by the "microservice"-field of the logs.

Developing custom plugins

Please refer to the custom plugin guide.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].