A Prometheus exporter, written in Golang, for Magento 2

Magento 2 Prometheus Exporter

A Prometheus exporter, written in Golang, for Magento 2.

Philosophy

It might be abnormal to start with the "philosophy" but I do believe it lays the groundwork for the "why" of another Prometheus exporter when one already exists or you might be considering writing your own.

Magento 2 in and of itself already is a beast of a monolith, even without additions made by merchants (e.g. modules). Why should introducing observability (using Prometheus) be another one of these additions which complicate the Magento 2 monolith even further?

"Magento 2 Prometheus Exporter" is a Prometheus exporter which uses the Magento API to construct metrics which it then exports / exposes towards Prometheus, rather than extending Magento 2 itself.

Contradiction

So... I explained the reasoning behind writing another Prometheus exporter for Magento 2 but what I didn't say is that there exists a module for Magento 2 which needs to be installed on the environment you are monitoring. Why talk all evil about "extending Magento 2" and "making a monolith even more complicated" and then still do it yourself?

  • Magento 2 itself does not expose enough information for proper metrics
  • APIs exposed by Magento 2 sometimes return and do more than we need

Why not write the exporter in Magento 2 itself then? Simple, this is because I believe strongly in the "Single Responsibility Principle" (whenever this is reasonable). Reasonable? Whenever you work with a third-party platform (e.g. Magento 2) it might not be reasonable to expect, require or criticize for the Single Responsibility Principle not being used.

  • It is not possible to independently scale Magento 2 itself and the exporter when it is a module
  • Magento 2 by itself (using the traditional webapi.xml) does not support output as text (only JSON and XML)
  • If you were to extend it to allow for output as text you wouldn't be able to use integrations for access control

It would obviously be possible to extend Magento 2 in such a way to allow for output as text through the "Web API" and still make use of integrations (and thus access control) but then you would not be writing an exporter anymore. It would be another module trying to get things done within the boundaries and of Magento 2 with a negative impact on quality, stability, upgradability of the platform.

Running It

"Magento 2 Prometheus Exporter" is the exporter itself, written in Golang, which can be scraped by Prometheus. It is meant to be ran as a process alongside your Magento 2 environment (whether it is on-premise or in the cloud).

Whatever Magento 2 environment the exporter is scraping metrics from needs to have the below module installed. https://github.com/Serializator/magento2-module-prometheus-exporter

In a Kubernetes environment this might mean introducing th "Sidecar Pattern" or when running the exporter on a bare-metal server (on-premise) it might be a process managed by Supervisor.

Owner
Julian
A (kinda) funny and passionate self-taught Software Developer who doesn't like pizza... I know, it's weird!
Julian
Similar Resources

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

Dec 27, 2022

Prometheus exporter for Amazon Elastic Container Service (ECS)

ecs_exporter 🚧 🚧 🚧 This repo is still work in progress and is subject to change. This repo contains a Prometheus exporter for Amazon Elastic Contai

Nov 27, 2022

Prometheus exporter for DeadMansSnitch

DeadMansSnitch Exporter Prometheus exporter for DeadMansSnitch information (snitches) Configuration Usage: deadmanssnitch-exporter [OPTIONS] Applic

Apr 6, 2022

A prometheus exporter for monitoring FIO nodeos nodes.

A prometheus exporter for monitoring FIO nodeos nodes.

fio-prometheus-exporter This is a simple prometheus exporter for FIO nodeos nodes. It can connect to multiple nodes to display a few critical statisti

Aug 19, 2022

Prometheus exporter for podman

Prometheus exporter for podman Exports the following metrics for each running container CPU Usage Memory Usage Netowrk Usage Block Usage Output Exampl

Jul 5, 2022

A Prometheus exporter which scrapes metrics from CloudLinux LVE Stats 2

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

Nov 2, 2021

Prometheus exporter of Hetzner Cloud inventory

Hetzner Cloud inventory exporter Prometheus exporter of Hetzner Cloud inventory Build Using docker Requires docker make build Locally Requires go buil

Dec 14, 2022

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

Dec 10, 2022

Prometheus exporter for IAAS daily billing information

Prometheus exporter for IAAS daily billing information

Multi-iaas-daily-billing-exporter Multi-iaas-daily-billing-exporter enables to collect, unify and expose daily billing from AWS and GCP providers. The

Dec 14, 2021
Json-log-exporter - A Nginx log parser exporter for prometheus metrics

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

Jan 5, 2022
Amplitude-exporter - Amplitude charts to prometheus exporter PoC

Amplitude exporter Amplitude charts to prometheus exporter PoC. Work in progress

May 26, 2022
Vulnerability-exporter - A Prometheus Exporter for managing vulnerabilities in kubernetes by using trivy
Vulnerability-exporter - A Prometheus Exporter for managing vulnerabilities in kubernetes by using trivy

Kubernetes Vulnerability Exporter A Prometheus Exporter for managing vulnerabili

Dec 4, 2022
Netstat exporter - Prometheus exporter for exposing reserved ports and it's mapped process

Netstat exporter Prometheus exporter for exposing reserved ports and it's mapped

Feb 3, 2022
Goatmo - Dht22 prometheus exporter written in golang

description Prometheus exporter for the DHT22 written in go. usage In order to a

Aug 8, 2022
Github exporter for Prometheus metrics. Written in Go, with love ❤️

Github exporter for Prometheus This is a Github exporter for Prometheus metrics exposed by Github API. Written in Go with pluggable metrics collectors

Oct 5, 2022
Github billing exporter - Billing exporter for GitHub organizations

GitHub billing exporter Forked From: https://github.com/borisputerka/github_bill

Nov 2, 2022
📡 Prometheus exporter that exposes metrics from SpaceX Starlink Dish
📡  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

Dec 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

Sep 19, 2022
Nvidia GPU exporter for prometheus using nvidia-smi binary
Nvidia GPU exporter for prometheus using nvidia-smi binary

nvidia_gpu_exporter Nvidia GPU exporter for prometheus, using nvidia-smi binary to gather metrics. Introduction There are many Nvidia GPU exporters ou

Jan 5, 2023