Fluxheim/文件/可觀測性

可觀測性

使用 Prometheus 同 OpenTelemetry 查看總體流量、錯誤、下載同頁面使用情況,而唔追蹤個別訪客。

Prometheus 指標

[metrics]
enabled = true
listen = "127.0.0.1:9100"

OTLP 匯出

FLUXHEIM_OTLP=enabled
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_METRIC_EXPORT_INTERVAL=5000

The 可觀測性 compose stack sets these for the website service. Set FLUXHEIM_OTLP=disabled to run the same binary without exporting 指標 or traces.

版本 1.6.37 會喺 host-network ports 同其他 runner processes 爭用時,用新分配嘅 ports 重試一次性 Prometheus 同 Jaeger startup,令本機 observability smoke 更可靠。

labels 要保持 low-cardinality:route group、language、status class、download artifact 同 GitHub target 都有用。唔包含 raw IP address 或 user identifier。

儀表板做什麼

訊號為什麼這很重要
按 route 統計 requestShows which 公開 pages and docs are being used.
按 locale 統計 request顯示哪些語言最需要關注。
status class顯示錯誤而不追蹤單一使用者。
Download clicks顯示哪些發布工件是有用的。
GitHub 點擊量顯示哪些外部項目連結很重要。

私隱邊界

  • 用匯總 counter 同 histogram,唔好用原始 request log。
  • Do not label metrics with IP addresses, user agents, or full URLs.
  • 將 Prometheus 和 OTLP 偵聽器保持在環回或內部網路上。
  • 使追蹤行為在隱私和 cookie 頁面上可見。
粵語