Skip to content

Commit

Permalink
Merge pull request #10 from cerberauth/analyticsx-otel-opts
Browse files Browse the repository at this point in the history
feat: add analyticsx otel opts
  • Loading branch information
emmanuelgautier authored Sep 29, 2024
2 parents 15f70a3 + 5f64951 commit 0a38dd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions analyticsx/analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ type AppInfo struct {
Version string
}

func NewAnalytics(ctx context.Context, app AppInfo) (*sdktrace.TracerProvider, error) {
return otelx.InitTracerProvider(ctx, app.Name, app.Version, otlptracehttp.WithEndpointURL("https://telemetry.cerberauth.com"))
func NewAnalytics(ctx context.Context, app AppInfo, opts ...otlptracehttp.Option) (*sdktrace.TracerProvider, error) {
return otelx.InitTracerProvider(ctx, app.Name, app.Version, opts...)
}
2 changes: 2 additions & 0 deletions otelx/otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func InitResource(serviceName string, version string) *sdkresource.Resource {
}

func InitTracerProvider(ctx context.Context, serviceName string, version string, opts ...otlptracehttp.Option) (*sdktrace.TracerProvider, error) {
opts = append(opts, otlptracehttp.WithEndpointURL("https://telemetry.cerberauth.com"))

exporter, err := otlptracehttp.New(ctx, opts...)
if err != nil {
return nil, err
Expand Down

0 comments on commit 0a38dd3

Please sign in to comment.