Merged in feature/docinitialisation (pull request #41)
Queuing Changes and Cfg Testing * staarting * staarting * startedpush * note * save * mocking * removederrs * fixtests * cleanuperrs * newenvsetup * preppingtests * queue * mmovetocfgpassunittests * sortoutconfig * passinginteg * deps * fixtests
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package observability
|
||||
|
||||
type ConfigProvider interface {
|
||||
IsOtelEnabled() bool
|
||||
}
|
||||
|
||||
type ObsConfig struct {
|
||||
EnableOtel bool `env:"ENABLE_OTEL" envDefault:"false"`
|
||||
}
|
||||
|
||||
func (o *ObsConfig) IsOtelEnabled() bool {
|
||||
return o.EnableOtel
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package observability_test
|
||||
|
||||
import (
|
||||
"queryorchestration/internal/serviceconfig/observability"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestIsOtelEnabled(t *testing.T) {
|
||||
c := observability.ObsConfig{}
|
||||
assert.False(t, c.IsOtelEnabled())
|
||||
c.EnableOtel = true
|
||||
assert.True(t, c.IsOtelEnabled())
|
||||
}
|
||||
Reference in New Issue
Block a user