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 update the dataset you have created.
Set up SDK
- Install the Axiom Go SDK and configure your environment as explained in Send data from Go app to Axiom.
-
In your Go app, import the
logrus
package. It’s imported as anadapter
so that it doesn’t conflict with thesirupsen/logrus
package.
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.
The adapter uses a buffer to batch events before sending them to Axiom. Flush this buffer explicitly by calling Close. For more information, see the example in GitHub.