feat(tracing): Start to implement tracing system
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
23
tracing/exporter/jaeger/config.go
Normal file
23
tracing/exporter/jaeger/config.go
Normal file
@ -0,0 +1,23 @@
|
||||
package jaeger
|
||||
|
||||
import (
|
||||
"github.com/asaskevich/govalidator"
|
||||
"github.com/juju/errors"
|
||||
)
|
||||
|
||||
// ConfigStruct is the configuration for Jaeger Provider.
|
||||
type ConfigStruct struct {
|
||||
URL string `yaml:"url"`
|
||||
}
|
||||
|
||||
// IsValid will check that the Jaeger configuration is valid.
|
||||
func (c *ConfigStruct) IsValid() error {
|
||||
|
||||
if c.URL == "" {
|
||||
return errors.NotValidf("URL is empty in Jaeger configuration")
|
||||
} else if isValid := govalidator.IsURL(c.URL); !isValid {
|
||||
return errors.NotValidf("URL is invalid in Jaeger configuration")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
23
tracing/exporter/zipkin/config.go
Normal file
23
tracing/exporter/zipkin/config.go
Normal file
@ -0,0 +1,23 @@
|
||||
package zipkin
|
||||
|
||||
import (
|
||||
"github.com/asaskevich/govalidator"
|
||||
"github.com/juju/errors"
|
||||
)
|
||||
|
||||
// ConfigStruct is the configuration for Zipkin Provider.
|
||||
type ConfigStruct struct {
|
||||
URL string `yaml:"url"`
|
||||
}
|
||||
|
||||
// IsValid will check that the Zipkin configuration is valid.
|
||||
func (c *ConfigStruct) IsValid() error {
|
||||
|
||||
if c.URL == "" {
|
||||
return errors.NotValidf("URL is empty in Zipkin configuration")
|
||||
} else if isValid := govalidator.IsURL(c.URL); !isValid {
|
||||
return errors.NotValidf("URL is invalid in Zipkin configuration")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user