A complete TelemetryUI configuration is a list containing three main keys: metrics, theme, and backend.
Metrics
metrics is a list of tuples. Each tuple represents a page (metrics group) and follows the format:
{"Page Name", metrics_list, ui_options: [...]}.
Each metrics_list is composed of individual metric definitions (e.g., counter/2, average/2, distribution/2) imported from TelemetryUI.Metrics.
Theme
A map defining the visual appearance of the UI, including header_color, primary_color, title, share_key, and logo (SVG string).
Backend
A map or struct defining how data is stored and managed (e.g., %TelemetryUI.Backend.EctoPostgres{...}).
defmodule MyApp.TelemetryUI do
import TelemetryUI.Metrics
def config do
ui_options = [metrics_class: "grid-cols-8 gap-4"]
[
metrics: [
{"HTTP", http_metrics(), ui_options: ui_options},
{"System", system_metrics()}
],
theme: theme(),
backend: backend()
]
end
# ... helper functions for metrics, theme, and backend
end