feat(tracing): Start to implement tracing system
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Matthieu 'JP' DERASSE
2022-12-14 16:48:40 +00:00
parent 99bca634d2
commit 06f0722cdb
8 changed files with 354 additions and 5 deletions

View 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
}

View 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
}