From 506a9baf5e00147118caea839b529e0f6539e93d Mon Sep 17 00:00:00 2001 From: Nathan Baulch Date: Mon, 9 Sep 2024 16:53:15 +1000 Subject: [PATCH] Fix typos (#5763) --- .github/ISSUE_TEMPLATE/version_release.md | 2 +- .golangci.yml | 4 ++-- CHANGELOG.md | 4 ++-- bridge/opencensus/internal/tracer.go | 2 +- bridge/opencensus/internal/tracer_test.go | 2 +- bridge/opentracing/bridge_test.go | 2 +- example/passthrough/handler/handler.go | 2 +- exporters/otlp/otlplog/otlploggrpc/config.go | 2 +- .../otlp/otlplog/otlploggrpc/config_test.go | 4 ++-- .../otlploggrpc/internal/transform/log.go | 2 +- .../otlp/otlplog/otlploghttp/client_test.go | 2 +- exporters/otlp/otlplog/otlploghttp/config.go | 2 +- .../otlp/otlplog/otlploghttp/config_test.go | 4 ++-- exporters/otlp/otlplog/otlploghttp/doc.go | 2 +- .../otlploghttp/internal/transform/log.go | 2 +- .../otlpmetricgrpc/internal/oconf/options.go | 2 +- .../otlpmetricgrpc/internal/oconf/tls.go | 2 +- .../otlp/otlpmetric/otlpmetrichttp/doc.go | 2 +- .../otlpmetrichttp/internal/oconf/options.go | 2 +- .../otlpmetrichttp/internal/oconf/tls.go | 2 +- .../internal/otlpconfig/options.go | 2 +- .../otlptrace/otlptracehttp/client_test.go | 2 +- exporters/otlp/otlptrace/otlptracehttp/doc.go | 2 +- .../internal/otlpconfig/options.go | 2 +- exporters/prometheus/exporter_test.go | 18 +++++++------- internal/global/meter_test.go | 6 ++--- .../shared/otlp/otlplog/transform/log.go.tmpl | 2 +- .../otlp/otlpmetric/oconf/options.go.tmpl | 2 +- .../shared/otlp/otlpmetric/oconf/tls.go.tmpl | 2 +- .../otlp/otlptrace/otlpconfig/options.go.tmpl | 2 +- log/DESIGN.md | 10 ++++---- metric/asyncfloat64.go | 2 +- metric/asyncint64.go | 2 +- sdk/log/DESIGN.md | 6 ++--- sdk/log/example_test.go | 6 ++--- sdk/log/simple.go | 2 +- sdk/metric/instrument.go | 8 +++---- .../internal/aggregate/histogram_test.go | 2 +- sdk/metric/internal/aggregate/sum.go | 4 ++-- sdk/metric/internal/exemplar/rand.go | 2 +- .../internal/exemplar/reservoir_test.go | 2 +- sdk/metric/meter.go | 20 ++++++++-------- sdk/metric/meter_test.go | 24 +++++++++---------- sdk/metric/periodic_reader_test.go | 2 +- sdk/resource/host_id_windows.go | 7 +++--- sdk/resource/os_release_unix_test.go | 2 +- sdk/resource/os_windows.go | 1 - sdk/resource/resource_test.go | 2 +- semconv/internal/v2/http_test.go | 2 +- semconv/internal/v3/http_test.go | 2 +- semconv/internal/v4/http_test.go | 2 +- trace/context.go | 2 +- trace/doc.go | 2 +- 53 files changed, 100 insertions(+), 102 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/version_release.md b/.github/ISSUE_TEMPLATE/version_release.md index c321e0eab5b..2e2ba66f66d 100644 --- a/.github/ISSUE_TEMPLATE/version_release.md +++ b/.github/ISSUE_TEMPLATE/version_release.md @@ -9,7 +9,7 @@ assignees: '' -- [ ] Complete [Milestone](https://github.com/open-telemetry/opentelemetry-go/milestone/) +- [ ] Complete [Milestone](https://github.com/open-telemetry/opentelemetry-go/milestone/) - [ ] [Update contrib codebase to support changes about to be released (use a git sha version)](https://github.com/open-telemetry/opentelemetry-go/blob/main/RELEASING.md#verify-changes-for-contrib-repository) - [ ] [Pre-release](https://github.com/open-telemetry/opentelemetry-go/blob/main/RELEASING.md#pre-release) diff --git a/.golangci.yml b/.golangci.yml index d9abe194d94..a5f904197fe 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -64,12 +64,12 @@ issues: - path: _test\.go linters: - gosec - # Igonoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand) + # Ignoring gosec G404: Use of weak random number generator (math/rand instead of crypto/rand) # as we commonly use it in tests and examples. - text: "G404:" linters: - gosec - # Igonoring gosec G402: TLS MinVersion too low + # Ignoring gosec G402: TLS MinVersion too low # as the https://pkg.go.dev/crypto/tls#Config handles MinVersion default well. - text: "G402: TLS MinVersion too low." linters: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a923abd899..016f9e3fb8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1911,7 +1911,7 @@ with major version 0. - Setting error status while recording error with Span from oteltest package. (#1729) - The concept of a remote and local Span stored in a context is unified to just the current Span. Because of this `"go.opentelemetry.io/otel/trace".RemoteSpanContextFromContext` is removed as it is no longer needed. - Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContex` can be used to return the current Span. + Instead, `"go.opentelemetry.io/otel/trace".SpanContextFromContext` can be used to return the current Span. If needed, that Span's `SpanContext.IsRemote()` can then be used to determine if it is remote or not. (#1731) - The `HasRemoteParent` field of the `"go.opentelemetry.io/otel/sdk/trace".SamplingParameters` is removed. This field is redundant to the information returned from the `Remote` method of the `SpanContext` held in the `ParentContext` field. (#1749) @@ -2485,7 +2485,7 @@ This release migrates the default OpenTelemetry SDK into its own Go module, deco - Prometheus exporter will not apply stale updates or forget inactive metrics. (#903) - Add test for api.standard `HTTPClientAttributesFromHTTPRequest`. (#905) - Bump github.com/golangci/golangci-lint from 1.27.0 to 1.28.1 in /tools. (#901, #913) -- Update otel-colector example to use the v0.5.0 collector. (#915) +- Update otel-collector example to use the v0.5.0 collector. (#915) - The `grpctrace` instrumentation uses a span name conforming to the OpenTelemetry semantic conventions (does not contain a leading slash (`/`)). (#922) - The `grpctrace` instrumentation includes an `rpc.method` attribute now set to the gRPC method name. (#900, #922) - The `grpctrace` instrumentation `rpc.service` attribute now contains the package name if one exists. diff --git a/bridge/opencensus/internal/tracer.go b/bridge/opencensus/internal/tracer.go index 2454f27091c..13164684525 100644 --- a/bridge/opencensus/internal/tracer.go +++ b/bridge/opencensus/internal/tracer.go @@ -37,7 +37,7 @@ func (o *Tracer) StartSpan(ctx context.Context, name string, s ...octrace.StartO // StartSpanWithRemoteParent starts a new child span of the span from the // given parent. func (o *Tracer) StartSpanWithRemoteParent(ctx context.Context, name string, parent octrace.SpanContext, s ...octrace.StartOption) (context.Context, *octrace.Span) { - // make sure span context is zero'd out so we use the remote parent + // make sure span context is zeroed out so we use the remote parent ctx = trace.ContextWithSpan(ctx, nil) ctx = trace.ContextWithRemoteSpanContext(ctx, oc2otel.SpanContext(parent)) return o.StartSpan(ctx, name, s...) diff --git a/bridge/opencensus/internal/tracer_test.go b/bridge/opencensus/internal/tracer_test.go index a32115fa501..d1516fd362f 100644 --- a/bridge/opencensus/internal/tracer_test.go +++ b/bridge/opencensus/internal/tracer_test.go @@ -108,7 +108,7 @@ func TestTracerFromContext(t *testing.T) { ctx, _ = tracer.Start(ctx, "test") got := internal.NewTracer(tracer).FromContext(ctx).SpanContext() - // Do not test the convedsion, only that the propagtion. + // Do not test the conversion, only the propagation. want := otel2oc.SpanContext(sc) if got != want { t.Errorf("tracer.FromContext returned wrong context: %#v", got) diff --git a/bridge/opentracing/bridge_test.go b/bridge/opentracing/bridge_test.go index 0eea0ab0f53..0c077e34726 100644 --- a/bridge/opentracing/bridge_test.go +++ b/bridge/opentracing/bridge_test.go @@ -396,7 +396,7 @@ func TestBridgeTracer_StartSpan(t *testing.T) { expectWarnings: []string(nil), }, { - name: "with a non-defered wrapper tracer", + name: "with a non-deferred wrapper tracer", before: func(t *testing.T, bridge *BridgeTracer) { wTracer := &nonDeferWrapperTracer{ NewWrapperTracer(bridge, otel.Tracer("test")), diff --git a/example/passthrough/handler/handler.go b/example/passthrough/handler/handler.go index c6cdbd03931..fe3b4aa4933 100644 --- a/example/passthrough/handler/handler.go +++ b/example/passthrough/handler/handler.go @@ -27,7 +27,7 @@ type Handler struct { // to next. func New(next func(r *http.Request)) *Handler { // Like most instrumentation packages, this handler defaults to using the - // global progatators and tracer providers. + // global propagators and tracer providers. return &Handler{ propagators: otel.GetTextMapPropagator(), tracer: otel.Tracer("go.opentelemetry.io/otel/example/passthrough/handler"), diff --git a/exporters/otlp/otlplog/otlploggrpc/config.go b/exporters/otlp/otlplog/otlploggrpc/config.go index 8b2c0f584b2..cd33a168271 100644 --- a/exporters/otlp/otlplog/otlploggrpc/config.go +++ b/exporters/otlp/otlplog/otlploggrpc/config.go @@ -472,7 +472,7 @@ func convDuration(s string) (time.Duration, error) { return time.Duration(d) * time.Millisecond, nil } -// loadEnvTLS returns a resolver that loads a *tls.Config from files defeind by +// loadEnvTLS returns a resolver that loads a *tls.Config from files defined by // the OTLP TLS environment variables. This will load both the rootCAs and // certificates used for mTLS. // diff --git a/exporters/otlp/otlplog/otlploggrpc/config_test.go b/exporters/otlp/otlplog/otlploggrpc/config_test.go index 40c74cb72b4..51d864b6282 100644 --- a/exporters/otlp/otlplog/otlploggrpc/config_test.go +++ b/exporters/otlp/otlplog/otlploggrpc/config_test.go @@ -191,7 +191,7 @@ func TestNewConfig(t *testing.T) { }, }, { - name: "LogEnpointEnvironmentVariablesDefaultPath", + name: "LogEndpointEnvironmentVariablesDefaultPath", envars: map[string]string{ "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT": "http://env.endpoint", }, @@ -224,7 +224,7 @@ func TestNewConfig(t *testing.T) { }, }, { - name: "OTLPEnpointEnvironmentVariablesDefaultPath", + name: "OTLPEndpointEnvironmentVariablesDefaultPath", envars: map[string]string{ "OTEL_EXPORTER_OTLP_ENDPOINT": "http://env.endpoint", }, diff --git a/exporters/otlp/otlplog/otlploggrpc/internal/transform/log.go b/exporters/otlp/otlplog/otlploggrpc/internal/transform/log.go index 9ce99e7fc49..89758f0d073 100644 --- a/exporters/otlp/otlplog/otlploggrpc/internal/transform/log.go +++ b/exporters/otlp/otlplog/otlploggrpc/internal/transform/log.go @@ -66,7 +66,7 @@ func resourceLogsMap(dst *map[attribute.Distinct]*lpb.ResourceLogs, records []lo } } -// ScopeLogs returns a slice of OTLP ScopeLogs generated from recoreds. +// ScopeLogs returns a slice of OTLP ScopeLogs generated from records. func ScopeLogs(records []log.Record) []*lpb.ScopeLogs { scopeMap := scopeLogsMapPool.Get().(map[instrumentation.Scope]*lpb.ScopeLogs) defer func() { diff --git a/exporters/otlp/otlplog/otlploghttp/client_test.go b/exporters/otlp/otlplog/otlploghttp/client_test.go index c1ded095ab1..0cd2a3b913b 100644 --- a/exporters/otlp/otlplog/otlploghttp/client_test.go +++ b/exporters/otlp/otlplog/otlploghttp/client_test.go @@ -224,7 +224,7 @@ type httpCollector struct { // default OTLP log endpoint path ("/v1/logs"). If the endpoint contains a // prefix of "https" the server will generate weak self-signed TLS certificates // and use them to server data. If the endpoint contains a path, that path will -// be used instead of the default OTLP metri endpoint path. +// be used instead of the default OTLP metric endpoint path. // // If errCh is not nil, the collector will respond to HTTP requests with errors // sent on that channel. This means that if errCh is not nil Export calls will diff --git a/exporters/otlp/otlplog/otlploghttp/config.go b/exporters/otlp/otlplog/otlploghttp/config.go index 88a8d5e1f10..f348672f466 100644 --- a/exporters/otlp/otlplog/otlploghttp/config.go +++ b/exporters/otlp/otlplog/otlploghttp/config.go @@ -377,7 +377,7 @@ func (s setting[T]) Resolve(fn ...resolver[T]) setting[T] { return s } -// loadEnvTLS returns a resolver that loads a *tls.Config from files defeind by +// loadEnvTLS returns a resolver that loads a *tls.Config from files defined by // the OTLP TLS environment variables. This will load both the rootCAs and // certificates used for mTLS. // diff --git a/exporters/otlp/otlplog/otlploghttp/config_test.go b/exporters/otlp/otlplog/otlploghttp/config_test.go index d3ef1cc1977..456499a5886 100644 --- a/exporters/otlp/otlplog/otlploghttp/config_test.go +++ b/exporters/otlp/otlplog/otlploghttp/config_test.go @@ -190,7 +190,7 @@ func TestNewConfig(t *testing.T) { }, }, { - name: "LogEnpointEnvironmentVariablesDefaultPath", + name: "LogEndpointEnvironmentVariablesDefaultPath", envars: map[string]string{ "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT": "http://env.endpoint", }, @@ -225,7 +225,7 @@ func TestNewConfig(t *testing.T) { }, }, { - name: "OTLPEnpointEnvironmentVariablesDefaultPath", + name: "OTLPEndpointEnvironmentVariablesDefaultPath", envars: map[string]string{ "OTEL_EXPORTER_OTLP_ENDPOINT": "http://env.endpoint", }, diff --git a/exporters/otlp/otlplog/otlploghttp/doc.go b/exporters/otlp/otlplog/otlploghttp/doc.go index 87e55efe091..2607e3b9b68 100644 --- a/exporters/otlp/otlplog/otlploghttp/doc.go +++ b/exporters/otlp/otlplog/otlploghttp/doc.go @@ -22,7 +22,7 @@ target URL to which the exporter sends telemetry. The value must contain a scheme ("http" or "https") and host. The value may additionally contain a port and a path. The value should not contain a query string or fragment. -The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WitnInsecure], and [WithURLPath] options. +The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WithInsecure], and [WithURLPath] options. OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_LOGS_HEADERS (default: none) - key-value pairs used as headers associated with HTTP requests. diff --git a/exporters/otlp/otlplog/otlploghttp/internal/transform/log.go b/exporters/otlp/otlplog/otlploghttp/internal/transform/log.go index 232172eb6b9..54c9c2b4d9e 100644 --- a/exporters/otlp/otlplog/otlploghttp/internal/transform/log.go +++ b/exporters/otlp/otlplog/otlploghttp/internal/transform/log.go @@ -66,7 +66,7 @@ func resourceLogsMap(dst *map[attribute.Distinct]*lpb.ResourceLogs, records []lo } } -// ScopeLogs returns a slice of OTLP ScopeLogs generated from recoreds. +// ScopeLogs returns a slice of OTLP ScopeLogs generated from records. func ScopeLogs(records []log.Record) []*lpb.ScopeLogs { scopeMap := scopeLogsMapPool.Get().(map[instrumentation.Scope]*lpb.ScopeLogs) defer func() { diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/options.go b/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/options.go index b6ed9a2bb65..f66c471212f 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/options.go +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/options.go @@ -139,7 +139,7 @@ func NewGRPCConfig(opts ...GRPCOption) Config { if cfg.ServiceConfig != "" { cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) } - // Priroritize GRPCCredentials over Insecure (passing both is an error). + // Prioritize GRPCCredentials over Insecure (passing both is an error). if cfg.Metrics.GRPCCredentials != nil { cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(cfg.Metrics.GRPCCredentials)) } else if cfg.Metrics.Insecure { diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/tls.go b/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/tls.go index 0229ac80bef..03e7fbcdfb5 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/tls.go +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/tls.go @@ -14,7 +14,7 @@ import ( ) // ReadTLSConfigFromFile reads a PEM certificate file and creates -// a tls.Config that will use this certifate to verify a server certificate. +// a tls.Config that will use this certificate to verify a server certificate. func ReadTLSConfigFromFile(path string) (*tls.Config, error) { b, err := os.ReadFile(path) if err != nil { diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/doc.go b/exporters/otlp/otlpmetric/otlpmetrichttp/doc.go index eabb82b9847..de9e71a6e35 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/doc.go +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/doc.go @@ -22,7 +22,7 @@ target URL to which the exporter sends telemetry. The value must contain a scheme ("http" or "https") and host. The value may additionally contain a port and a path. The value should not contain a query string or fragment. -The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WitnInsecure], and [WithURLPath] options. +The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WithInsecure], and [WithURLPath] options. OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_METRICS_HEADERS (default: none) - key-value pairs used as headers associated with HTTP requests. diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/options.go b/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/options.go index 9bbf0941f94..9a582cdbbaa 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/options.go +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/options.go @@ -139,7 +139,7 @@ func NewGRPCConfig(opts ...GRPCOption) Config { if cfg.ServiceConfig != "" { cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) } - // Priroritize GRPCCredentials over Insecure (passing both is an error). + // Prioritize GRPCCredentials over Insecure (passing both is an error). if cfg.Metrics.GRPCCredentials != nil { cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(cfg.Metrics.GRPCCredentials)) } else if cfg.Metrics.Insecure { diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/tls.go b/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/tls.go index ae09ad57e16..f603dc605eb 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/tls.go +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/tls.go @@ -14,7 +14,7 @@ import ( ) // ReadTLSConfigFromFile reads a PEM certificate file and creates -// a tls.Config that will use this certifate to verify a server certificate. +// a tls.Config that will use this certificate to verify a server certificate. func ReadTLSConfigFromFile(path string) (*tls.Config, error) { b, err := os.ReadFile(path) if err != nil { diff --git a/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go b/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go index 8f84a799632..8d4b4bf0898 100644 --- a/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go +++ b/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go @@ -125,7 +125,7 @@ func NewGRPCConfig(opts ...GRPCOption) Config { if cfg.ServiceConfig != "" { cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) } - // Priroritize GRPCCredentials over Insecure (passing both is an error). + // Prioritize GRPCCredentials over Insecure (passing both is an error). if cfg.Traces.GRPCCredentials != nil { cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(cfg.Traces.GRPCCredentials)) } else if cfg.Traces.Insecure { diff --git a/exporters/otlp/otlptrace/otlptracehttp/client_test.go b/exporters/otlp/otlptrace/otlptracehttp/client_test.go index 876d7584d49..22204c8e618 100644 --- a/exporters/otlp/otlptrace/otlptracehttp/client_test.go +++ b/exporters/otlp/otlptrace/otlptracehttp/client_test.go @@ -35,7 +35,7 @@ var ( } customUserAgentHeader = map[string]string{ - "user-agent": "custome-user-agent", + "user-agent": "custom-user-agent", } customProxyHeader = map[string]string{ diff --git a/exporters/otlp/otlptrace/otlptracehttp/doc.go b/exporters/otlp/otlptrace/otlptracehttp/doc.go index 43534cbfba4..9fea75ad19c 100644 --- a/exporters/otlp/otlptrace/otlptracehttp/doc.go +++ b/exporters/otlp/otlptrace/otlptracehttp/doc.go @@ -22,7 +22,7 @@ target URL to which the exporter sends telemetry. The value must contain a scheme ("http" or "https") and host. The value may additionally contain a port and a path. The value should not contain a query string or fragment. -The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WitnInsecure], and [WithURLPath] options. +The configuration can be overridden by [WithEndpoint], [WithEndpointURL], [WithInsecure], and [WithURLPath] options. OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_TRACES_HEADERS (default: none) - key-value pairs used as headers associated with HTTP requests. diff --git a/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go b/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go index 2ebbc752f4b..4cfd6c27f58 100644 --- a/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go +++ b/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go @@ -125,7 +125,7 @@ func NewGRPCConfig(opts ...GRPCOption) Config { if cfg.ServiceConfig != "" { cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) } - // Priroritize GRPCCredentials over Insecure (passing both is an error). + // Prioritize GRPCCredentials over Insecure (passing both is an error). if cfg.Traces.GRPCCredentials != nil { cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(cfg.Traces.GRPCCredentials)) } else if cfg.Traces.Insecure { diff --git a/exporters/prometheus/exporter_test.go b/exporters/prometheus/exporter_test.go index 377b4230d05..38e4d1d990d 100644 --- a/exporters/prometheus/exporter_test.go +++ b/exporters/prometheus/exporter_test.go @@ -28,12 +28,12 @@ import ( func TestPrometheusExporter(t *testing.T) { testCases := []struct { - name string - emptyResource bool - customResouceAttrs []attribute.KeyValue - recordMetrics func(ctx context.Context, meter otelmetric.Meter) - options []Option - expectedFile string + name string + emptyResource bool + customResourceAttrs []attribute.KeyValue + recordMetrics func(ctx context.Context, meter otelmetric.Meter) + options []Option + expectedFile string }{ { name: "counter", @@ -264,7 +264,7 @@ func TestPrometheusExporter(t *testing.T) { }, { name: "custom resource", - customResouceAttrs: []attribute.KeyValue{ + customResourceAttrs: []attribute.KeyValue{ attribute.Key("A").String("B"), attribute.Key("C").String("D"), }, @@ -417,7 +417,7 @@ func TestPrometheusExporter(t *testing.T) { resource.WithAttributes(semconv.ServiceName("prometheus_test")), // Overwrite the semconv.TelemetrySDKVersionKey value so we don't need to update every version resource.WithAttributes(semconv.TelemetrySDKVersion("latest")), - resource.WithAttributes(tc.customResouceAttrs...), + resource.WithAttributes(tc.customResourceAttrs...), ) require.NoError(t, err) @@ -536,7 +536,7 @@ func TestDuplicateMetrics(t *testing.T) { withTypeFoo := otelmetric.WithAttributeSet(typeFoo) testCases := []struct { name string - customResouceAttrs []attribute.KeyValue + customResourceAttrs []attribute.KeyValue recordMetrics func(ctx context.Context, meterA, meterB otelmetric.Meter) options []Option possibleExpectedFiles []string diff --git a/internal/global/meter_test.go b/internal/global/meter_test.go index d3dd37e838f..9140f6b8aca 100644 --- a/internal/global/meter_test.go +++ b/internal/global/meter_test.go @@ -234,7 +234,7 @@ func TestMeterProviderDelegatesCalls(t *testing.T) { assert.Equal(t, 1, tMeter.siHist) assert.Equal(t, 1, len(tMeter.callbacks)) - // Because the Meter was provided by testmeterProvider it should also return our test instrument + // Because the Meter was provided by testMeterProvider it should also return our test instrument require.IsType(t, &testCountingFloatInstrument{}, ctr, "the meter did not delegate calls to the meter") assert.Equal(t, 1, ctr.(*testCountingFloatInstrument).count) @@ -283,11 +283,11 @@ func TestMeterDelegatesCalls(t *testing.T) { assert.Equal(t, 1, tMeter.siUDCount) assert.Equal(t, 1, tMeter.siHist) - // Because the Meter was provided by testmeterProvider it should also return our test instrument + // Because the Meter was provided by testMeterProvider it should also return our test instrument require.IsType(t, &testCountingFloatInstrument{}, ctr, "the meter did not delegate calls to the meter") assert.Equal(t, 1, ctr.(*testCountingFloatInstrument).count) - // Because the Meter was provided by testmeterProvider it should also return our test instrument + // Because the Meter was provided by testMeterProvider it should also return our test instrument require.IsType(t, &testCountingFloatInstrument{}, actr, "the meter did not delegate calls to the meter") assert.Equal(t, 1, actr.(*testCountingFloatInstrument).count) diff --git a/internal/shared/otlp/otlplog/transform/log.go.tmpl b/internal/shared/otlp/otlplog/transform/log.go.tmpl index 232172eb6b9..54c9c2b4d9e 100644 --- a/internal/shared/otlp/otlplog/transform/log.go.tmpl +++ b/internal/shared/otlp/otlplog/transform/log.go.tmpl @@ -66,7 +66,7 @@ func resourceLogsMap(dst *map[attribute.Distinct]*lpb.ResourceLogs, records []lo } } -// ScopeLogs returns a slice of OTLP ScopeLogs generated from recoreds. +// ScopeLogs returns a slice of OTLP ScopeLogs generated from records. func ScopeLogs(records []log.Record) []*lpb.ScopeLogs { scopeMap := scopeLogsMapPool.Get().(map[instrumentation.Scope]*lpb.ScopeLogs) defer func() { diff --git a/internal/shared/otlp/otlpmetric/oconf/options.go.tmpl b/internal/shared/otlp/otlpmetric/oconf/options.go.tmpl index 071a144fdf5..1f7cc658768 100644 --- a/internal/shared/otlp/otlpmetric/oconf/options.go.tmpl +++ b/internal/shared/otlp/otlpmetric/oconf/options.go.tmpl @@ -139,7 +139,7 @@ func NewGRPCConfig(opts ...GRPCOption) Config { if cfg.ServiceConfig != "" { cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) } - // Priroritize GRPCCredentials over Insecure (passing both is an error). + // Prioritize GRPCCredentials over Insecure (passing both is an error). if cfg.Metrics.GRPCCredentials != nil { cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(cfg.Metrics.GRPCCredentials)) } else if cfg.Metrics.Insecure { diff --git a/internal/shared/otlp/otlpmetric/oconf/tls.go.tmpl b/internal/shared/otlp/otlpmetric/oconf/tls.go.tmpl index c674f87134b..6b4edc70ff4 100644 --- a/internal/shared/otlp/otlpmetric/oconf/tls.go.tmpl +++ b/internal/shared/otlp/otlpmetric/oconf/tls.go.tmpl @@ -14,7 +14,7 @@ import ( ) // ReadTLSConfigFromFile reads a PEM certificate file and creates -// a tls.Config that will use this certifate to verify a server certificate. +// a tls.Config that will use this certificate to verify a server certificate. func ReadTLSConfigFromFile(path string) (*tls.Config, error) { b, err := os.ReadFile(path) if err != nil { diff --git a/internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl b/internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl index a867b707e89..a7f79c3efb4 100644 --- a/internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl +++ b/internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl @@ -125,7 +125,7 @@ func NewGRPCConfig(opts ...GRPCOption) Config { if cfg.ServiceConfig != "" { cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) } - // Priroritize GRPCCredentials over Insecure (passing both is an error). + // Prioritize GRPCCredentials over Insecure (passing both is an error). if cfg.Traces.GRPCCredentials != nil { cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(cfg.Traces.GRPCCredentials)) } else if cfg.Traces.Insecure { diff --git a/log/DESIGN.md b/log/DESIGN.md index 2bb8c3a643f..7f48738353c 100644 --- a/log/DESIGN.md +++ b/log/DESIGN.md @@ -105,16 +105,16 @@ is defined as `Record` struct in [record.go](record.go). is accessed using following methods: ```go -func (r *Record) Timestamp() time.Time -func (r *Record) SetTimestamp(t time.Time) +func (r *Record) Timestamp() time.Time +func (r *Record) SetTimestamp(t time.Time) ``` [`ObservedTimestamp`](https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-observedtimestamp) is accessed using following methods: ```go -func (r *Record) ObservedTimestamp() time.Time -func (r *Record) SetObservedTimestamp(t time.Time) +func (r *Record) ObservedTimestamp() time.Time +func (r *Record) SetObservedTimestamp(t time.Time) ``` [`SeverityNumber`](https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-severitynumber) @@ -307,7 +307,7 @@ The API needs to evolve orthogonally to `slog`. `slog` is not compliant with the [Logs Bridge API](https://opentelemetry.io/docs/specs/otel/logs/bridge-api/). and we cannot expect the Go team to make `slog` compliant with it. -The interoperabilty can be achieved using [a log bridge](https://opentelemetry.io/docs/specs/otel/glossary/#log-appender--bridge). +The interoperability can be achieved using [a log bridge](https://opentelemetry.io/docs/specs/otel/glossary/#log-appender--bridge). You can read more about OpenTelemetry Logs design on [opentelemetry.io](https://opentelemetry.io/docs/concepts/signals/logs/). diff --git a/metric/asyncfloat64.go b/metric/asyncfloat64.go index cf23db77803..f8435d8f288 100644 --- a/metric/asyncfloat64.go +++ b/metric/asyncfloat64.go @@ -213,7 +213,7 @@ type Float64Observer interface { } // Float64Callback is a function registered with a Meter that makes -// observations for a Float64Observerable instrument it is registered with. +// observations for a Float64Observable instrument it is registered with. // Calls to the Float64Observer record measurement values for the // Float64Observable. // diff --git a/metric/asyncint64.go b/metric/asyncint64.go index c82ba5324e2..e079aaef169 100644 --- a/metric/asyncint64.go +++ b/metric/asyncint64.go @@ -212,7 +212,7 @@ type Int64Observer interface { } // Int64Callback is a function registered with a Meter that makes observations -// for an Int64Observerable instrument it is registered with. Calls to the +// for an Int64Observable instrument it is registered with. Calls to the // Int64Observer record measurement values for the Int64Observable. // // The function needs to complete in a finite amount of time and the deadline diff --git a/sdk/log/DESIGN.md b/sdk/log/DESIGN.md index c94d50d8ffd..2e0fb15e29c 100644 --- a/sdk/log/DESIGN.md +++ b/sdk/log/DESIGN.md @@ -122,12 +122,12 @@ The benchmark results can be found in [the prototype](https://github.com/open-te ## Rejected alternatives -### Represent both LogRecordProcessor and LogRecordExporter as Expoter +### Represent both LogRecordProcessor and LogRecordExporter as Exporter Because the [LogRecordProcessor](https://opentelemetry.io/docs/specs/otel/logs/sdk/#logrecordprocessor) and the [LogRecordProcessor](https://opentelemetry.io/docs/specs/otel/logs/sdk/#logrecordexporter) abstractions are so similar, there was a proposal to unify them under -single `Expoter` interface.[^3] +single `Exporter` interface.[^3] However, introducing a `Processor` interface makes it easier to create custom processor decorators[^4] @@ -170,7 +170,7 @@ parameters. [^1]: [A Guide to the Go Garbage Collector](https://tip.golang.org/doc/gc-guide) [^2]: [OpenTelemetry Logging](https://opentelemetry.io/docs/specs/otel/logs) -[^3]: [Conversation on representing LogRecordProcessor and LogRecordExporter via a single Expoter interface](https://github.com/open-telemetry/opentelemetry-go/pull/4954#discussion_r1515050480) +[^3]: [Conversation on representing LogRecordProcessor and LogRecordExporter via a single Exporter interface](https://github.com/open-telemetry/opentelemetry-go/pull/4954#discussion_r1515050480) [^4]: [Introduce Processor](https://github.com/pellared/opentelemetry-go/pull/9) [^5]: [Log record mutations do not have to be visible in next registered processors](https://github.com/open-telemetry/opentelemetry-specification/pull/4067) [^6]: [Profile-guided optimization](https://go.dev/doc/pgo) diff --git a/sdk/log/example_test.go b/sdk/log/example_test.go index 3b6c32b8961..be92d2677c4 100644 --- a/sdk/log/example_test.go +++ b/sdk/log/example_test.go @@ -70,12 +70,12 @@ func ExampleProcessor_filtering() { type key struct{} -var igoreLogsKey key +var ignoreLogsKey key // WithIgnoreLogs returns a context which is used by [ContextFilterProcessor] // to filter out log records. func WithIgnoreLogs(ctx context.Context) context.Context { - return context.WithValue(ctx, igoreLogsKey, true) + return context.WithValue(ctx, ignoreLogsKey, true) } // ContextFilterProcessor filters out logs when a context deriving from @@ -110,7 +110,7 @@ func (p *ContextFilterProcessor) Enabled(ctx context.Context, record log.Record) } func ignoreLogs(ctx context.Context) bool { - _, ok := ctx.Value(igoreLogsKey).(bool) + _, ok := ctx.Value(ignoreLogsKey).(bool) return ok } diff --git a/sdk/log/simple.go b/sdk/log/simple.go index 1b2a68961b3..002e52cae66 100644 --- a/sdk/log/simple.go +++ b/sdk/log/simple.go @@ -58,7 +58,7 @@ func (s *SimpleProcessor) OnEmit(ctx context.Context, r *Record) error { return s.exporter.Export(ctx, *records) } -// Shutdown shuts down the expoter. +// Shutdown shuts down the exporter. func (s *SimpleProcessor) Shutdown(ctx context.Context) error { if s.exporter == nil { return nil diff --git a/sdk/metric/instrument.go b/sdk/metric/instrument.go index b52a330b3bc..2e6ac543401 100644 --- a/sdk/metric/instrument.go +++ b/sdk/metric/instrument.go @@ -234,8 +234,8 @@ func (i *float64Inst) aggregate(ctx context.Context, val float64, s attribute.Se } } -// observablID is a comparable unique identifier of an observable. -type observablID[N int64 | float64] struct { +// observableID is a comparable unique identifier of an observable. +type observableID[N int64 | float64] struct { name string description string kind InstrumentKind @@ -287,7 +287,7 @@ func newInt64Observable(m *meter, kind InstrumentKind, name, desc, u string) int type observable[N int64 | float64] struct { metric.Observable - observablID[N] + observableID[N] meter *meter measures measures[N] @@ -296,7 +296,7 @@ type observable[N int64 | float64] struct { func newObservable[N int64 | float64](m *meter, kind InstrumentKind, name, desc, u string) *observable[N] { return &observable[N]{ - observablID: observablID[N]{ + observableID: observableID[N]{ name: name, description: desc, kind: kind, diff --git a/sdk/metric/internal/aggregate/histogram_test.go b/sdk/metric/internal/aggregate/histogram_test.go index cc9772da0d9..f791c6e7149 100644 --- a/sdk/metric/internal/aggregate/histogram_test.go +++ b/sdk/metric/internal/aggregate/histogram_test.go @@ -326,7 +326,7 @@ func TestHistogramImmutableBounds(t *testing.T) { assert.Equal(t, cpB, h.bounds, "modifying the Aggregation bounds should not change the bounds") } -func TestCumulativeHistogramImutableCounts(t *testing.T) { +func TestCumulativeHistogramImmutableCounts(t *testing.T) { h := newHistogram[int64](bounds, noMinMax, false, 0, dropExemplars[int64]) h.measure(context.Background(), 5, alice, nil) diff --git a/sdk/metric/internal/aggregate/sum.go b/sdk/metric/internal/aggregate/sum.go index 89136692260..5647c1db5d7 100644 --- a/sdk/metric/internal/aggregate/sum.go +++ b/sdk/metric/internal/aggregate/sum.go @@ -142,7 +142,7 @@ func (s *sum[N]) cumulative(dest *metricdata.Aggregation) int { } // newPrecomputedSum returns an aggregator that summarizes a set of -// observatrions as their arithmetic sum. Each sum is scoped by attributes and +// observations as their arithmetic sum. Each sum is scoped by attributes and // the aggregation cycle the measurements were made in. func newPrecomputedSum[N int64 | float64](monotonic bool, limit int, r func() exemplar.FilteredReservoir[N]) *precomputedSum[N] { return &precomputedSum[N]{ @@ -152,7 +152,7 @@ func newPrecomputedSum[N int64 | float64](monotonic bool, limit int, r func() ex } } -// precomputedSum summarizes a set of observatrions as their arithmetic sum. +// precomputedSum summarizes a set of observations as their arithmetic sum. type precomputedSum[N int64 | float64] struct { *valueMap[N] diff --git a/sdk/metric/internal/exemplar/rand.go b/sdk/metric/internal/exemplar/rand.go index 199a2608f71..8cbcff2404a 100644 --- a/sdk/metric/internal/exemplar/rand.go +++ b/sdk/metric/internal/exemplar/rand.go @@ -19,7 +19,7 @@ var ( // Do not use crypto/rand. There is no reason for the decrease in performance // given this is not a security sensitive decision. rng = rand.New(rand.NewSource(time.Now().UnixNano())) - // Ensure concurrent safe accecess to rng and its underlying source. + // Ensure concurrent safe access to rng and its underlying source. rngMu sync.Mutex ) diff --git a/sdk/metric/internal/exemplar/reservoir_test.go b/sdk/metric/internal/exemplar/reservoir_test.go index b5fc5453d42..3d091a93cc9 100644 --- a/sdk/metric/internal/exemplar/reservoir_test.go +++ b/sdk/metric/internal/exemplar/reservoir_test.go @@ -18,7 +18,7 @@ import ( // Sat Jan 01 2000 00:00:00 GMT+0000. var staticTime = time.Unix(946684800, 0) -type factory func(requstedCap int) (r Reservoir, actualCap int) +type factory func(requestedCap int) (r Reservoir, actualCap int) func ReservoirTest[N int64 | float64](f factory) func(*testing.T) { return func(t *testing.T) { diff --git a/sdk/metric/meter.go b/sdk/metric/meter.go index 2309e5b2b0f..abff4650e1a 100644 --- a/sdk/metric/meter.go +++ b/sdk/metric/meter.go @@ -459,7 +459,7 @@ func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable) } continue } - reg.registerInt64(o.observablID) + reg.registerInt64(o.observableID) case float64Observable: if err := o.registerable(m); err != nil { if !errors.Is(err, errEmptyAgg) { @@ -467,7 +467,7 @@ func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable) } continue } - reg.registerFloat64(o.observablID) + reg.registerFloat64(o.observableID) default: // Instrument external to the SDK. return nil, fmt.Errorf("invalid observable: from different implementation") @@ -488,14 +488,14 @@ func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable) type observer struct { embedded.Observer - float64 map[observablID[float64]]struct{} - int64 map[observablID[int64]]struct{} + float64 map[observableID[float64]]struct{} + int64 map[observableID[int64]]struct{} } func newObserver() observer { return observer{ - float64: make(map[observablID[float64]]struct{}), - int64: make(map[observablID[int64]]struct{}), + float64: make(map[observableID[float64]]struct{}), + int64: make(map[observableID[int64]]struct{}), } } @@ -503,11 +503,11 @@ func (r observer) len() int { return len(r.float64) + len(r.int64) } -func (r observer) registerFloat64(id observablID[float64]) { +func (r observer) registerFloat64(id observableID[float64]) { r.float64[id] = struct{}{} } -func (r observer) registerInt64(id observablID[int64]) { +func (r observer) registerInt64(id observableID[int64]) { r.int64[id] = struct{}{} } @@ -536,7 +536,7 @@ func (r observer) ObserveFloat64(o metric.Float64Observable, v float64, opts ... return } - if _, registered := r.float64[oImpl.observablID]; !registered { + if _, registered := r.float64[oImpl.observableID]; !registered { if !oImpl.dropAggregation { global.Error(errUnregObserver, "failed to record", "name", oImpl.name, @@ -571,7 +571,7 @@ func (r observer) ObserveInt64(o metric.Int64Observable, v int64, opts ...metric return } - if _, registered := r.int64[oImpl.observablID]; !registered { + if _, registered := r.int64[oImpl.observableID]; !registered { if !oImpl.dropAggregation { global.Error(errUnregObserver, "failed to record", "name", oImpl.name, diff --git a/sdk/metric/meter_test.go b/sdk/metric/meter_test.go index da614e62428..42ff645ac4e 100644 --- a/sdk/metric/meter_test.go +++ b/sdk/metric/meter_test.go @@ -1171,13 +1171,13 @@ func TestUnregisterUnregisters(t *testing.T) { int64Gauge, err := m.Int64ObservableGauge("int64.gauge") require.NoError(t, err) - floag64Counter, err := m.Float64ObservableCounter("floag64.counter") + float64Counter, err := m.Float64ObservableCounter("float64.counter") require.NoError(t, err) - floag64UpDownCounter, err := m.Float64ObservableUpDownCounter("floag64.up_down_counter") + float64UpDownCounter, err := m.Float64ObservableUpDownCounter("float64.up_down_counter") require.NoError(t, err) - floag64Gauge, err := m.Float64ObservableGauge("floag64.gauge") + float64Gauge, err := m.Float64ObservableGauge("float64.gauge") require.NoError(t, err) var called bool @@ -1189,9 +1189,9 @@ func TestUnregisterUnregisters(t *testing.T) { int64Counter, int64UpDownCounter, int64Gauge, - floag64Counter, - floag64UpDownCounter, - floag64Gauge, + float64Counter, + float64UpDownCounter, + float64Gauge, ) require.NoError(t, err) @@ -1225,13 +1225,13 @@ func TestRegisterCallbackDropAggregations(t *testing.T) { int64Gauge, err := m.Int64ObservableGauge("int64.gauge") require.NoError(t, err) - floag64Counter, err := m.Float64ObservableCounter("floag64.counter") + float64Counter, err := m.Float64ObservableCounter("float64.counter") require.NoError(t, err) - floag64UpDownCounter, err := m.Float64ObservableUpDownCounter("floag64.up_down_counter") + float64UpDownCounter, err := m.Float64ObservableUpDownCounter("float64.up_down_counter") require.NoError(t, err) - floag64Gauge, err := m.Float64ObservableGauge("floag64.gauge") + float64Gauge, err := m.Float64ObservableGauge("float64.gauge") require.NoError(t, err) var called bool @@ -1243,9 +1243,9 @@ func TestRegisterCallbackDropAggregations(t *testing.T) { int64Counter, int64UpDownCounter, int64Gauge, - floag64Counter, - floag64UpDownCounter, - floag64Gauge, + float64Counter, + float64UpDownCounter, + float64Gauge, ) require.NoError(t, err) diff --git a/sdk/metric/periodic_reader_test.go b/sdk/metric/periodic_reader_test.go index b22e51222df..be67b2b5ac0 100644 --- a/sdk/metric/periodic_reader_test.go +++ b/sdk/metric/periodic_reader_test.go @@ -425,7 +425,7 @@ func BenchmarkPeriodicReader(b *testing.B) { require.NoError(b, r.Shutdown(context.Background())) } -func TestPeriodiclReaderTemporality(t *testing.T) { +func TestPeriodicReaderTemporality(t *testing.T) { tests := []struct { name string exporter *fnExporter diff --git a/sdk/resource/host_id_windows.go b/sdk/resource/host_id_windows.go index 71386e2da4c..3677c83d7da 100644 --- a/sdk/resource/host_id_windows.go +++ b/sdk/resource/host_id_windows.go @@ -10,17 +10,16 @@ import ( "golang.org/x/sys/windows/registry" ) -// implements hostIDReader +// implements hostIDReader. type hostIDReaderWindows struct{} -// read reads MachineGuid from the windows registry key: -// SOFTWARE\Microsoft\Cryptography +// read reads MachineGuid from the Windows registry key: +// SOFTWARE\Microsoft\Cryptography. func (*hostIDReaderWindows) read() (string, error) { k, err := registry.OpenKey( registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Cryptography`, registry.QUERY_VALUE|registry.WOW64_64KEY, ) - if err != nil { return "", err } diff --git a/sdk/resource/os_release_unix_test.go b/sdk/resource/os_release_unix_test.go index e7a06d721d4..9e81a365061 100644 --- a/sdk/resource/os_release_unix_test.go +++ b/sdk/resource/os_release_unix_test.go @@ -96,7 +96,7 @@ ESCAPED4="\\var" =line with missing key should be skipped PROP1=name=john - PROP2 = Value + PROP2 = Value PROP3='This value will be overwritten by the next one' PROP3='Final value'`) diff --git a/sdk/resource/os_windows.go b/sdk/resource/os_windows.go index 5e3d199d785..a6a5a53c0ea 100644 --- a/sdk/resource/os_windows.go +++ b/sdk/resource/os_windows.go @@ -17,7 +17,6 @@ import ( func platformOSDescription() (string, error) { k, err := registry.OpenKey( registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE) - if err != nil { return "", err } diff --git a/sdk/resource/resource_test.go b/sdk/resource/resource_test.go index 4ce43df87e9..ee7eef55be2 100644 --- a/sdk/resource/resource_test.go +++ b/sdk/resource/resource_test.go @@ -452,7 +452,7 @@ func TestNew(t *testing.T) { } } -func TestNewWrapedError(t *testing.T) { +func TestNewWrappedError(t *testing.T) { localErr := errors.New("local error") _, err := resource.New( context.Background(), diff --git a/semconv/internal/v2/http_test.go b/semconv/internal/v2/http_test.go index 2906dba72e0..988b3454e23 100644 --- a/semconv/internal/v2/http_test.go +++ b/semconv/internal/v2/http_test.go @@ -297,7 +297,7 @@ func TestRequestHeader(t *testing.T) { }, got) } -func TestReponseHeader(t *testing.T) { +func TestResponseHeader(t *testing.T) { ips := []string{"127.0.0.5", "127.0.0.9"} user := []string{"alice"} h := http.Header{"ips": ips, "user": user} diff --git a/semconv/internal/v3/http_test.go b/semconv/internal/v3/http_test.go index 1732e9f2b99..71ed97575d9 100644 --- a/semconv/internal/v3/http_test.go +++ b/semconv/internal/v3/http_test.go @@ -297,7 +297,7 @@ func TestRequestHeader(t *testing.T) { }, got) } -func TestReponseHeader(t *testing.T) { +func TestResponseHeader(t *testing.T) { ips := []string{"127.0.0.5", "127.0.0.9"} user := []string{"alice"} h := http.Header{"ips": ips, "user": user} diff --git a/semconv/internal/v4/http_test.go b/semconv/internal/v4/http_test.go index 85a55680e89..3cee7125cbe 100644 --- a/semconv/internal/v4/http_test.go +++ b/semconv/internal/v4/http_test.go @@ -323,7 +323,7 @@ func TestRequestHeader(t *testing.T) { }, got) } -func TestReponseHeader(t *testing.T) { +func TestResponseHeader(t *testing.T) { ips := []string{"127.0.0.5", "127.0.0.9"} user := []string{"alice"} h := http.Header{"ips": ips, "user": user} diff --git a/trace/context.go b/trace/context.go index 5650a174b4a..8c45a7107ff 100644 --- a/trace/context.go +++ b/trace/context.go @@ -22,7 +22,7 @@ func ContextWithSpanContext(parent context.Context, sc SpanContext) context.Cont return ContextWithSpan(parent, nonRecordingSpan{sc: sc}) } -// ContextWithRemoteSpanContext returns a copy of parent with rsc set explicly +// ContextWithRemoteSpanContext returns a copy of parent with rsc set explicitly // as a remote SpanContext and as the current Span. The Span implementation // that wraps rsc is non-recording and performs no operations other than to // return rsc as the SpanContext from the SpanContext method. diff --git a/trace/doc.go b/trace/doc.go index d661c5d100f..cdbf41d6d7f 100644 --- a/trace/doc.go +++ b/trace/doc.go @@ -96,7 +96,7 @@ can embed the API interface directly. This option is not recommended. It will lead to publishing packages that contain runtime panics when users update to newer versions of -[go.opentelemetry.io/otel/trace], which may be done with a trasitive +[go.opentelemetry.io/otel/trace], which may be done with a transitive dependency. Finally, an author can embed another implementation in theirs. The embedded