Docs
DocumentationQuery ReferenceAPI Reference
Open Console→→
DocumentationQuery ReferenceAPI Reference

Platform overview

What is Axiom?QuickstartArchitectureFeatures
Fundamentals
Datasets
Edge deployments
Limits
Performance
Optimize usage
Requirements
Semantic conventions
Glossary
Tour
SecurityRoadmap

Send data

Reference architecturesMethods

Understand data

Console
Query
Builder
Editor
Query results
Visualize
Traces
Metrics
Correlations
Save queries
Stream
Dashboard
Create
Elements
Create
Configure
Element types
Gauge
Heatmap
Log stream
Monitor list
Note
Pie chart
Scatter plot
Statistic
Table
Time series
Sections
Configure
Filter
Annotate
Monitor
Overview
View status
Configure
Examples
Monitor types
Anomaly
Match
Threshold
Alerting
Overview
Configure
Notifier types
Custom Webhook
Discord
Email
Microsoft Teams
Opsgenie
PagerDuty
Slack
Manage
Datasets
Overview
Views
Virtual fields
Access
RBAC
Tokens
CLI
Organization
Audit log
Settings
Usage and billing
Profile
Extend
Overview
AWS Lambda
AWS PrivateLink
Cloudflare Workers
Cloudflare Logpush
Convex
Grafana
Hex
Netlify
Supabase
Tailscale
Terraform
Vercel
Intelligence
Overview
Spotlight
AI agents
Overview
MCP Server
Query cost limits
Agent-created orgs
Skills
Overview
Axiom alerting
Build dashboards
Control costs
Query metrics
SRE
Translate SPL to APL
Splunk
Overview
Splunk app
Install and configure
Commands
Examples
Splunk Portal
How it works
Set up standard mode
Set up transparent mode
SPL command support
Examples
Monitor and troubleshoot

Use cases

ObservabilityProduct analytics
LLM observability
Overview
Use Axiom AI SDK
Manual instrumentation
GenAI attributes
Redaction policies

Miscellaneous

LLMs
Overview
List of docs pages
Full docs
Query reference
FAQs
Legal
Acceptable use policy
Cookies
Data processing
HIPAA
Privacy policy
SLA
Terms of service
Terms of use

Axiom adapter for Zap

This page explains how to send logs generated by the uber-go/zap library to Axiom.

Use the adapter of the Axiom Go SDK to send logs generated by the uber-go/zap library to Axiom.

Info

The Axiom Go SDK is an open-source project and welcomes your contributions. For more information, see the GitHub repository.

Prerequisites

  • Create an Axiom account.
  • Create a dataset in Axiom where you send your data.
  • Create an API token in Axiom with permissions to ingest data to the dataset you have created.

Set up SDK

  1. Install the Axiom Go SDK and configure your environment as explained in Send data from Go app to Axiom.

  2. In your Go app, import the zap package. It’s imported as an adapter so that it doesn’t conflict with the uber-go/zap package.

    import adapter "github.com/axiomhq/axiom-go/adapters/zap"

Alternatively, configure the adapter using options passed to the New function:

core, err := adapter.New(
    adapter.SetDataset("DATASET_NAME"),
)

Replace DATASET_NAME with the name of the Axiom dataset where you send your data.

Configure client

To configure the underlying client manually, choose one of the following:

  • Use SetClient to pass in the client you have previously created with Send data from Go app to Axiom.
  • Use SetClientOptions to pass client options to the adapter.
import (
    "github.com/axiomhq/axiom-go/axiom"
    adapter "github.com/axiomhq/axiom-go/adapters/zap"
)

// ...

core, err := adapter.New(
    adapter.SetClientOptions(
        axiom.SetPersonalTokenConfig("AXIOM_TOKEN"),
    ),
)

Configure region

By default, the adapter sends data to api.axiom.co. To target a specific edge region, pass axiom.SetEdge through SetClientOptions with the edge domain that matches the region your dataset lives in:

core, err := adapter.New(
    adapter.SetClientOptions(
        axiom.SetAPITokenConfig("xaat-your-api-token"),
        axiom.SetEdge("eu-central-1.aws.edge.axiom.co"),
    ),
)
core, err := adapter.New(
    adapter.SetClientOptions(
        axiom.SetAPITokenConfig("xaat-your-api-token"),
        axiom.SetEdge("us-east-1.aws.edge.axiom.co"),
    ),
)

The following edge domains are available:

Edge deploymentBase domain for ingest and query
US East 1 (AWS)us-east-1.aws.edge.axiom.co
EU Central 1 (AWS)eu-central-1.aws.edge.axiom.co
Info

Edge endpoints require an API token (xaat-), not a personal token (xapt-). Use axiom.SetAPITokenConfig when targeting an edge region. You can also set AXIOM_EDGE or AXIOM_EDGE_URL in the environment instead of axiom.SetEdge. For a full edge URL such as a proxy, use axiom.SetEdgeURL, which takes precedence over axiom.SetEdge.

Info

The adapter uses a buffer to batch events before sending them to Axiom. Flush this buffer explicitly by calling Sync. For more information, see the zap documentation and the example in GitHub.

Reference

For a full reference of the adapter’s functions, see the Go Packages page.

Was this page helpful?
Suggest edits on GitHub
On this page
Set up SDKConfigure clientConfigure regionReference