mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-29 22:48:15 +02:00
zero/telemetry: add reporter (#4855)
This commit is contained in:
parent
3adbc65d37
commit
faa2a8652b
18 changed files with 425 additions and 203 deletions
|
@ -12,6 +12,7 @@ type Option func(*config)
|
|||
type config struct {
|
||||
clusterAPIEndpoint string
|
||||
connectAPIEndpoint string
|
||||
otelEndpoint string
|
||||
apiToken string
|
||||
httpClient *http.Client
|
||||
downloadURLCacheTTL time.Duration
|
||||
|
@ -31,6 +32,13 @@ func WithConnectAPIEndpoint(endpoint string) Option {
|
|||
}
|
||||
}
|
||||
|
||||
// WithOTELEndpoint sets the OTEL API endpoint
|
||||
func WithOTELEndpoint(endpoint string) Option {
|
||||
return func(cfg *config) {
|
||||
cfg.otelEndpoint = endpoint
|
||||
}
|
||||
}
|
||||
|
||||
// WithAPIToken sets the API token
|
||||
func WithAPIToken(token string) Option {
|
||||
return func(cfg *config) {
|
||||
|
@ -77,6 +85,9 @@ func (c *config) validate() error {
|
|||
if c.connectAPIEndpoint == "" {
|
||||
return fmt.Errorf("connect API endpoint is required")
|
||||
}
|
||||
if c.otelEndpoint == "" {
|
||||
return fmt.Errorf("OTEL API endpoint is required")
|
||||
}
|
||||
if c.apiToken == "" {
|
||||
return fmt.Errorf("API token is required")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue