Skip to content

Commit

Permalink
Add gRPC support
Browse files Browse the repository at this point in the history
  • Loading branch information
lior-govrin committed Apr 3, 2024
1 parent b8146ca commit 744d96b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type (
Compression Compression
Timeout time.Duration
URLPath string
Query map[string][]string

// gRPC configurations
GRPCCredentials credentials.TransportCredentials
Expand Down Expand Up @@ -326,3 +327,10 @@ func WithTimeout(duration time.Duration) GenericOption {
return cfg
})
}

func WithQuery(query map[string][]string) GenericOption {
return newGenericOption(func(cfg Config) Config {
cfg.Traces.Query = query
return cfg
})
}
5 changes: 5 additions & 0 deletions exporters/otlp/otlptrace/otlptracegrpc/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,8 @@ func WithTimeout(duration time.Duration) Option {
func WithRetry(settings RetryConfig) Option {
return wrappedOption{otlpconfig.WithRetry(retry.Config(settings))}
}

// WithQuery will send the provided query values with each gRPC request.
func WithQuery(query map[string][]string) Option {
return wrappedOption{otlpconfig.WithQuery(query)}
}

0 comments on commit 744d96b

Please sign in to comment.