Axiom - Analytique des Logs Serverless

VérifiéSûr

Guide expert pour Axiom, la plateforme serverless de gestion de logs et d'analytique qui stocke et interroge des données illimitées à coût fixe.

Spar Skills Guide Bot
DevOpsIntermédiaire
25/07/2026
Claude CodeCursorWindsurf
#logging#log-analytics#apl#observability#serverless

Recommandé pour

Synthèse automatique

Fournit des conseils pratiques pour Axiom, la plateforme serverless de gestion et d'analyse de logs : ingestion d'événements, requêtes APL, dashboards et alertes.

Points forts

  • Exemples d'ingestion directement exploitables avec le SDK @axiomhq/js et le transport Pino
  • Recueil de requêtes APL concrètes (taux d'erreur, P95 de latence, top erreurs, revenus par région, utilisateurs actifs)
  • Montage spécifique à Vercel/Next.js avec instrumentation.ts et next-axiom

Limites

  • Le fichier est tronqué : l'exemple de route API Next.js s'arrête au milieu
  • Les dashboards et alertes sont annoncés dans la description mais aucun exemple ne les couvre
  • L'ingestion n'est illustrée qu'en TypeScript/JavaScript, sans équivalent pour d'autres langages ou sources
Quand l'utiliser

À utiliser lorsqu'on ajoute du logging Axiom dans une application Node/Next.js ou qu'on rédige des requêtes APL pour analyser des logs.

Quand l'éviter

À éviter si l'on cherche une autre stack d'observabilité ou des instructions d'ingestion pour des sources non JavaScript.

Analyse de sécurité

Sûr
Score qualité72/100

The skill is pure documentation: it shows TypeScript/APL/bash snippets for ingesting logs and querying Axiom, all using standard official SDKs (@axiomhq/js, pino, next-axiom, axiom CLI). No destructive commands, no credential exfiltration, no obfuscated payloads, and no instruction to disable safety controls. Tokens are read from process.env as expected practice. The only executable content is routine package-manager installs (brew/npm/pip), which carry no meaningful risk.

Aucun point d'attention détecté

Comment cette analyse est faite

Exemples

Next.js API route logging
Add Axiom logging to my Next.js API routes with next-axiom, and make sure failed payment events are logged as structured errors with the orderId and stripe_code.
P95 latency APL query
Write an APL query against my api-logs dataset that returns P95 and average duration_ms per endpoint over the last 6 hours, sorted by P95 descending.
Pino to Axiom transport
Configure Pino to ship structured logs to the Axiom dataset api-logs using the AXIOM_TOKEN environment variable, and show how to flush before process exit.

name: axiom description: Expert guidance for Axiom, the serverless log management and analytics platform that stores and queries unlimited data at fixed cost. Helps developers ingest logs, traces, and events from any source, query them with APL (Axiom Processing Language), build dashboards, and set up alerts — all without managing infrastructure or worrying about per-GB pricing. license: Apache-2.0 compatibility: No special requirements metadata: author: terminal-skills version: 1.0.0 category: devops tags:

  • logging
  • analytics
  • serverless
  • observability
  • s3

Axiom — Serverless Log Analytics

Overview

Axiom, the serverless log management and analytics platform that stores and queries unlimited data at fixed cost. Helps developers ingest logs, traces, and events from any source, query them with APL (Axiom Processing Language), build dashboards, and set up alerts — all without managing infrastructure or worrying about per-GB pricing.

Instructions

Ingestion

// Send logs via HTTP API
import Axiom from "@axiomhq/js";

const axiom = new Axiom({ token: process.env.AXIOM_TOKEN! });

// Ingest events (batched automatically)
await axiom.ingest("api-logs", [
  {
    level: "info",
    message: "Order processed",
    orderId: "ord_abc123",
    userId: "usr_456",
    amount: 99.99,
    duration_ms: 245,
    region: "us-east-1",
    _time: new Date().toISOString(),       // Optional: Axiom auto-sets if missing
  },
  {
    level: "error",
    message: "Payment failed",
    orderId: "ord_def789",
    error: "Card declined",
    stripe_code: "card_declined",
    duration_ms: 1200,
  },
]);

// Flush before process exit
await axiom.flush();
// Structured logging with Pino → Axiom transport
import pino from "pino";

const logger = pino({
  transport: {
    target: "@axiomhq/pino",
    options: {
      dataset: "api-logs",
      token: process.env.AXIOM_TOKEN,
    },
  },
});

logger.info({ orderId: "ord_123", userId: "usr_456", amount: 99.99 }, "Order created");
logger.error({ orderId: "ord_123", error: "timeout" }, "Payment processing timeout");

APL Queries (Axiom Processing Language)

// APL is based on Kusto Query Language (KQL) — same as Azure Data Explorer

// Error rate over time (5-minute buckets)
['api-logs']
| where level == "error"
| summarize errors = count() by bin(_time, 5m)
| order by _time asc

// P95 latency per endpoint
['api-logs']
| where isnotnull(duration_ms)
| summarize p95 = percentile(duration_ms, 95), avg_ms = avg(duration_ms), count = count()
    by endpoint
| order by p95 desc

// Top errors in the last hour
['api-logs']
| where _time > ago(1h) and level == "error"
| summarize count = count() by message, error
| order by count desc
| take 10

// Revenue by region (last 24h)
['api-logs']
| where _time > ago(24h) and message == "Order processed"
| summarize total_revenue = sum(amount), orders = count() by region
| order by total_revenue desc

// Slow requests (> 1s) with user context
['api-logs']
| where duration_ms > 1000
| project _time, endpoint, duration_ms, userId, orderId
| order by duration_ms desc
| take 20

// Unique active users per hour
['api-logs']
| where isnotnull(userId)
| summarize active_users = dcount(userId) by bin(_time, 1h)

Vercel / Next.js Integration

// next.config.js — Send Vercel logs to Axiom automatically
/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    instrumentationHook: true,
  },
};

