GithubHelp home page GithubHelp logo

isabella232 / sensu-prometheus-collector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sensu/sensu-prometheus-collector

0.0 0.0 0.0 339 KB

Collect Prometheus metrics with Sensu!

License: MIT License

Go 100.00%

sensu-prometheus-collector's Introduction

Bonsai Asset Badge

Sensu Prometheus Collector

Table of Contents

Overview

The Sensu Prometheus Collector is a Sensu Check Plugin that collects metrics from a Prometheus exporter or the Prometheus query API. The collected metrics are outputted to STDOUT in one of three formats, Influx (the default), Graphite, or JSON.

The Sensu Prometheus Collector turns Sensu into a SUPER POWERED Prometheus metric poller, leveraging Sensu's pubsub design and client auto-registration (discovery). Sensu can deliver collected metrics to one or more time-series databases, for example InfluxDB and/or Graphite! Instrument your applications with the Prometheus libraries and immediately begin collecting your metrics with Sensu!

Usage examples

Help:

Usage of sensu-prometheus-collector:
  -exporter-authorization string
        Prometheus exporter Authorization header.
  -exporter-password string
        Prometheus exporter basic auth password.
  -exporter-url string
        Prometheus exporter URL to pull metrics from.
  -exporter-user string
        Prometheus exporter basic auth user.
  -metric-prefix string
        Metric name prefix, only supported by line protocol output formats.
  -output-format string
        The check output format to use for metrics {influx|graphite|json}. (default "influx")
  -prom-query string
        Prometheus API query string. (default "up")
  -prom-url string
        Prometheus API URL. (default "http://localhost:9090")

Application instrumentation:

$ sensu-prometheus-collector -exporter-url http://localhost:8080/metrics
go_memstats_last_gc_time_seconds value=0 1506991233
go_memstats_mspan_sys_bytes value=32768 1506991233
...
$ sensu-prometheus-collector -exporter-url http://localhost:8080/metrics -exporter-user admin -exporter-password secretpassword -output-format graphite -metric-prefix foo.bar.
foo.bar.go_memstats_stack_inuse_bytes 294912 1506991405
foo.bar.go_memstats_mallocs_total 6375 1506991405
...

Exporter basic auth credentials can also be set via environment vars EXPORTER_USER and EXPORTER_PASSWORD.

Prometheus query API:

$ sensu-prometheus-collector -prom-url http://localhost:9090 -prom-query up
up,instance=localhost:9090,job=prometheus value=1 1506991495

Configuration

Asset registration

Sensu Assets are the best way to make use of this plugin. If you're not using an asset, please consider doing so! If you're using sensuctl 5.13 with Sensu Backend 5.13 or later, you can use the following command to add the asset:

sensuctl asset add sensu/sensu-prometheus-collector

If you're using an earlier version of sensuctl, you can find the asset on the Bonsai Asset Index.

Resource definition

---
type: CheckConfig
api_version: core/v2
metadata:
  name: sensu-prom-metrics
spec:
  command: sensu-prometheus-collector -exporter-url http://localhost:9182/metrics
  output_metric_format: influxdb_line
  output_metric_handlers:
  - influxdb
  runtime_assets:
  - sensu/sensu-prometheus-collector
  subscriptions:
  - linux
  timeout: 5
  ttl: 0

Installation from source

The preferred way of installing and deploying this plugin is to use it as an Asset. If you would like to compile and install the plugin from source or contribute to it, download the latest version or create an executable script from this source.

From the local path of the sensu-prometheus-collector repository:

go build

Contributing

For more information about contributing to this plugin, see Contributing.

sensu-prometheus-collector's People

Contributors

portertech avatar asachs01 avatar apaskulin avatar discordianfish avatar zsais 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.