Understanding OpenTelemetry: The Future of Observability

OpenTelemetry (often abbreviated as OTel) is an open-source, vendor-neutral observability framework. It provides a standardized set of APIs, SDKs, and tools to design, generate, collect, and export telemetry data (metrics, logs, and traces) from your software applications.

Managed by the Cloud Native Computing Foundation (CNCF)—the same body behind Kubernetes and Prometheus—OpenTelemetry has quickly become the absolute industry standard for modern application monitoring.

Why OpenTelemetry Exists (The Problem It Solves)

Historically, if you wanted to monitor an application, you had to install vendor-specific code or agents.

  • If you used Datadog, you had to install the Datadog SDK.
  • If you switched to Dynatrace, New Relic, or AppDynamics, you had to rewrite parts of your application code to use their specific libraries.

This created massive vendor lock-in.

OpenTelemetry completely decouples data collection from data storage. You instrument your application once using the universal OpenTelemetry standard. If you want to change your monitoring backend later from Datadog to an open-source stack like Prometheus and Grafana, you just change a single line in a configuration file—no code changes required.

The Three Pillars of Telemetry (M.E.L.T.)

OpenTelemetry is designed to handle all three primary types of observability data:

  1. Traces: Tracks the end-to-end journey of a single request as it travels across different microservices, databases, and APIs. It helps you pinpoint exactly which function or database query is causing a slowdown.
  2. Metrics: Numeric values measured over time (e.g., CPU utilization, memory usage, request counts, error rates).
  3. Logs: Structured text records of discrete events (e.g., a system crash log or an authentication failure message).

The Architecture: How It Works

An OpenTelemetry implementation generally consists of three main parts:

┌─────────────────────────┐
│ Your Application │ (App is instrumented with OTel SDK)
│ [Go, Python, Java...] │
└────────────┬────────────┘
│ (OTLP Protocol)
┌─────────────────────────┐
│ OpenTelemetry Collector│ (A lightweight proxy running on the host)
└────────────┬────────────┘
├────────────────────────┬────────────────────────┐
▼ ▼ ▼
[ Prometheus ] [ Grafana Loki ] [ Jaeger / Tempo ]
(Metrics) (Logs) (Traces)
1. The API and SDK

You include the OpenTelemetry library directly inside your application code. OpenTelemetry features Auto-Instrumentation for popular languages. If you run a Python FastAPI or Java Spring Boot application, OTel can automatically capture database queries and HTTP requests without you writing a single line of custom telemetry code.

2. The OTLP Protocol

All data generated by the SDK uses a unified language called OTLP (OpenTelemetry Protocol), ensuring standard formatting across every application in your environment.

3. The OpenTelemetry Collector (The Muscle)

The Collector is a separate, lightweight binary or container that runs alongside your application (similar to how Node Exporter runs on a Linux host). It receives the data from your applications, processes it (batches it, strips sensitive PII data, compresses it), and exports it to your chosen backend databases.

How It Fits With Your Prometheus & Grafana Stack

If you are already working with Prometheus, Grafana, and Alertmanager, OpenTelemetry integrates seamlessly into your world:

  • Prometheus excels at pulling metrics, but it historically doesn’t handle tracing well.
  • OpenTelemetry is unmatched at generating application traces and logs.

In a modern production stack, engineers often use OpenTelemetry inside their application code to generate traces and metrics. They send that data to the OpenTelemetry Collector, which is then configured to forward the metrics straight into Prometheus, logs into Grafana Loki, and traces into Grafana Tempo.

Ultimately, everything gets visualized on a unified Grafana dashboard, giving you total visibility from the bare-metal hardware all the way down to a single line of application code.

How to Set Up MySQL Dashboards in Grafana

Some great Grafana MySQL dashboard options:

Option 1: Official MySQL Dashboard (Recommended)

Dashboard ID: 7362 — MySQL Overview by percona

Import it directly in Grafana:

Dashboards → Import → Enter ID: 7362 → Load

Covers: QPS, connections, InnoDB buffer pool, slow queries, replication lag.


Option 2: Popular Community Dashboards

Dashboard IDNameBest For
7362MySQL Overview (Percona)General purpose
6239MySQL InnoDB MetricsDeep InnoDB tuning
14057MySQL Exporter Quickstartmysqld_exporter default
11323MySQL ReplicationMaster/slave monitoring

Setup Requirements

1. Install mysqld_exporter

# Download
wget https://github.com/prometheus/mysqld_exporter/releases/latest/download/mysqld_exporter-*.linux-amd64.tar.gz
# Create MySQL user for exporter
mysql -u root -p
CREATE USER 'exporter'@'localhost' IDENTIFIED BY 'yourpassword' WITH MAX_USER_CONNECTIONS 3;
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'localhost';
FLUSH PRIVILEGES;
2. Configure exporter credentials
# /etc/.my.cnf
[client]
user=exporter
password=yourpassword
3. Run the exporter
./mysqld_exporter --config.my-cnf=/etc/.my.cnf
# Default port: 9104
4. Add to Prometheus scrape config
# prometheus.yml
scrape_configs:
- job_name: 'mysql'
static_configs:
- targets: ['localhost:9104']

Key Metrics to Monitor

# Queries per second
rate(mysql_global_status_queries[5m])
# Active connections
mysql_global_status_threads_connected
# Connection usage %
100 * mysql_global_status_threads_connected
/ mysql_global_variables_max_connections
# Slow queries rate
rate(mysql_global_status_slow_queries[5m])
# InnoDB buffer pool hit rate
(1 - rate(mysql_global_status_innodb_buffer_pool_reads[5m])
/ rate(mysql_global_status_innodb_buffer_pool_read_requests[5m])) * 100
# Replication lag (if replica)
mysql_slave_status_seconds_behind_master

What to Alert On

MetricThresholdSeverity
Connection usage> 80%Warning
Connection usage> 95%Critical
Replication lag> 30sWarning
Slow queries rate> 10/sWarning
Buffer pool hit rate< 95%Warning
Uptime (restarted)< 300sCritical

Quick start: Just import dashboard 7362 — it works out of the box with mysqld_exporter defaults and covers 90% of what you need.

Understanding Alertmanager in the Prometheus Ecosystem

Alertmanager is the specialized component of the Prometheus ecosystem that handles alerts.

While Prometheus is responsible for recording metrics and triggering an alert when something goes wrong (like a server running out of RAM), Prometheus itself has no idea how to send an email, slack message, or page an engineer. It hands that problem off to Alertmanager.

The Workflow: How an Alert Moves

[ Your Servers ] ──(Metrics)──► [ Prometheus ]
▼ (Metrics hit a threshold)
[ Alertmanager ]
┌──────────────────────┼──────────────────────┐
▼ ▼ ▼
[ Email ] [ Slack ] [ PagerDuty ]
  1. Prometheus constantly evaluates your data against rules you write (e.g., Is CPU usage > 90% for more than 5 minutes?). If yes, Prometheus fires the alert and shoots it over to Alertmanager.
  2. Alertmanager takes that raw alert and figures out how to handle it intelligently.
  3. The Receiver (Slack, Email, PagerDuty, Discord, etc.) actually delivers the message to your team.

Why do we need a separate tool just for alerts?

You might wonder why Prometheus doesn’t just send emails directly. Alertmanager exists because in a large infrastructure (like your 20+ servers), raw alerts can quickly turn into a nightmare without three critical features:

1. Grouping (Preventing “Alert Fatigue”)

Imagine a network switch dies, cutting off 15 of your Docker hosts at the exact same moment. If Prometheus sent alerts directly, you would get 15 individual emails or Slack pings within 10 seconds, blowing up your phone.

Alertmanager groups them. It sees that 15 servers failed for the same reason, bundles them into one single notification: “Alert: 15 hosts are currently unreachable.”

2. Inhibition (Muting Dependent Alerts)

If a physical server completely crashes, both the Host Down alert and the 10 Containers on this Host are Down alerts will trigger. You don’t need to be told the containers are down if you already know the whole machine is dead. Alertmanager allows you to mute (inhibit) the container alerts if the main host alert is already active.

3. Silencing

If you are doing planned maintenance on server-05 on a Tuesday morning, you can log into Alertmanager’s web interface and click Silence for that specific server for 2 hours. Prometheus will keep tracking the metrics, but Alertmanager will block any notifications from waking up your team while you work on it.

A Quick Look at How It Connects to Your Stack

Since you are running your central monitoring stack via Portainer, you would add an Alertmanager service to your existing Docker Compose file right alongside Prometheus and Grafana:

YAML

  alertmanager:
    image: prom/alertmanager:latest
    container_name: central-alertmanager
    ports:
      - "9093:9093"
    volumes:
      - /opt/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml
    restart: unless-stopped


In your alertmanager.yml file, you define your routing. For example, telling it to route critical alerts to Slack and warning alerts to Email:

YAML

route:
receiver: 'slack-notifications'
receivers:
- name: 'slack-notifications'
slack_configs:
- api_url: 'https://hooks.slack.com/services/T000/B000/XXXXXX'
channel: '#ops-alerts'
Alertmanager vs. Grafana Alerting

Note that Grafana can also send alerts based on your dashboards. However, in professional setups using Prometheus, engineers prefer Alertmanager because it can process math across your entire fleet instantly at the database level, rather than waiting for a Grafana graph to load and trigger.

Effective Prometheus and Grafana Setup for Linux and Windows Servers

A complete Prometheus + Grafana monitoring solution for 20 Linux servers + 20 Windows servers is absolutely achievable with a single, scalable monitoring stack. Below is a clear architecture, required components, and step‑by‑step setup based on authoritative sources.


Concise Takeaway

You will deploy Prometheus on a central Linux server, install node_exporter on all 20 Linux hosts, install windows_exporter on all 20 Windows hosts, and visualize everything in Grafana. Prometheus scrapes all 40 servers on a schedule and Grafana queries Prometheus for dashboards. Grafana Labs mylinux.work


