Skip to content

Commit 370ed81

Browse files
AchoArnoldCopilot
andcommitted
feat: use Axiom edge endpoint us-east-1.aws.edge.axiom.co
Use regional edge endpoint for improved data locality on both OTLP exporters (traces/metrics) and the zerolog log adapter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 178f273 commit 370ed81

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

api/pkg/di/container.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import (
5151
semconv "go.opentelemetry.io/otel/semconv/v1.10.0"
5252

5353
axiomzerolog "github.com/axiomhq/axiom-go/adapters/zerolog"
54+
"github.com/axiomhq/axiom-go/axiom"
5455
"github.com/hirosassa/zerodriver"
5556
"github.com/rs/zerolog"
5657
"go.opentelemetry.io/otel/sdk/trace"
@@ -1853,7 +1854,7 @@ func (container *Container) initializeAxiomTraceProvider(version string, namespa
18531854
}
18541855

18551856
traceExporter, err := otlptracehttp.New(context.Background(),
1856-
otlptracehttp.WithEndpoint("api.axiom.co"),
1857+
otlptracehttp.WithEndpoint("us-east-1.aws.edge.axiom.co"),
18571858
otlptracehttp.WithHeaders(headers),
18581859
)
18591860
if err != nil {
@@ -1873,7 +1874,7 @@ func (container *Container) initializeAxiomTraceProvider(version string, namespa
18731874
))
18741875

18751876
metricExporter, err := otlpmetrichttp.New(context.Background(),
1876-
otlpmetrichttp.WithEndpoint("api.axiom.co"),
1877+
otlpmetrichttp.WithEndpoint("us-east-1.aws.edge.axiom.co"),
18771878
otlpmetrichttp.WithHeaders(headers),
18781879
)
18791880
if err != nil {
@@ -1970,6 +1971,7 @@ func axiomLogger(skipFrameCount int) *zerodriver.Logger {
19701971

19711972
axiomWriter, err := axiomzerolog.New(
19721973
axiomzerolog.SetDataset(os.Getenv("AXIOM_DATASET")),
1974+
axiomzerolog.SetClientOptions(axiom.SetEdge("us-east-1.aws.edge.axiom.co")),
19731975
)
19741976
if err != nil {
19751977
// Fall back to stderr JSON if Axiom is not configured

0 commit comments

Comments
 (0)