AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Observability Loki

skill-swapnildahiphale-opensre-observability-loki · by swapnildahiphale

Query and analyze logs from Grafana Loki using LogQL

No reviews yet
0 installs
33 views
0.0% view→install

Install

$ agentstack add skill-swapnildahiphale-opensre-observability-loki

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No 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.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-swapnildahiphale-opensre-observability-loki)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

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 →
Are you the author of Observability Loki? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Loki Log Analysis Skill

Query and analyze logs from Grafana Loki for incident investigation and debugging.

Investigation Workflow

  1. List available labels to understand what's queryable
  2. Get statistics to understand log volume and error rates
  3. Sample logs to see representative entries
  4. 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.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.