diff --git a/host.go b/host.go index 44fbcfe..28b7e32 100644 --- a/host.go +++ b/host.go @@ -21,14 +21,13 @@ func (rs RedactedString) Reveal() string { type OtelConfig struct { EnableObservability bool `json:"enable_observability"` - EnableTraces *bool `json:"enable_traces,omitempty"` - EnableMetrics *bool `json:"enable_metrics,omitempty"` - EnableLogs *bool `json:"enable_logs,omitempty"` + EnableTraces bool `json:"enable_traces,omitempty"` + EnableMetrics bool `json:"enable_metrics,omitempty"` + EnableLogs bool `json:"enable_logs,omitempty"` ObservabilityEndpoint string `json:"observability_endpoint,omitempty"` TracesEndpoint string `json:"traces_endpoint,omitempty"` MetricsEndpoint string `json:"metrics_endpoint,omitempty"` LogsEndpoint string `json:"logs_endpoint,omitempty"` - TraceLevel *Level `json:"trace_level,omitempty"` Protocol string `json:"protocol,omitempty"` } diff --git a/provider.go b/provider.go index c504a6d..c2984de 100644 --- a/provider.go +++ b/provider.go @@ -125,7 +125,7 @@ func NewWithHostDataSource(source io.Reader, options ...ProviderHandler) (*Wasmc return nil, err } - if hostData.OtelConfig.EnableObservability || (hostData.OtelConfig.EnableMetrics != nil && *hostData.OtelConfig.EnableMetrics) { + if hostData.OtelConfig.EnableObservability || hostData.OtelConfig.EnableMetrics { meterProvider, err := newMeterProvider(context.Background(), hostData.OtelConfig, serviceResource) if err != nil { return nil, err @@ -134,7 +134,7 @@ func NewWithHostDataSource(source io.Reader, options ...ProviderHandler) (*Wasmc internalShutdownFuncs = append(internalShutdownFuncs, func(c context.Context) error { return meterProvider.Shutdown(c) }) } - if hostData.OtelConfig.EnableObservability || (hostData.OtelConfig.EnableTraces != nil && *hostData.OtelConfig.EnableTraces) { + if hostData.OtelConfig.EnableObservability || hostData.OtelConfig.EnableTraces { tracerProvider, err := newTracerProvider(context.Background(), hostData.OtelConfig, serviceResource) if err != nil { return nil, err @@ -143,7 +143,7 @@ func NewWithHostDataSource(source io.Reader, options ...ProviderHandler) (*Wasmc internalShutdownFuncs = append(internalShutdownFuncs, func(c context.Context) error { return tracerProvider.Shutdown(c) }) } - if hostData.OtelConfig.EnableObservability || (hostData.OtelConfig.EnableLogs != nil && *hostData.OtelConfig.EnableLogs) { + if hostData.OtelConfig.EnableObservability || hostData.OtelConfig.EnableLogs { loggerProvider, err := newLoggerProvider(context.Background(), hostData.OtelConfig, serviceResource) if err != nil { return nil, err