1 Star 0 Fork 0

samson shu / otel_customized

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
config.go 646 Bytes
Copy Edit Raw Blame History
samson shu authored 2023-08-05 14:28 . init version
package tailtracer
import (
"fmt"
"time"
)
// Config represents the receiver config settings within the collector's config.yaml
type Config struct {
Interval string `mapstructure:"interval"`
NumberOfTraces int `mapstructure:"number_of_traces"`
}
// Validate checks if the receiver configuration is valid
func (cfg *Config) Validate() error {
interval, _ := time.ParseDuration(cfg.Interval)
if interval.Minutes() < 1 {
return fmt.Errorf("when defined, the interval has to be set to at least 1 minute (1m)")
}
if cfg.NumberOfTraces < 1 {
return fmt.Errorf("number_of_traces must be greater or equal to 1")
}
return nil
}
Go
1
https://gitee.com/samson-shu/otel_customized.git
git@gitee.com:samson-shu/otel_customized.git
samson-shu
otel_customized
otel_customized
collector/receiver/tailtracer/v0.0.3

Search