refactor: renamed telemetry error to use standard Err prefix

Signed-off-by: William Artero <git@artero.dev>
This commit is contained in:
William Artero 2023-12-04 18:04:26 +01:00
parent 236666ef71
commit 9ca1161c9b
Signed by: wwmoraes
GPG key ID: 4180618C988F24A3
2 changed files with 3 additions and 3 deletions

View file

@ -23,7 +23,7 @@ func main() {
shutdown, err := telemetry.InstrumentAll(ctx, os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT"))
log := telemetry.DefaultLogger()
if errors.Is(err, telemetry.NoEndpointError) {
if errors.Is(err, telemetry.ErrNoEndpoint) {
log.Error(err, "skipping instrumentation")
err = nil
} else {

View file

@ -25,7 +25,7 @@ import (
)
var (
NoEndpointError = errors.New("OTLP endpoint not provided")
ErrNoEndpoint = errors.New("OTLP endpoint not provided")
otlpConnHandler sync.Once
otlpConn *grpc.ClientConn
@ -191,7 +191,7 @@ func InstrumentLogging(ctx context.Context, otlpEndpoint string) error {
func InstrumentAll(ctx context.Context, otlpEndpoint string) (func(context.Context), error) {
if len(otlpEndpoint) <= 0 {
return nil, NoEndpointError
return nil, ErrNoEndpoint
}
tracingShutdown, err := InstrumentTracing(ctx, otlpEndpoint)