This directory contains examples that showcase the usage of Axiom Go. Each
example is a self-contained Go package that can be run with go run
:
go run ./{example}
Axiom Go and the adapters automatically pick up their configuration from the environment, if not otherwise specified. To learn more about configuration, check the documentation.
To quickstart, export the environment variables below.
Note
If you have the Axiom CLI installed and are logged in, you can easily export most of the required environment variables:
eval $(axiom config export -f)
AXIOM_TOKEN
: API or Personal token. Can be created underSettings > API Tokens
orProfile
. For security reasons it is advised to use an API token with minimal privileges only.AXIOM_ORG_ID
: Organization identifier of the organization to (when using a personal token).AXIOM_DATASET
: Dataset to use. Must exist prior to using it. You can use Axiom CLI to create a dataset:axiom dataset create
.
- ingestevent: How to ingest events into Axiom.
- ingestfile: How to ingest the contents of a file into Axiom and compress them on the fly.
- ingesthackernews: How to ingest the contents of Hacker News into Axiom.
- query: How to query a dataset using the Kusto-like Axiom Processing Language (APL).
- querylegacy: How to query a dataset using the legacy query datatypes.
- apex: How to ship logs to Axiom using the popular Apex logging package.
- logrus: How to ship logs to Axiom using the popular Logrus logging package.
- slog: How to ship logs to Axiom using the standard libraries Slog structured logging package.
- zap: How to ship logs to Axiom using the popular Zap logging package.
- otelinstrument: How to instrument the Axiom Go client using OpenTelemetry.
- oteltraces: How to ship traces to Axiom using the
OpenTelemetry Go SDK and the Axiom SDKs
otel
helper package.