Giter Club home page Giter Club logo

ansible-grok-exporter's Introduction

grok-exporter

Installs with Ansible Grok exporter for Prometheus from https://github.com/fstab/grok_exporter

Requirments

unzip on the target machine

Role Variables

  • grok_exporter_version - exporter version to be downloaded from the above repo

  • grok_exporter_system_group - save & run the executable under this group, defaults to grok_exporter

  • grok_exporter_system_user - save & run the executable under this group, defaults to the name of the group grok_exporter_system_group

  • grok_services - For each log that you want to process you must define a service, a config file will be generated and a systemd service will be activated for each one. See defaults/main.yml for a detailed example of a service.

You can then use grok_services in your Prometheus server to tell it what to scrape.

Example Playbook

Add it to your playbook

  • hosts: servers roles:
    • role: eRadical.grok-exporter

Example of services:

grok_services:

  • name: php-fpm-metrics-game-app config_version: 2 input: type: file path: /www/app/php-fpm-logs/www-access.log readall: true additional_patterns:
    • 'FPMDATE %{MONTHDAY}/%{MONTH}/%{YEAR}:%{TIME} %{ISO8601_TIMEZONE}' metrics:
    • type: gauge name: php_fpm_request_duration_miliseconds help: Total number of rejected recipients, partitioned by error message. match: '%{FPMDATE:requestdate} ~ %{WORD:verb} ~ %{URIPATH:apirequest} ~ %{NUMBER:statuscode} ~ %{NUMBER:durationmili} ~ %{NUMBER:memorykilo} ~ %{NUMBER:cpuperc}' value: "{{ '{{' }}.durationmili{{ '}}' }}" cumulative: false labels: http_verb: "{{ '{{' }}.verb{{ '}}' }}" api_request: "{{ '{{' }}.apirequest{{ '}}' }}" status_code: "{{ '{{' }}.statuscode{{ '}}' }}" .......................................................................... server: host: "{{ ansible_eth0.ipv4.address }}" port: 9144

License

ansible-grok-exporter's People

Contributors

eradical avatar geohost avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.