The Axiom Python 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.
Install SDK
eval $(axiom config export -f) to configure your environment variables. Otherwise, create an API token and export it as AXIOM_TOKEN.
You can also configure the client using options passed to the client constructor:
Use client
Configure region
By default, the client sends data toapi.axiom.co. To target a specific edge region, pass the edge argument with the edge domain that matches the region your dataset lives in:
| Edge deployment | Base 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 |
edge_url="https://your-edge-host" instead. edge_url takes precedence over edge if both are set.
Edge endpoints require an API token (
xaat-), not a personal token (xapt-). Passing a personal token with edge configuration raises an error.Example with AxiomHandler
The example below uses AxiomHandler to send logs from the logging module to Axiom: