Install
$ agentstack add skill-swapnildahiphale-opensre-observability-loki ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Loki Log Analysis Skill
Query and analyze logs from Grafana Loki for incident investigation and debugging.
Investigation Workflow
- List available labels to understand what's queryable
- Get statistics to understand log volume and error rates
- Sample logs to see representative entries
- Query specific patterns with LogQL
LogQL Quick Reference
Stream Selectors (required)
{app="frontend"} # Exact match
{namespace=~"prod-.*"} # Regex match
{container!="sidecar"} # Not equal
{pod=~".+"} # Any non-empty value
Line Filters
{app="api"} |= "error" # Contains "error"
{app="api"} != "debug" # Does not contain
{app="api"} |~ "error|warn" # Regex match
{app="api"} !~ "health|ready" # Regex not match
Parser & Label Extraction
{app="api"} | json # Parse JSON logs
{app="api"} | logfmt # Parse logfmt
{app="api"} | pattern ` - [] " "`
{app="api"} | json | level="error" # Filter on extracted labels
Aggregations (Metric Queries)
# Count logs per second
rate({app="api"}[5m])
# Count errors per minute
sum(rate({app="api"} |= "error" [1m])) by (pod)
# Bytes processed
bytes_rate({app="api"}[5m])
# Unique values
count_over_time({app="api"} | json | __error__="" [1h])
Available Scripts
list_labels.py
List available labels and their values.
python scripts/list_labels.py
python scripts/list_labels.py --label app
python scripts/list_labels.py --label namespace --json
get_statistics.py
Get log volume and error statistics.
python scripts/get_statistics.py --selector '{app="frontend"}'
python scripts/get_statistics.py --selector '{namespace="production"}' --lookback 2
python scripts/get_statistics.py --selector '{app=~"api.*"}' --json
sample_logs.py
Get sample log entries.
python scripts/sample_logs.py --selector '{app="frontend"}'
python scripts/sample_logs.py --selector '{app="api"}' --filter "error"
python scripts/sample_logs.py --selector '{namespace="prod"}' --limit 50 --json
query_logs.py
Execute raw LogQL queries.
python scripts/query_logs.py '{app="api"} |= "error" | json'
python scripts/query_logs.py 'rate({app="api"} |= "error" [5m])' --type metric
python scripts/query_logs.py '{app="api"}' --limit 100 --lookback 2 --json
Environment Variables
LOKI_BASE_URL: Proxy endpoint (production)LOKI_URL: Direct Loki URL (testing, e.g., http://loki:3100)
Common Investigation Patterns
Find errors in a service
python scripts/sample_logs.py --selector '{app="api"}' --filter "error|exception|fail"
Compare error rates across pods
python scripts/query_logs.py 'sum(rate({app="api"} |= "error" [5m])) by (pod)' --type metric
Find slow requests (if using JSON logs with duration)
python scripts/query_logs.py '{app="api"} | json | duration > 1000' --limit 20
Correlate logs around a timestamp
python scripts/query_logs.py '{app="api"}' --start "2024-01-15T10:30:00Z" --end "2024-01-15T10:35:00Z"
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: swapnildahiphale
- Source: swapnildahiphale/OpenSRE
- License: Apache-2.0
- Homepage: https://opensre.in
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.