# phil-ngugi/otel-for-jaeger architecture

> Architecture diagram of the GitHub repository phil-ngugi/otel-for-jaeger, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/phil-ngugi/otel-for-jaeger
- Repository: https://github.com/phil-ngugi/otel-for-jaeger

## Overview

This is an Express observability demo: requests exercise tracing, metrics, logging, and sample business flows, with telemetry collected by Jaeger, Prometheus, and Loki and explored in Grafana. The README also documents Promtail and Fluent Bit log collection. Source excerpts show the app loading the OpenTelemetry SDK and using the logger; the README supplies the collector and dashboard relationships. The listed configuration paths establish the observability stack, but not every runtime wiring detail.

Main entry points: [`index.js`](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/index.js) (Express endpoints), [`grafana/provisioning/dashboards/otel-demo.json`](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/grafana/provisioning/dashboards/otel-demo.json) (Grafana dashboards), [`tracing.js`](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/tracing.js) (OpenTelemetry SDK), [`logger.js`](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/logger.js) (Application log file)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Demo application"]
  node_express["Express endpoints<br/>[index.js]"]
  node_request_flows["Request scenarios<br/>[index.js]"]
  node_checkout["Checkout simulation<br/>[index.js]"]
  node_logger["Structured logger<br/>[logger.js]"]
end

subgraph group_telemetry["Telemetry runtime"]
  node_otel_sdk["OpenTelemetry SDK<br/>[tracing.js]"]
  node_trace_exporter["OTLP trace export<br/>[tracing.js]"]
  node_metrics_exporter["Prometheus exporter<br/>[tracing.js]"]
end

subgraph group_logs["Log pipeline"]
  node_log_files["Application log file<br/>[logger.js]"]
  node_promtail["Promtail collector"]
  node_fluentbit["Fluent Bit collector<br/>[fluent-bit.conf]"]
end

subgraph group_observability["Observability services"]
  node_loki[("Loki<br/>[loki-config.yml]")]
  node_jaeger["Jaeger"]
  node_prometheus[("Prometheus<br/>[prometheus.yml]")]
  node_grafana["Grafana dashboards<br/>[otel-demo.json]"]
end

node_user(("HTTP caller"))

node_user -->|"sends requests"| node_express
node_express -->|"routes requests"| node_request_flows
node_express -->|"handles checkout"| node_checkout
node_express -->|"loads first"| node_otel_sdk
node_express -->|"writes logs"| node_logger
node_logger -->|"writes entries"| node_log_files
node_otel_sdk -->|"exports traces"| node_trace_exporter
node_otel_sdk -->|"serves metrics"| node_metrics_exporter
node_trace_exporter -->|"sends OTLP"| node_jaeger
node_metrics_exporter -->|"scrapes metrics"| node_prometheus
node_log_files -->|"collects logs"| node_promtail
node_log_files -->|"collects logs"| node_fluentbit
node_promtail -->|"pushes logs"| node_loki
node_fluentbit -->|"pushes logs"| node_loki
node_grafana -->|"queries traces"| node_jaeger
node_grafana -->|"queries metrics"| node_prometheus
node_grafana -->|"queries logs"| node_loki

click node_express "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/index.js"
click node_request_flows "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/index.js"
click node_checkout "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/index.js"
click node_logger "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/logger.js"
click node_otel_sdk "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/tracing.js"
click node_trace_exporter "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/tracing.js"
click node_metrics_exporter "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/tracing.js"
click node_log_files "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/logger.js"
click node_promtail "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/promtail/promtail-config.yml"
click node_fluentbit "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/fluent-bit/fluent-bit.conf"
click node_loki "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/loki/loki-config.yml"
click node_prometheus "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/prometheus.yml"
click node_grafana "https://github.com/phil-ngugi/otel-for-jaeger/blob/main/grafana/provisioning/dashboards/otel-demo.json"

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_express,node_request_flows,node_checkout,node_logger toneBlue
class node_otel_sdk,node_trace_exporter,node_metrics_exporter toneAmber
class node_log_files,node_promtail,node_fluentbit toneMint
class node_loki,node_jaeger,node_prometheus,node_grafana toneRose
class node_user toneIndigo
```

## Components

### Demo application

- [Express endpoints](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/index.js): `index.js`
- [Request scenarios](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/index.js): `index.js`
- [Checkout simulation](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/index.js): `index.js`
- [Structured logger](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/logger.js): `logger.js`

### Telemetry runtime

- [OpenTelemetry SDK](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/tracing.js): `tracing.js`
- [OTLP trace export](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/tracing.js): `tracing.js`
- [Prometheus exporter](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/tracing.js): `tracing.js`

### Log pipeline

- [Application log file](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/logger.js): `logger.js`
- [Promtail collector](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/promtail/promtail-config.yml): `promtail/promtail-config.yml`
- [Fluent Bit collector](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/fluent-bit/fluent-bit.conf): `fluent-bit/fluent-bit.conf`

### Observability services

- [Loki](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/loki/loki-config.yml): `loki/loki-config.yml`
- **Jaeger**
- [Prometheus](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/prometheus.yml): `prometheus.yml`
- [Grafana dashboards](https://github.com/phil-ngugi/otel-for-jaeger/blob/main/grafana/provisioning/dashboards/otel-demo.json): `grafana/provisioning/dashboards/otel-demo.json`

### Other components

- **HTTP caller**

## Connections

- HTTP caller → Express endpoints: sends requests (evidence: `Readme.md`)
- Express endpoints → Request scenarios: routes requests (evidence: `index.js`)
- Express endpoints → Checkout simulation: handles checkout (evidence: `index.js`)
- Express endpoints → OpenTelemetry SDK: loads first (evidence: `index.js`)
- Express endpoints → Structured logger: writes logs (evidence: `index.js`)
- Structured logger → Application log file: writes entries (evidence: `logger.js`)
- OpenTelemetry SDK → OTLP trace export: exports traces (evidence: `tracing.js`)
- OpenTelemetry SDK → Prometheus exporter: serves metrics (evidence: `tracing.js`)
- OTLP trace export → Jaeger: sends OTLP (evidence: `Readme.md`)
- Prometheus exporter → Prometheus: scrapes metrics (evidence: `Readme.md`)
- Application log file → Promtail collector: collects logs (evidence: `Readme.md`)
- Application log file → Fluent Bit collector: collects logs (evidence: `Readme.md`)
- Promtail collector → Loki: pushes logs (evidence: `Readme.md`)
- Fluent Bit collector → Loki: pushes logs (evidence: `Readme.md`)
- Grafana dashboards → Jaeger: queries traces (evidence: `Readme.md`)
- Grafana dashboards → Prometheus: queries metrics (evidence: `Readme.md`)
- Grafana dashboards → Loki: queries logs (evidence: `Readme.md`)
