console/docker/configs/otel-collector/extension-hiveauth/config.go
Laurin Quast 4f70fc9555
feat: otel telemetry collection and dashboard (#6796)
Co-authored-by: Kamil Kisiela <kamil.kisiela@gmail.com>
Co-authored-by: Dotan Simha <dotansimha@gmail.com>
Co-authored-by: Denis Badurina <denis@denelop.com>
2025-10-10 14:06:02 +02:00

28 lines
673 B
Go

// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package hiveauthextension // import "github.com/graphql-hive/console/docker/configs/otel-collector/extension-hiveauth"
import (
"errors"
"time"
)
type Config struct {
// Endpoint is the address of the authentication server
Endpoint string `mapstructure:"endpoint"`
// Timeout is the timeout for the HTTP request to the auth service
Timeout time.Duration `mapstructure:"timeout"`
}
func (cfg *Config) Validate() error {
if cfg.Endpoint == "" {
return errors.New("missing endpoint")
}
if cfg.Timeout <= 0 {
return errors.New("timeout must be a positive value")
}
return nil
}