examples

package
v0.17.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2024 License: MIT Imports: 0 Imported by: 0

README

Examples

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}

Before you start

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)
Required environment variables
  • AXIOM_TOKEN: API or Personal token. Can be created under Settings > API Tokens or Profile. 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.

Package usage

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

Adapter usage

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

OpenTelemetry usage

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

Documentation

Overview

Package examples contains code examples on how to use Axiom Go.

Usage:

go run ./{example}

Directories

Path Synopsis
The purpose of this example is to show how to integrate with apex/log.
The purpose of this example is to show how to integrate with apex/log.
The purpose of this example is to show how to send events to Axiom.
The purpose of this example is to show how to send events to Axiom.
The purpose of this example is to show how to stream the contents of a JSON logfile and gzip them on the fly.
The purpose of this example is to show how to stream the contents of a JSON logfile and gzip them on the fly.
The purpose of this example is to show how to replicate the contents of Hacker News into Axiom.
The purpose of this example is to show how to replicate the contents of Hacker News into Axiom.
The purpose of this example is to show how to integrate with logrus.
The purpose of this example is to show how to integrate with logrus.
The purpose of this example is to show how to instrument the Axiom Go client using OpenTelemetry.
The purpose of this example is to show how to instrument the Axiom Go client using OpenTelemetry.
The purpose of this example is to show how to send OpenTelemetry traces to Axiom.
The purpose of this example is to show how to send OpenTelemetry traces to Axiom.
The purpose of this example is to show how to query a dataset using the Axiom Processing Language (APL).
The purpose of this example is to show how to query a dataset using the Axiom Processing Language (APL).
The purpose of this example is to show how to query a dataset using a legacy query.
The purpose of this example is to show how to query a dataset using a legacy query.
The purpose of this example is to show how to integrate with slog.
The purpose of this example is to show how to integrate with slog.
The purpose of this example is to show how to integrate with zap.
The purpose of this example is to show how to integrate with zap.
The purpose of this example is to show how to integrate with zerolog.
The purpose of this example is to show how to integrate with zerolog.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL