npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

loglens-a2a

v1.0.0

Published

A2A agent for log analysis — query, search, tail, stats, error summary, and pro insights (anomaly detection, trace correlation, log diff, alert rules, retention, export)

Readme

LogLens A2A

LogLens A2A Version License A2A Protocol

Agent-to-Agent log analysis — query, search, anomaly detection, trace correlation, and more.

Skills · Providers · Quick Start · Pro Features


Overview

LogLens A2A is a production-ready A2A protocol server for log analysis. Connect any A2A-compatible orchestrator to your Loki, Datadog, CloudWatch, or Logtail log backends and unlock intelligent log analysis through 13 specialized skills.

Architecture

graph TD
    Orchestrator["A2A Orchestrator"] -->|"JSON-RPC 2.0"| Server["LogLens A2A Server\n:3009"]

    Server --> Free["Free Skills (7)"]
    Server --> Pro["Pro Skills (6)\nRequires PRO_LICENSE"]

    Free --> QL["query-logs\nFilter by service/level/time/pattern"]
    Free --> ES["error-summary\nGrouped error patterns + severity"]
    Free --> LS["log-stats\nVolume by hour, level breakdown"]
    Free --> TL["tail-logs\nMost recent N entries per service"]
    Free --> SP["search-patterns\nText/regex search across logs"]
    Free --> LC["log-context\nSurrounding entries for a log ID"]
    Free --> SM["service-map\nAll services with health status"]

    Pro --> AD["anomaly-detection\nVolume spikes, new error types, silence"]
    Pro --> TC["trace-correlation\nReconstruct distributed traces"]
    Pro --> LD["log-diff\nCompare two time periods"]
    Pro --> AR["alert-rules\nSuggest alert rules from patterns"]
    Pro --> RR["retention-report\nStorage cost estimation"]
    Pro --> ER["export-report\nJSON or markdown analysis report"]

    Server --> Providers["Log Providers"]
    Providers --> Loki["Grafana Loki\nLOKI_URL + LOKI_TOKEN"]
    Providers --> Logtail["Logtail / Better Stack\nLOGTAIL_TOKEN"]
    Providers --> Datadog["Datadog\nDD_API_KEY + DD_APP_KEY"]
    Providers --> CloudWatch["AWS CloudWatch\nAWS_* credentials"]

    style Server fill:#22c55e,color:#fff
    style Free fill:#dcfce7
    style Pro fill:#bbf7d0

Providers

| Provider | Environment Variables | Notes | |----------|----------------------|-------| | loki (default) | LOKI_URL, LOKI_TOKEN (optional) | Grafana Loki / Grafana Cloud | | logtail | LOGTAIL_TOKEN | Better Stack / Logtail | | datadog | DD_API_KEY, DD_APP_KEY, DD_SITE (optional) | Default site: datadoghq.com | | cloudwatch | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION | CloudWatch Logs Insights |

Set LOGLENS_PROVIDER env var for the default provider, or pass provider in each skill call.

Quick Start

# Install
npm install -g loglens-a2a

# Configure (Loki example)
export LOKI_URL=http://loki:3100
export PORT=3009

# Start server
loglens-a2a
# → loglens-a2a listening on port 3009

Docker

FROM node:20-alpine
RUN npm install -g loglens-a2a
ENV LOKI_URL=http://loki:3100
ENV PORT=3009
EXPOSE 3009
CMD ["loglens-a2a"]

Skills

Free Skills

query-logs

Query logs with flexible filters.

{
  "method": "query-logs",
  "params": {
    "provider": "loki",
    "service": "payments",
    "level": "error",
    "from": "2024-01-15T00:00:00Z",
    "to": "2024-01-15T23:59:59Z",
    "pattern": "timeout",
    "limit": 100
  }
}

error-summary

Group and deduplicate errors by pattern.

{
  "method": "error-summary",
  "params": {
    "provider": "loki",
    "from": "2024-01-15T00:00:00Z",
    "limit": 100
  }
}

log-stats

Volume statistics, level breakdown, busiest services.

{
  "method": "log-stats",
  "params": { "provider": "loki", "from": "2024-01-15T00:00:00Z" }
}

tail-logs

Most recent entries for a service.

{
  "method": "tail-logs",
  "params": { "provider": "loki", "service": "api", "limit": 50 }
}

search-patterns

Full-text and regex search across all logs.

{
  "method": "search-patterns",
  "params": { "provider": "loki", "pattern": "NullPointerException" }
}

log-context

Surrounding entries for a specific log ID.

{
  "method": "log-context",
  "params": { "provider": "loki", "log_id": "loki-1705312800000000000", "lines": 5 }
}

service-map

All services with health status and error rates.

{
  "method": "service-map",
  "params": { "provider": "loki" }
}

Pro Features

Set PRO_LICENSE environment variable to unlock pro skills.

export PRO_LICENSE=your-license-key

anomaly-detection

Detect volume spikes, error spikes, new error types, and service silence.

{
  "method": "anomaly-detection",
  "params": { "provider": "loki", "baseline_hours": 24 }
}

trace-correlation

Reconstruct distributed trace hops from a trace ID.

{
  "method": "trace-correlation",
  "params": { "provider": "loki", "trace_id": "abc123def456" }
}

log-diff

Compare log patterns between two time periods.

{
  "method": "log-diff",
  "params": {
    "provider": "loki",
    "period_a_from": "2024-01-14T00:00:00Z",
    "period_a_to": "2024-01-14T23:59:59Z",
    "period_b_from": "2024-01-15T00:00:00Z",
    "period_b_to": "2024-01-15T23:59:59Z"
  }
}

alert-rules

Suggest alert rules based on current log patterns.

{
  "method": "alert-rules",
  "params": { "provider": "loki" }
}

retention-report

Estimate storage costs and retention recommendations.

{
  "method": "retention-report",
  "params": { "provider": "loki", "default_retention_days": 30 }
}

export-report

Generate comprehensive analysis in JSON or Markdown.

{
  "method": "export-report",
  "params": { "provider": "loki", "format": "markdown", "include_top_errors": true }
}

API

| Endpoint | Description | |----------|-------------| | GET /health | Health check | | GET /.well-known/agent.json | Agent card with all 13 skills | | POST /tasks | Execute a skill (JSON-RPC 2.0) | | GET /tasks/:id | Get task status | | GET /tasks/:id/stream | SSE stream for task progress | | POST /tasks/:id/cancel | Cancel a running task |

Configuration

| Variable | Default | Description | |----------|---------|-------------| | PORT | 3009 | Server port | | LOGLENS_PROVIDER | loki | Default log provider | | PRO_LICENSE | — | Unlock pro skills | | LOKI_URL | — | Loki base URL | | LOKI_TOKEN | — | Loki auth token (Grafana Cloud) | | LOGTAIL_TOKEN | — | Logtail / Better Stack token | | DD_API_KEY | — | Datadog API key | | DD_APP_KEY | — | Datadog application key | | DD_SITE | datadoghq.com | Datadog site | | AWS_ACCESS_KEY_ID | — | AWS access key | | AWS_SECRET_ACCESS_KEY | — | AWS secret key | | AWS_REGION | — | AWS region |

License

MIT © Craftpipe