module.exports = nextConfig;

// instrumentation.ts — Axiom + Vercel integration
export async function register() {
  if (process.env.NEXT_RUNTIME === "nodejs") {
    const { AxiomWebVitals } = await import("@axiomhq/web-vitals");
    // Auto-captures Web Vitals, server-side logs, and API route traces
  }
}
// app/api/route.ts — Structured logging in API routes
import { withAxiom, AxiomRequest } from "next-axiom";

export const POST = withAxiom(async (req: AxiomRequest) => {
  req.log.info("Processing webhook", { source: "stripe" });

  try {
    const body = await req.json();
    await processWebhook(body);
    req.log.info("Webhook processed", { eventType: body.type });
    return Response.json({ ok: true });
  } catch (error) {
    req.log.error("Webhook failed", { error: error.message });
    return Response.json({ error: "Failed" }, { status: 500 });
  }
});

CLI Queries

# Install CLI
brew install axiomhq/tap/axiom

# Authenticate
axiom auth login

# Query from terminal
axiom query "['api-logs'] | where level == 'error' | take 10" -f json

# Stream logs in real-time (like tail -f)
axiom stream api-logs

# Ingest from file
cat access.log | axiom ingest nginx-logs

# Ingest from pipe
docker logs my-container 2>&1 | axiom ingest docker-logs

Monitors and Alerts

# Axiom Monitors — alert on query results
# Configure in UI or via Terraform provider

# Example: Error spike alert
# Query: ['api-logs'] | where level == 'error' | summarize count() by bin(_time, 5m)
# Condition: count > 100 in any 5-minute window
# Notify: Slack #alerts channel

# Example: Zero orders alert (business metric)
# Query: ['api-logs'] | where message == 'Order processed' | summarize count() by bin(_time, 15m)
# Condition: count == 0 for 15 minutes
# Notify: PagerDuty

Installation

# CLI
brew install axiomhq/tap/axiom

# Node.js SDK
npm install @axiomhq/js

# Pino transport
npm install @axiomhq/pino

# Next.js integration
npm install next-axiom

# Python
pip install axiom-py

Examples

Example 1: Setting up Axiom for a microservices project

User request:

I have a Node.js API and a React frontend running in Docker. Set up Axiom for monitoring/deployment.

The agent creates the necessary configuration files based on patterns like # Install CLI, sets up the integration with the existing Docker setup, configures appropriate defaults for a Node.js + React stack, and provides verification commands to confirm everything is working.

Example 2: Troubleshooting apl queries issues

User request:

Axiom is showing errors in our apl queries. Here are the logs: [error output]

The agent analyzes the error output, identifies the root cause by cross-referencing with common Axiom issues, applies the fix (updating configuration, adjusting resource limits, or correcting syntax), and verifies the resolution with appropriate health checks.

Guidelines

  1. Datasets as logical groups — Create separate datasets for different log types (api-logs, frontend-events, infra-metrics); each has its own retention and access controls
  2. Structured over unstructured — Send JSON objects, not plain text; structured fields enable filtering, aggregation, and dashboards
  3. APL for power queries — Learn APL basics (where, summarize, project, join); it's far more powerful than regex-based log search
  4. Vercel integration — If on Vercel, use next-axiom for zero-config logging; Web Vitals, API traces, and server logs flow automatically
  5. Stream for debugging — Use axiom stream in terminal for real-time log tailing; faster than switching to a browser
  6. Fixed pricing model — Axiom charges per time (not per GB); ingest as much as you want without worrying about cost spikes
  7. Annotations for deploys — Mark deployments as annotations in Axiom; correlate performance changes with releases
  8. Monitors on business metrics — Don't just monitor errors; monitor business KPIs (orders, signups, revenue) and alert when they drop

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/axiom-serverless-log-analytics-mrzxuqmi/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/axiom-serverless-log-analytics-mrzxuqmi/download' --output '.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi/SKILL.md.part' && mv '.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi/SKILL.md.part' '.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Environnement déclaré par l’auteur : No special requirements

Extrait original : Installation
# CLI
brew install axiomhq/tap/axiom

# Node.js SDK
npm install @axiomhq/js

# Pino transport
npm install @axiomhq/pino

# Next.js integration
npm install next-axiom

# Python
pip install axiom-py

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi/SKILL.md' && test -s '.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/axiom' && cp -R '.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi' '.claude/skills/axiom'

Cursor
test -f '.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi/SKILL.md' && test -s '.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/axiom' && cp -R '.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi' '.cursor/skills/axiom'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/axiom-serverless-log-analytics-mrzxuqmi'

openskills read 'axiom-serverless-log-analytics-mrzxuqmi'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/axiom-serverless-log-analytics-mrzxuqmi/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires