logs

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package logs hosts the backend-agnostic pieces of the logs data source; the concrete clients live in the victorialogs and loki sub-packages.

Index

Constants

View Source
const (
	ProviderVictoriaLogs = "victorialogs"
	ProviderLoki         = "loki"
)

Provider identifiers returned by Detect. They deliberately equal the config.LogsProvider* string values (internal/config/config.go) — kept as plain strings here so the probe does not depend on the config package.

Variables

This section is empty.

Functions

func Detect

func Detect(ctx context.Context, baseURL, tokenEnv string, headers map[string]string) string

Detect probes the logs backend once at startup to distinguish Grafana Loki from VictoriaLogs, mirroring the metrics flavor probe (internal/metrics/prometheus/prometheus.go DetectFlavor): a config pin bypasses it (the caller checks logs.provider first), the probe is best-effort, and ANY failure — unreachable backend, non-200, non-buildinfo payload — FAILS SAFE to VictoriaLogs, the provider RunLore shipped with, so existing deployments see no behaviour change. Loki is identified by a 200 JSON response with a version on /loki/api/v1/status/buildinfo, an endpoint VictoriaLogs does not serve. The probe carries the same auth the real client will use (a Loki behind auth must still be detectable); the token is read from the environment here and never logged.

Types

This section is empty.

Directories

Path Synopsis
Package loki implements providers.LogsProvider against Grafana Loki, querying with LogQL over /loki/api/v1/* and normalizing the streams response into log lines.
Package loki implements providers.LogsProvider against Grafana Loki, querying with LogQL over /loki/api/v1/* and normalizing the streams response into log lines.
Package victorialogs implements providers.LogsProvider against VictoriaLogs, querying with LogsQL and normalizing the NDJSON response into log lines.
Package victorialogs implements providers.LogsProvider against VictoriaLogs, querying with LogsQL and normalizing the NDJSON response into log lines.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL