Skip to content

Commit

Permalink
make linters happy
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten committed Dec 9, 2024
1 parent c90b5a8 commit 389e0ee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/v0.2.0/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func logProcessor(ctx context.Context, processor LogRecordProcessor) (sdklog.Pro
}
return sdklog.NewSimpleProcessor(exp), nil
}
return nil, fmt.Errorf("unsupported log processor type, must be one of simple or batch")
return nil, errors.New("unsupported log processor type, must be one of simple or batch")
}

func logExporter(ctx context.Context, exporter LogRecordExporter) (sdklog.Exporter, error) {
Expand Down
4 changes: 2 additions & 2 deletions config/v0.2.0/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ func lowMemory(ik sdkmetric.InstrumentKind) metricdata.Temporality {
func prometheusReader(ctx context.Context, prometheusConfig *Prometheus) (sdkmetric.Reader, error) {
var opts []otelprom.Option
if prometheusConfig.Host == nil {
return nil, fmt.Errorf("host must be specified")
return nil, errors.New("host must be specified")
}
if prometheusConfig.Port == nil {
return nil, fmt.Errorf("port must be specified")
return nil, errors.New("port must be specified")
}
if prometheusConfig.WithoutScopeInfo != nil && *prometheusConfig.WithoutScopeInfo {
opts = append(opts, otelprom.WithoutScopeInfo())
Expand Down
5 changes: 3 additions & 2 deletions config/v0.2.0/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package config // import "go.opentelemetry.io/contrib/config/v0.2.0"

import (
"fmt"
"strconv"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
Expand All @@ -17,7 +18,7 @@ func keyVal(k string, v any) attribute.KeyValue {
case int64:
return attribute.Int64(k, val)
case uint64:
return attribute.String(k, fmt.Sprintf("%d", val))
return attribute.String(k, strconv.FormatUint(val, 10))
case float64:
return attribute.Float64(k, val)
case int8:
Expand All @@ -37,7 +38,7 @@ func keyVal(k string, v any) attribute.KeyValue {
case int:
return attribute.Int(k, val)
case uint:
return attribute.String(k, fmt.Sprintf("%d", val))
return attribute.String(k, strconv.FormatUint(uint64(val), 10))
case string:
return attribute.String(k, val)
default:
Expand Down
2 changes: 1 addition & 1 deletion config/v0.2.0/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func spanProcessor(ctx context.Context, processor SpanProcessor) (sdktrace.SpanP
}
return sdktrace.NewSimpleSpanProcessor(exp), nil
}
return nil, fmt.Errorf("unsupported span processor type, must be one of simple or batch")
return nil, errors.New("unsupported span processor type, must be one of simple or batch")
}

func otlpGRPCSpanExporter(ctx context.Context, otlpConfig *OTLP) (sdktrace.SpanExporter, error) {
Expand Down

0 comments on commit 389e0ee

Please sign in to comment.