Giter Club home page Giter Club logo

elcep's Introduction

ELCEP - Elastic Log Counter Exporter for Prometheus

What does it do?

It is a small go service which provides prometheus counter 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)>

How do I configure it?

Configure the queries one per line in the queries.cfg in the following notation: <name>=<query>

Via command line arguments the following options can be overwritten:

  -elasticqueries string
    	The path to the queries.cfg (default "./conf/queries.cfg")
  -freq int
    	The interval in seconds in which to query elastic search (default 30)
  -url string
    	The elastic search endpoint (default "http://elasticsearch:9200")
  -path string
    	The path to listen on for HTTP requests (default "/metrics")
  -port int
    	The port to listen on for HTTP requests (default 8080)

Example:

Providing this line in queries.cfg:

all_application_exceptions=message:exception AND service_name:application_*

Will result in exposing the following metric:

# HELP logs_matched_all_application_exceptions_total Counts number of matched logs for all_application_exceptions
# TYPE logs_matched_all_application_exceptions_total counter
logs_matched_all_application_exceptions_total 0

Using that elastic search query:

GET /_search
{
  "query": {
    "bool": {
      "must": {
        "query_string": {
          "query": "message:exception AND service_name:application_*"
        }
      },
      "filter": {
        "range": {
          "@timestamp": {
            "gte": "<formatted service startup time>",
            "format": "yyyy-MM-dd hh:mm:ss"
          }
        }
      }
    }
  },
  "size":<size>
}

Building custom Monitors as a plugin

see here

elcep's People

Contributors

benjamin-hofmann-mw avatar christle avatar xellsys avatar michaelharrer avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.