Files
tracer-cloud--opensre/docs/victoria_logs.mdx
T
wehub-resource-sync 4b6817381b
CI (OpenClaw E2E) / openclaw test (push) Has been cancelled
CI / coverage-report (push) Has been cancelled
CI / test-kubernetes (push) Has been cancelled
CI / should-run-thorough (push) Has been cancelled
CI / test-thorough (cloudwatch-demo) (push) Has been cancelled
CI / test-thorough (flink-ecs) (push) Has been cancelled
CI / test-thorough (upstream-lambda) (push) Has been cancelled
CI / test-thorough (prefect-ecs-fargate) (push) Has been cancelled
Release / build-binaries (zip, opensre.exe, onefile, windows-latest, windows-x64) (push) Has been cancelled
Benchmark image — build + push to ECR (any adapter) / build + push (push) Has been cancelled
CI / quality (ubuntu-latest) (push) Has been cancelled
CI / test (tools-runtime) (push) Has been cancelled
CI / test (e2e-general) (push) Has been cancelled
CI / test (cli-runtime) (push) Has been cancelled
CI / test (e2e-provider-and-openclaw) (push) Has been cancelled
CI / test (integrations-and-misc) (push) Has been cancelled
Release / verify (push) Has been cancelled
Release / build-python-dist (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, macos-15-intel, darwin-x64) (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, macos-latest, darwin-arm64) (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04, linux-x64) (push) Has been cancelled
Release / publish-release (push) Has been cancelled
Release / publish-main-release (push) Has been cancelled
Interactive Shell Live (PR + post-merge) / turn-checks (no-LLM) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Interactive Shell Live (PR + post-merge) / turn-live shard ${{ matrix.shard_index }} (push) Has been cancelled
Release / prepare (push) Has been cancelled
Release / build-binaries (tar.gz, opensre, onedir, ubuntu-22.04-arm, linux-arm64) (push) Has been cancelled
Synthetic Deterministic Tests / Synthetic offline (deterministic) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:10:45 +08:00

83 lines
2.7 KiB
Plaintext

---
title: "VictoriaLogs"
description: "Connect VictoriaLogs so OpenSRE can pull structured log evidence during investigations"
---
OpenSRE queries [VictoriaLogs](https://docs.victoriametrics.com/victorialogs/) using LogsQL to retrieve structured log evidence — correlating recent application errors, request anomalies, and stream-level events with the alert under investigation.
## Prerequisites
- A reachable VictoriaLogs instance (e.g. `http://vmlogs:9428`)
- LogsQL knowledge for any custom queries you want OpenSRE to run
## Setup
### Option 1: Environment variables
Add to your `.env`:
```bash
VICTORIA_LOGS_URL=http://vmlogs.monitoring.svc:9428
# Optional — only set this if your deployment is multi-tenant.
# Single-tenant clusters should leave it unset; OpenSRE will not send
# the AccountID header at all.
# VICTORIA_LOGS_TENANT_ID=acme
```
| Variable | Default | Description |
| --- | --- | --- |
| `VICTORIA_LOGS_URL` | — | **Required.** Base URL of your VictoriaLogs instance |
| `VICTORIA_LOGS_TENANT_ID` | _(unset)_ | Optional. Sent as the `AccountID` header on multi-tenant deployments |
### Option 2: Persistent store
```json
{
"version": 1,
"integrations": [
{
"id": "victoria-logs-prod",
"service": "victoria_logs",
"status": "active",
"credentials": {
"base_url": "http://vmlogs.monitoring.svc:9428"
}
}
]
}
```
## Verify
```bash
opensre integrations verify victoria_logs
```
Expected output:
```
Service: victoria_logs
Status: passed
Detail: Connected to VictoriaLogs at http://vmlogs.monitoring.svc:9428.
```
## How it works in investigations
When VictoriaLogs is configured, the `victoria_logs_query` tool becomes available to the investigation agent. It runs LogsQL queries against `/select/logsql/query` and returns structured rows — defaulting to a wildcard match over the past hour, but the agent narrows the query based on alert context (service, level, trace ID, time window).
Typical agent uses:
- Pull recent error-level logs for the affected service to surface stack traces
- Filter by request ID or trace ID to follow a single failing transaction across services
- Compare log volume in the incident window against a known-good baseline to spot regressions
## Troubleshooting
| Symptom | Fix |
| --- | --- |
| **Status: missing** | Set `VICTORIA_LOGS_URL` or add a `victoria_logs` entry to your integrations store |
| **Connection refused** | Verify the URL is reachable from this host; check firewall rules |
| **404 on `/select/logsql/query`** | Confirm you are pointing at VictoriaLogs (not VictoriaMetrics for time-series); they expose different endpoints |
| **Empty rows** | Normal when no logs match — widen the time range with a longer `start` (e.g. `-24h`) or relax the LogsQL filter |