mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-09 21:08:11 +02:00
zero/healthchecks: add reporter
This commit is contained in:
parent
228242e43a
commit
111f794969
17 changed files with 414 additions and 200 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