Recommended Architecture

  • Prometheus server (Linux) — scrapes metrics from all exporters.
  • Node Exporter on each Linux server — exposes CPU, RAM, disk, network metrics.
  • Windows Exporter on each Windows server — exposes Windows OS metrics on port 9182. devopsofworld.com
  • Grafana server — dashboards + alert visualization.
  • Alertmanager (optional but recommended) — email/Slack/Teams alerts. mylinux.work

1. Install Exporters on All Servers

Linux (20 servers)

Install node_exporter on each Linux host:

  • Prometheus documentation recommends Node Exporter for Linux metrics. Grafana Labs
  • Metrics exposed on port 9100.

Windows (20 servers)

Install windows_exporter:

Example Windows service install (from source):

nssm install Windows_exporter C:\path\windows_exporter.exe --collectors.enabled="cpu,logical_disk,net,os,service,system"

2. Prometheus Configuration

Prometheus scrapes all 40 servers.
Example prometheus.yml:

scrape_configs:
- job_name: 'linux'
static_configs:
- targets:
- 'linux01:9100'
- 'linux02:9100'
# ... all 20 Linux servers
- job_name: 'windows'
static_configs:
- targets:
- 'win01:9182'
- 'win02:9182'
# ... all 20 Windows servers

Windows scrape configuration is consistent with documented examples. mylinux.work


3. Grafana Setup

Grafana connects to Prometheus as a data source.

Recommended dashboards:

  • Node Exporter Full (Linux)
  • Windows Exporter Dashboard (Windows) — available from Grafana community. devopsofworld.com

4. Alerting (Optional but Recommended)

Use Alertmanager for notifications:

  • Email
  • Slack / Teams
  • Webhooks

Alertmanager is part of the standard Linux monitoring stack. mylinux.work


5. Hardware Requirements (for 40 servers)

For a single Prometheus + Grafana node:

ComponentRecommended
CPU4 vCPUs
RAM8–16 GB
Storage100–200 GB SSD
OSLinux (Ubuntu recommended)

This is inferred from typical Prometheus deployments for ~50 nodes.


6. Deployment Model Options

Option A — Single Monitoring Server (simplest)

  • Prometheus + Grafana on one VM
  • Good for up to ~100 nodes

Option B — Distributed (Prometheus + Grafana separate)

  • Prometheus on one VM
  • Grafana on another
  • More scalable; recommended by LinuxConfig architecture. LinuxConfig.org

7. What You Will Monitor

  • CPU, RAM, Disk, Network
  • Windows services
  • Windows event metrics
  • Linux system metrics
  • Optional: Docker, cAdvisor, SQL Server, IIS, etc. kx.cloudingenium.com

Next step

  • Prometheus configuration
  • Deployment diagram
  • Step-by-step guide

Here is a clear, production‑grade monitoring architecture diagram for your Prometheus + Grafana setup covering 20 Linux + 20 Windows servers.
I’m giving you both a visual ASCII diagram and a conceptual architecture so you can use it in documentation or design reviews.


Monitoring Architecture Diagram (Prometheus + Grafana)

                           ┌──────────────────────────────┐
                           │        Grafana Server         │
                           │  - Dashboards & Visualization │
                           │  - Connects to Prometheus     │
                           └───────────────▲──────────────┘
                                           │
                                           │  Queries
                                           │
                           ┌───────────────┴──────────────┐
                           │       Prometheus Server      │
                           │  - Scrapes all exporters     │
                           │  - Stores time‑series data   │
                           │  - Pushes alerts to AM       │
                           └───────────────▲──────────────┘
                                           │
                                           │  Scrape (HTTP)
                                           │
        ┌──────────────────────────┬───────┴───────────────┬──────────────────────────┐
        │                          │                       │                          │
        │                          │                       │                          │
┌───────────────┐        ┌────────────────┐       ┌────────────────┐        ┌───────────────┐
│ 20 Linux       │       │ 20 Windows     │       │ Alertmanager   │        │ Optional Tools │
│ Servers        │       │ Servers        │       │ (Email/Slack)  │        │  - cAdvisor    │
│ node_exporter  │       │ windows_exporter│      │ Notifications  │        │  - Blackbox    │
│ Port 9100      │       │ Port 9182       │      │ Routing        │        │  - SNMP Export │
└───────────────┘        └────────────────┘       └────────────────┘        └───────────────┘




How the Architecture Works

  • Prometheus scrapes metrics from:
    • node_exporter on each Linux server
    • windows_exporter on each Windows server
  • Grafana queries Prometheus to build dashboards.
  • Alertmanager receives alerts from Prometheus and sends notifications.
  • Exporters expose metrics over HTTP; Prometheus pulls them on a schedule.

Component Breakdown

  • Prometheus Server
    Central collector + time‑series database.
  • Grafana Server
    Dashboards, visualization, alerting UI.
  • Node Exporter
    Linux OS metrics (CPU, RAM, disk, network).
  • Windows Exporter
    Windows OS metrics (services, CPU, memory, disks).
  • Alertmanager
    Email, Slack, Teams, webhook alerts.

Optional Add‑Ons

  • Blackbox Exporter — HTTP/TCP/ICMP checks
  • cAdvisor — container metrics
  • SNMP Exporter — network devices