# solacecommunity/solace-prometheus-exporter architecture

> Architecture diagram of the GitHub repository solacecommunity/solace-prometheus-exporter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/solacecommunity/solace-prometheus-exporter
- Repository: https://github.com/solacecommunity/solace-prometheus-exporter

## Overview

Solace Prometheus Exporter is a broker-to-monitoring adapter: Prometheus scrape requests select metric targets, the exporter dispatches broker queries over SEMP, and the resulting metrics are exposed over HTTP. Its documented capabilities also include endpoint aliases, per-request broker overrides, authentication, TLS, hardware-specific targets, and asynchronous prefetch. The sampled collector shows target dispatch; some detailed wiring for configuration, SEMP transport, and prefetch is not shown, so those links are omitted or marked unverified.

Main entry points: [`internal/exporter/exporter.collect.go`](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/exporter.collect.go) (Target dispatcher), [`cmd/solace-prometheus-exporter/main.go`](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/cmd/solace-prometheus-exporter/main.go) (Scrape endpoints), [`internal/semp/http.go`](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/semp/http.go) (SEMP HTTP transport), [`internal/semp`](https://github.com/solacecommunity/solace-prometheus-exporter/tree/master/internal/semp) (System and hardware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_serve["HTTP serving"]
  node_main["Exporter entry point<br/>[main.go]"]
  node_routes["Scrape endpoints<br/>[main.go]"]
  node_landing["Endpoint landing page<br/>[handler.go]"]
end

subgraph group_scrape["Scrape orchestration"]
  node_config["Broker and scrape config<br/>[config.struct.go]"]
  node_request_config["Request overrides<br/>[main.go]"]
  node_async["Async prefetch<br/>[asyncFetcher.go]"]
  node_collector["Target dispatcher"]
  node_prom_metrics["Prometheus metrics"]
end

subgraph group_brokerdata["Broker metrics"]
  node_sempsys["System and hardware"]
  node_sempvpn["VPN and replication"]
  node_sempqueue["Queue and spool"]
  node_sempclient["Client and bridge"]
  node_metric_desc["Metric descriptions<br/>[metricDesc.go]"]
end

subgraph group_security["Security and transport"]
  node_web_auth["Exporter Basic Auth<br/>[auth.go]"]
  node_semphttp["SEMP HTTP transport<br/>[http.go]"]
  node_broker_auth["Broker authentication<br/>[auth.go]"]
  node_tls["TLS listener<br/>[tlsServer.go]"]
end

node_prometheus(("Prometheus scraper"))
node_broker[("Solace broker")]

node_prometheus -->|"scrapes"| node_routes
node_main -->|"serves"| node_routes
node_routes -->|"resolves overrides"| node_request_config
node_routes -->|"dispatches scrape"| node_collector
node_routes -.->|"serves page"| node_landing
node_routes -->|"protects endpoints"| node_web_auth
node_config -.->|"configures targets"| node_collector
node_collector -->|"dispatches targets"| node_sempsys
node_collector -->|"dispatches targets"| node_sempvpn
node_collector -->|"dispatches targets"| node_sempqueue
node_collector -->|"dispatches targets"| node_sempclient
node_sempsys -.->|"sends SEMP"| node_semphttp
node_sempvpn -.->|"sends SEMP"| node_semphttp
node_sempqueue -.->|"sends SEMP"| node_semphttp
node_sempclient -.->|"sends SEMP"| node_semphttp
node_semphttp -->|"queries"| node_broker
node_broker_auth -.->|"authenticates requests"| node_semphttp
node_collector -->|"collects metrics"| node_prom_metrics
node_metric_desc -.->|"describes metrics"| node_prom_metrics
node_async -.->|"prefetches metrics"| node_collector
node_tls -.->|"secures listener"| node_routes

click node_main "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/cmd/solace-prometheus-exporter/main.go"
click node_routes "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/cmd/solace-prometheus-exporter/main.go"
click node_landing "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/web/handler.go"
click node_web_auth "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/web/auth.go"
click node_config "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/config.struct.go"
click node_request_config "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/cmd/solace-prometheus-exporter/main.go"
click node_async "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/asyncFetcher.go"
click node_collector "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/exporter.collect.go"
click node_sempsys "https://github.com/solacecommunity/solace-prometheus-exporter/tree/master/internal/semp"
click node_sempvpn "https://github.com/solacecommunity/solace-prometheus-exporter/tree/master/internal/semp"
click node_sempqueue "https://github.com/solacecommunity/solace-prometheus-exporter/tree/master/internal/semp"
click node_sempclient "https://github.com/solacecommunity/solace-prometheus-exporter/tree/master/internal/semp"
click node_semphttp "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/semp/http.go"
click node_broker_auth "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/auth.go"
click node_metric_desc "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/semp/metricDesc.go"
click node_prom_metrics "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/exporter.collect.go"
click node_tls "https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/tlsServer.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_routes,node_landing toneBlue
class node_config,node_request_config,node_async,node_collector,node_prom_metrics,node_broker toneAmber
class node_sempsys,node_sempvpn,node_sempqueue,node_sempclient,node_metric_desc toneMint
class node_web_auth,node_semphttp,node_broker_auth,node_tls toneRose
class node_prometheus toneIndigo
```

## Components

### HTTP serving

- [Exporter entry point](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/cmd/solace-prometheus-exporter/main.go): `cmd/solace-prometheus-exporter/main.go`
- [Scrape endpoints](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/cmd/solace-prometheus-exporter/main.go): `cmd/solace-prometheus-exporter/main.go`
- [Endpoint landing page](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/web/handler.go): `internal/web/handler.go`

### Scrape orchestration

- [Broker and scrape config](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/config.struct.go): `internal/exporter/config.struct.go`
- [Request overrides](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/cmd/solace-prometheus-exporter/main.go): `cmd/solace-prometheus-exporter/main.go`
- [Async prefetch](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/asyncFetcher.go): `internal/exporter/asyncFetcher.go`
- [Target dispatcher](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/exporter.collect.go): `internal/exporter/exporter.collect.go`
- [Prometheus metrics](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/exporter.collect.go): `internal/exporter/exporter.collect.go`

### Broker metrics

- [System and hardware](https://github.com/solacecommunity/solace-prometheus-exporter/tree/master/internal/semp): `internal/semp`
- [VPN and replication](https://github.com/solacecommunity/solace-prometheus-exporter/tree/master/internal/semp): `internal/semp`
- [Queue and spool](https://github.com/solacecommunity/solace-prometheus-exporter/tree/master/internal/semp): `internal/semp`
- [Client and bridge](https://github.com/solacecommunity/solace-prometheus-exporter/tree/master/internal/semp): `internal/semp`
- [Metric descriptions](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/semp/metricDesc.go): `internal/semp/metricDesc.go`

### Security and transport

- [Exporter Basic Auth](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/web/auth.go): `internal/web/auth.go`
- [SEMP HTTP transport](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/semp/http.go): `internal/semp/http.go`
- [Broker authentication](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/auth.go): `internal/exporter/auth.go`
- [TLS listener](https://github.com/solacecommunity/solace-prometheus-exporter/blob/master/internal/exporter/tlsServer.go): `internal/exporter/tlsServer.go`

### Other components

- **Prometheus scraper**
- **Solace broker**

## Connections

- Prometheus scraper → Scrape endpoints: scrapes
- Exporter entry point → Scrape endpoints: serves (evidence: `cmd/solace-prometheus-exporter/main.go`)
- Scrape endpoints → Request overrides: resolves overrides (evidence: `cmd/solace-prometheus-exporter/main.go`)
- Scrape endpoints → Target dispatcher: dispatches scrape
- Scrape endpoints → Endpoint landing page: serves page
- Scrape endpoints → Exporter Basic Auth: protects endpoints (evidence: `cmd/solace-prometheus-exporter/main.go`)
- Broker and scrape config → Target dispatcher: configures targets
- Target dispatcher → System and hardware: dispatches targets (evidence: `internal/exporter/exporter.collect.go`)
- Target dispatcher → VPN and replication: dispatches targets (evidence: `internal/exporter/exporter.collect.go`)
- Target dispatcher → Queue and spool: dispatches targets (evidence: `internal/exporter/exporter.collect.go`)
- Target dispatcher → Client and bridge: dispatches targets (evidence: `internal/exporter/exporter.collect.go`)
- System and hardware → SEMP HTTP transport: sends SEMP
- VPN and replication → SEMP HTTP transport: sends SEMP
- Queue and spool → SEMP HTTP transport: sends SEMP
- Client and bridge → SEMP HTTP transport: sends SEMP
- SEMP HTTP transport → Solace broker: queries
- Broker authentication → SEMP HTTP transport: authenticates requests
- Target dispatcher → Prometheus metrics: collects metrics (evidence: `internal/exporter/exporter.collect.go`)
- Metric descriptions → Prometheus metrics: describes metrics
- Async prefetch → Target dispatcher: prefetches metrics
- TLS listener → Scrape endpoints: secures listener
