Export Prometheus metrics from journald events using Prometheus Go client library

Overview

journald parser and Prometheus exporter

Export Prometheus metrics from journald events using Prometheus Go client library. For demonstration purposes, journald is filtered for the sudo syslog identifier and a basic Prometheus counter metric is incremented.

Build

go get github.com/msgarbossa/prom-journald-exporter
cd $GOPATH/src/github.com/msgarbossa/prom-journald-exporter
go build

Download

The linux-amd64 build can be downloaded from releases

Example

When started with the -debug option, matching journald entries are printed to stdout.

$ ./prom_journald_exporter -h
Usage of ./prom_journald_exporter:
  -debug
    	Enable debug
  -listenHTTP string
    	ip:port to listen for http requests (default ":9101")

$ ./prom_journald_exporter -debug
listening on :9101 /metrics

Run a sudo command from another session and verify metric counts.

$ curl -s http://localhost:9101/metrics | grep sudo
# HELP sudo_count_total The total number of sudo events
# TYPE sudo_count_total counter
sudo_count_total 0

$ sudo ls > /dev/null

$ curl -s http://localhost:9101/metrics | grep sudo
# HELP sudo_count_total The total number of sudo events
# TYPE sudo_count_total counter
sudo_count_total 3
You might also like...
A Prometheus metrics exporter for AWS that fills in gaps CloudWatch doesn't cover

YAAE (Yet Another AWS Exporter) A Prometheus metrics exporter for AWS that fills in gaps CloudWatch doesn't cover About This exporter is meant to expo

Prometheus metrics exporter for libvirt.

Libvirt exporter Prometheus exporter for vm metrics written in Go with pluggable metric collectors. Installation and Usage If you are new to Prometheu

Prometheus Exporter for Kvrocks Metrics
Prometheus Exporter for Kvrocks Metrics

Prometheus Kvrocks Metrics Exporter This is a fork of oliver006/redis_exporter to export the kvrocks metrics. Building and running the exporter Build

Helper sidecar for exposing Prometheus metrics as service

metrics-server-go Helper sidecar service for exposing prometheus metrics. Application expose endpoints to update defined metrics. Whats inside? The se

Prometheus metrics from Deco M4

Prometheus Deco Exporter Provider prometheus metrics from Deco M4. Usage Set the environment variables DECO_EXPORTER_ADDR to the address of your main

A prometheus exporter which reports metrics about your Gmail inbox.

prometheus-gmail-exporter-go A prometheus exporter for gmail. Heavily inspired by https://github.com/jamesread/prometheus-gmail-exporter, but written

LLS-Exporter exports fuel level sensor data (rs-485 lls protocol) as prometheus metrics

LLS Exporter LLS Exporter reads rs485/rs232 data from serial port, decodes lls protocol and exports fuel level sensor data as prometheus metrics. Lice

A toy project to play music (aha, Nose in fact) through Prometheus metrics

tiplay A toy project to play music (aha, mostly Noise in fact) through Prometheu

Json-log-exporter - A Nginx log parser exporter for prometheus metrics

json-log-exporter A Nginx log parser exporter for prometheus metrics. Installati

Owner
Mike Sgarbossa
Mike Sgarbossa
Sensu-go-postgres-metrics - The sensu-go-postgres-metrics is a sensu check that collects PostgreSQL metrics

sensu-go-postgres-metrics Table of Contents Overview Known issues Usage examples

Scott Cupit 0 Jan 12, 2022
The metrics-agent collects allocation metrics from a Kubernetes cluster system and sends the metrics to cloudability

metrics-agent The metrics-agent collects allocation metrics from a Kubernetes cluster system and sends the metrics to cloudability to help you gain vi

null 0 Jan 14, 2022
HSDP Metrics alerts webhook broker and CF events forwarder for Microsoft Teams

hsdp-events Microservice helper to translate HSDP Metrics webhooks to Microsoft Teams webhooks Configuration Environment Description EVENTS_TOKEN Rand

Philips Labs 2 Mar 18, 2022
This library provides a metrics package which can be used to instrument code, expose application metrics, and profile runtime performance in a flexible manner.

This library provides a metrics package which can be used to instrument code, expose application metrics, and profile runtime performance in a flexible manner.

null 0 Jan 18, 2022
cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resource objects related of Kubernetes Cluster API.

Overview cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resou

Daimler Group 60 Aug 16, 2022
Flash-metrics - Flash Metrics Storage With Golang

Flash Metrics Storage bootstrap: $ echo -e "max-index-length = 12288" > tidb.con

null 3 Jan 8, 2022
📡 Prometheus exporter that exposes metrics from SpaceX Starlink Dish

Starlink Prometheus Exporter A Starlink exporter for Prometheus. Not affiliated with or acting on behalf of Starlink(™) ?? Starlink Monitoring System

DanOpsTech 77 Sep 19, 2022
Prometheus exporter for Chia node metrics

chia_exporter Prometheus metric collector for Chia nodes, using the local RPC API Building and Running With the Go compiler tools installed: go build

Kevin Retzke 34 Aug 30, 2022
NVIDIA GPU metrics exporter for Prometheus leveraging DCGM

DCGM-Exporter This repository contains the DCGM-Exporter project. It exposes GPU metrics exporter for Prometheus leveraging NVIDIA DCGM. Documentation

NVIDIA Corporation 183 Sep 21, 2022
A Prometheus exporter which scrapes metrics from CloudLinux LVE Stats 2

CloudLinux LVE Exporter for Prometheus LVE Exporter - A Prometheus exporter which scrapes metrics from CloudLinux LVE Stats 2 Help on flags: -h, --h

Tsvetan Gerov 1 Nov 2, 2021