From 00cdc368308d628d1983f65cdfea225a6852ad98 Mon Sep 17 00:00:00 2001 From: dmathieu <42@dmathieu.com> Date: Wed, 31 Jul 2024 13:18:29 +0200 Subject: [PATCH 1/3] setup codespell --- .codespellignore | 2 ++ .codespellrc | 10 ++++++++++ .gitignore | 3 +++ Makefile | 35 +++++++++++++++++++++++++++++++++++ requirements.txt | 1 + 5 files changed, 51 insertions(+) create mode 100644 .codespellignore create mode 100644 .codespellrc create mode 100644 Makefile create mode 100644 requirements.txt diff --git a/.codespellignore b/.codespellignore new file mode 100644 index 000000000..c43186667 --- /dev/null +++ b/.codespellignore @@ -0,0 +1,2 @@ +ot +te diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 000000000..0dbfda339 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,10 @@ +# https://github.com/codespell-project/codespell +[codespell] +builtin = clear,rare,informal +check-filenames = +check-hidden = +ignore-words = .codespellignore +interactive = 1 +skip = .git,venv,coverage,doc,docs +uri-ignore-words-list = * +write = diff --git a/.gitignore b/.gitignore index c8016688c..9d20c2321 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,7 @@ # rbenv configuration .ruby-version +# Python virtual env for codespell +venv + tags diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..7b9a6baa4 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +# Virtualized python tools via docker + +# The directory where the virtual environment is created. +VENVDIR := venv + +PYTOOLS := $(VENVDIR)/bin + +# The pip executable in the virtual environment. +PIP := $(PYTOOLS)/pip + +# The directory in the docker image where the current directory is mounted. +WORKDIR := /workdir + +# The python image to use for the virtual environment. +PYTHONIMAGE := python:3.11.3-slim-bullseye + +# Run the python image with the current directory mounted. +DOCKERPY := docker run --rm -v "$(CURDIR):$(WORKDIR)" -w $(WORKDIR) $(PYTHONIMAGE) + +# Create a virtual environment for Python tools. +$(PYTOOLS): +# The `--upgrade` flag is needed to ensure that the virtual environment is +# created with the latest pip version. + @$(DOCKERPY) bash -c "python3 -m venv $(VENVDIR) && $(PIP) install --upgrade pip" + +# Install python packages into the virtual environment. +$(PYTOOLS)/%: $(PYTOOLS) + @$(DOCKERPY) $(PIP) install -r requirements.txt + +CODESPELL = $(PYTOOLS)/codespell +$(CODESPELL): PACKAGE=codespell + +.PHONY: codespell +codespell: $(CODESPELL) + @$(DOCKERPY) $(CODESPELL) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..ab09daf9d --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +codespell==2.3.0 From 76ff6b7adede9f4bdbe3ea0513c8d7b3daa8abd5 Mon Sep 17 00:00:00 2001 From: dmathieu <42@dmathieu.com> Date: Wed, 31 Jul 2024 13:18:35 +0200 Subject: [PATCH 2/3] fix all codespell issues --- CHANGELOG.md | 2 +- CONTRIBUTING.md | 2 +- api/CHANGELOG.md | 2 +- api/README.md | 5 ++++- api/lib/opentelemetry/baggage.rb | 2 +- api/lib/opentelemetry/baggage/builder.rb | 2 +- .../baggage/propagation/text_map_propagator.rb | 2 +- api/lib/opentelemetry/trace/propagation/trace_context.rb | 2 +- api/lib/opentelemetry/trace/span_kind.rb | 2 +- .../context/propagation/text_map_getter_test.rb | 2 +- .../trace/propagation/trace_context/trace_parent_test.rb | 2 +- exporter/jaeger/thrift/gen-rb/zipkincore_types.rb | 4 ++-- exporter/jaeger/thrift/zipkincore.thrift | 6 +++--- exporter/otlp-metrics/README.md | 2 +- exporter/otlp/README.md | 4 ++-- .../zipkin/lib/opentelemetry/exporter/zipkin/exporter.rb | 2 +- .../lib/opentelemetry/exporter/zipkin/transformer.rb | 2 +- logs_sdk/lib/opentelemetry/sdk/logs/log_record.rb | 2 +- metrics_api/README.md | 6 +++++- metrics_api/test/opentelemetry/opentelemetry_test.rb | 2 +- propagator/b3/CHANGELOG.md | 2 +- propagator/jaeger/CHANGELOG.md | 2 +- registry/CHANGELOG.md | 2 +- registry/lib/opentelemetry/instrumentation/registry.rb | 2 +- sdk/README.md | 8 +++++++- sdk/lib/opentelemetry/sdk/configurator.rb | 2 +- sdk/opentelemetry-sdk.gemspec | 2 +- sdk/test/opentelemetry/sdk/configurator_test.rb | 2 +- .../sdk/trace/export/in_memory_span_exporter_test.rb | 2 +- sdk/test/opentelemetry/sdk/trace/span_limits_test.rb | 2 +- .../lib/opentelemetry/semantic_conventions/resource.rb | 2 +- 31 files changed, 48 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 597328c71..e9c8721cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,6 @@ All notable changes to this project were documented in this file. This is of his * [#286](https://github.com/open-telemetry/opentelemetry-ruby/pull/286) Update Schedule. ([@fbogsany](https://github.com/fbogsany)) -* [#288](https://github.com/open-telemetry/opentelemetry-ruby/pull/288) Fix api/sdk gem install instuctions. ([@mwlang](https://github.com/mwlang)) +* [#288](https://github.com/open-telemetry/opentelemetry-ruby/pull/288) Fix api/sdk gem install instructions. ([@mwlang](https://github.com/mwlang)) * [#294](https://github.com/open-telemetry/opentelemetry-ruby/pull/294) Add CHANGELOG. ([@ericmustin](https://github.com/ericmustin)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8df79412e..0e0bf8446 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -154,7 +154,7 @@ to ensure that your code complies before opening a pull request. We also use Yard to generate class documentation automatically. Among other things, this means: - * Methods and arguments should include the appropraite type annotations + * Methods and arguments should include the appropriate type annotations * You can use markdown formatting in your documentation comments You can generate the docs locally to see the results, by running: diff --git a/api/CHANGELOG.md b/api/CHANGELOG.md index 43b6e5fb6..35c3e87ad 100644 --- a/api/CHANGELOG.md +++ b/api/CHANGELOG.md @@ -71,7 +71,7 @@ * BREAKING CHANGE: Remove optional parent_context from in_span [729](https://github.com/open-telemetry/opentelemetry-ruby/pull/729) * BREAKING CHANGE: Refactor Baggage to remove Noop* [800](https://github.com/open-telemetry/opentelemetry-ruby/pull/800) - - The noop baggage manger has been removed. + - The noop baggage manager has been removed. - The baggage management methods are now available through OpenTelemetry::Baggage#method, previously OpenTelemetry.baggage#method * BREAKING CHANGE: Total order constraint on span.status= [805](https://github.com/open-telemetry/opentelemetry-ruby/pull/805) - The OpenTelemetry::Trace::Util::HttpToStatus module has been removed as it was incorrectly setting the span status to OK for codes codes in the range 100..399 diff --git a/api/README.md b/api/README.md index 3e464b392..b44d1ff8a 100644 --- a/api/README.md +++ b/api/README.md @@ -12,7 +12,10 @@ OpenTelemetry provides a single set of APIs, libraries, agents, and collector se The `opentelemetry-api` gem defines the core OpenTelemetry interfaces in the form of abstract classes and no-op implementations. That is, it defines interfaces and data types sufficient for a library or application to code against to produce telemetry data, but does not actually collect, analyze, or export the data. -To collect and analyze telemetry data, *applications* should also install a concrete implementation of the API, such as the `opentelemetry-sdk` gem. However, *libraries* that produce telemetry data should depend only on `opentelemetry-api`, deferring the choise of concrete implementation to the application developer. +To collect and analyze telemetry data, *applications* should also +install a concrete implementation of the API, such as the +`opentelemetry-sdk` gem. However, *libraries* that produce telemetry +data should depend only on `opentelemetry-api`, deferring the choice of concrete implementation to the application developer. ## How do I get started? diff --git a/api/lib/opentelemetry/baggage.rb b/api/lib/opentelemetry/baggage.rb index 10cfc483b..2391e0c7f 100644 --- a/api/lib/opentelemetry/baggage.rb +++ b/api/lib/opentelemetry/baggage.rb @@ -73,7 +73,7 @@ def raw_entries(context: Context.current) # @param [String] key The key to store this value under # @param [String] value String value to be stored under key # @param [optional String] metadata This is here to store properties - # received from other W3C Baggage impelmentations but is not exposed in + # received from other W3C Baggage implementations but is not exposed in # OpenTelemetry. This is condsidered private API and not for use by # end-users. # @param [optional Context] context The context to update with new diff --git a/api/lib/opentelemetry/baggage/builder.rb b/api/lib/opentelemetry/baggage/builder.rb index ff213a28e..b3323dbe7 100644 --- a/api/lib/opentelemetry/baggage/builder.rb +++ b/api/lib/opentelemetry/baggage/builder.rb @@ -21,7 +21,7 @@ def initialize(entries) # @param [String] key The key to store this value under # @param [String] value String value to be stored under key # @param [optional String] metadata This is here to store properties - # received from other W3C Baggage impelmentations but is not exposed in + # received from other W3C Baggage implementations but is not exposed in # OpenTelemetry. This is condsidered private API and not for use by # end-users. def set_value(key, value, metadata: nil) diff --git a/api/lib/opentelemetry/baggage/propagation/text_map_propagator.rb b/api/lib/opentelemetry/baggage/propagation/text_map_propagator.rb index 3dadc0c16..53bb51b99 100644 --- a/api/lib/opentelemetry/baggage/propagation/text_map_propagator.rb +++ b/api/lib/opentelemetry/baggage/propagation/text_map_propagator.rb @@ -100,7 +100,7 @@ def encode(baggage) def encode_value(key, entry) result = +"#{CGI.escape(key.to_s)}=#{CGI.escape(entry.value.to_s)}" - # We preserve metadata recieved on extract and assume it's already formatted + # We preserve metadata received on extract and assume it's already formatted # for transport. It's sent as-is without further processing. result << ";#{entry.metadata}" if entry.metadata result diff --git a/api/lib/opentelemetry/trace/propagation/trace_context.rb b/api/lib/opentelemetry/trace/propagation/trace_context.rb index f81178780..103080989 100644 --- a/api/lib/opentelemetry/trace/propagation/trace_context.rb +++ b/api/lib/opentelemetry/trace/propagation/trace_context.rb @@ -10,7 +10,7 @@ module OpenTelemetry module Trace module Propagation - # The TraceContext module contains injectors, extractors, and utilties + # The TraceContext module contains injectors, extractors, and utilities # for context propagation in the W3C Trace Context format. module TraceContext extend self diff --git a/api/lib/opentelemetry/trace/span_kind.rb b/api/lib/opentelemetry/trace/span_kind.rb index 2312a9523..fe89e80bc 100644 --- a/api/lib/opentelemetry/trace/span_kind.rb +++ b/api/lib/opentelemetry/trace/span_kind.rb @@ -26,7 +26,7 @@ module SpanKind # spans. PRODUCER = :producer - # Indicates that the span describes consumer recieving a message from a broker. Unlike client + # Indicates that the span describes consumer receiving a message from a broker. Unlike client # and server, there is no direct critical path latency relationship between producer and # consumer spans. CONSUMER = :consumer diff --git a/api/test/opentelemetry/context/propagation/text_map_getter_test.rb b/api/test/opentelemetry/context/propagation/text_map_getter_test.rb index 88f368919..d2d458970 100644 --- a/api/test/opentelemetry/context/propagation/text_map_getter_test.rb +++ b/api/test/opentelemetry/context/propagation/text_map_getter_test.rb @@ -20,7 +20,7 @@ _(getter.get(carrier, 'x-source-id')).must_equal('123') end - it 'returns nil for non-existant key' do + it 'returns nil for non-existent key' do _(getter.get(carrier, 'not-here')).must_be_nil end end diff --git a/api/test/opentelemetry/trace/propagation/trace_context/trace_parent_test.rb b/api/test/opentelemetry/trace/propagation/trace_context/trace_parent_test.rb index 4869f8b17..65f47d863 100644 --- a/api/test/opentelemetry/trace/propagation/trace_context/trace_parent_test.rb +++ b/api/test/opentelemetry/trace/propagation/trace_context/trace_parent_test.rb @@ -76,7 +76,7 @@ _(tp.to_s).must_equal(expected) end - it 'must ignore flags it doesnt know (use the mask)' do + it 'must ignore flags it doesn\'t know (use the mask)' do value = '00-0000000000000000000000000000000a-000000000000000a-ff' assert TraceParent.from_string(value).sampled? value = '00-0000000000000000000000000000000a-000000000000000a-04' diff --git a/exporter/jaeger/thrift/gen-rb/zipkincore_types.rb b/exporter/jaeger/thrift/gen-rb/zipkincore_types.rb index 11ac3a4e3..95aea0ede 100644 --- a/exporter/jaeger/thrift/gen-rb/zipkincore_types.rb +++ b/exporter/jaeger/thrift/gen-rb/zipkincore_types.rb @@ -181,7 +181,7 @@ class Span # precise value possible. For example, gettimeofday or syncing nanoTime # against a tick of currentTimeMillis. # -# For compatibilty with instrumentation that precede this field, collectors +# For compatibility with instrumentation that precede this field, collectors # or span stores can derive this via Annotation.timestamp. # For example, SERVER_RECV.timestamp or CLIENT_SEND.timestamp. # @@ -194,7 +194,7 @@ class Span # precise measurement decoupled from problems of clocks, such as skew or NTP # updates causing time to move backwards. # -# For compatibilty with instrumentation that precede this field, collectors +# For compatibility with instrumentation that precede this field, collectors # or span stores can derive this by subtracting Annotation.timestamp. # For example, SERVER_SEND.timestamp - SERVER_RECV.timestamp. # diff --git a/exporter/jaeger/thrift/zipkincore.thrift b/exporter/jaeger/thrift/zipkincore.thrift index 2bb563c56..854294df5 100644 --- a/exporter/jaeger/thrift/zipkincore.thrift +++ b/exporter/jaeger/thrift/zipkincore.thrift @@ -292,7 +292,7 @@ struct Span { 3: string name, 4: i64 id, # unique span id, only used for this span 5: optional i64 parent_id, # parent span id - 6: list annotations, # all annotations/events that occured, sorted by timestamp + 6: list annotations, # all annotations/events that occurred, sorted by timestamp 8: list binary_annotations # any binary annotations 9: optional bool debug = 0 # if true, we DEMAND that this span passes all samplers /** @@ -302,7 +302,7 @@ struct Span { * precise value possible. For example, gettimeofday or syncing nanoTime * against a tick of currentTimeMillis. * - * For compatibilty with instrumentation that precede this field, collectors + * For compatibility with instrumentation that precede this field, collectors * or span stores can derive this via Annotation.timestamp. * For example, SERVER_RECV.timestamp or CLIENT_SEND.timestamp. * @@ -317,7 +317,7 @@ struct Span { * precise measurement decoupled from problems of clocks, such as skew or NTP * updates causing time to move backwards. * - * For compatibilty with instrumentation that precede this field, collectors + * For compatibility with instrumentation that precede this field, collectors * or span stores can derive this by subtracting Annotation.timestamp. * For example, SERVER_SEND.timestamp - SERVER_RECV.timestamp. * diff --git a/exporter/otlp-metrics/README.md b/exporter/otlp-metrics/README.md index fa596d224..559cfe528 100644 --- a/exporter/otlp-metrics/README.md +++ b/exporter/otlp-metrics/README.md @@ -122,7 +122,7 @@ The `opentelemetry-exporter-otlp-metrics` gem is distributed under the Apache 2. ## Working with Proto Definitions -The OTel community maintains a [repository with protobuf definitions][otel-proto-github] that language and collector implementors use to generate code. +The OTel community maintains a [repository with protobuf definitions][otel-proto-github] that language and collector implementers use to generate code. Maintainers are expected to keep up to date with the latest version of protos. This guide will provide you with step-by-step instructions on updating the OTLP Exporter gem with the latest definitions. diff --git a/exporter/otlp/README.md b/exporter/otlp/README.md index 55d09b847..5304b5476 100644 --- a/exporter/otlp/README.md +++ b/exporter/otlp/README.md @@ -97,7 +97,7 @@ The `opentelemetry-exporter-otlp` gem is distributed under the Apache 2.0 licens ## Working with Proto Definitions -The OTel community maintains a [repository with protobuf definitions][otel-proto-github] that language and collector implementors use to generate code. +The OTel community maintains a [repository with protobuf definitions][otel-proto-github] that language and collector implementers use to generate code. Maintainers are expected to keep up to date with the latest version of protos. This guide will provide you with step-by-step instructions on updating the OTLP Exporter gem with the latest definitions. @@ -136,7 +136,7 @@ $> bundle exec rake test ``` -**Commit the chnages and open a PR!** +**Commit the changes and open a PR!** [opentelemetry-collector-home]: https://opentelemetry.io/docs/collector/about/ [opentelemetry-home]: https://opentelemetry.io diff --git a/exporter/zipkin/lib/opentelemetry/exporter/zipkin/exporter.rb b/exporter/zipkin/lib/opentelemetry/exporter/zipkin/exporter.rb index 1052ff871..43efbee2c 100644 --- a/exporter/zipkin/lib/opentelemetry/exporter/zipkin/exporter.rb +++ b/exporter/zipkin/lib/opentelemetry/exporter/zipkin/exporter.rb @@ -135,7 +135,7 @@ def send_spans(zipkin_spans, timeout: nil) # rubocop:disable Metrics/MethodLengt response = measure_request_duration { @http.request(request) } response.body # Read and discard body - # in opentelemetry-js 200-399 is succcess, in opentelemetry-collector zipkin exporter,200-299 is a success + # in opentelemetry-js 200-399 is success, in opentelemetry-collector zipkin exporter,200-299 is a success # zipkin api docs list 202 as default success code # https://zipkin.io/zipkin-api/#/default/post_spans # TODO: redirect diff --git a/exporter/zipkin/lib/opentelemetry/exporter/zipkin/transformer.rb b/exporter/zipkin/lib/opentelemetry/exporter/zipkin/transformer.rb index 410978289..bed33c0cf 100644 --- a/exporter/zipkin/lib/opentelemetry/exporter/zipkin/transformer.rb +++ b/exporter/zipkin/lib/opentelemetry/exporter/zipkin/transformer.rb @@ -50,7 +50,7 @@ def to_zipkin_span(span_d, resource) add_status_tags(span_d, tags) tags = aggregate_span_tags(span_d, tags) - # TOOO: set debug flag? (is that represented in tracestate?) + # TODO: set debug flag? (is that represented in tracestate?) # https://github.com/openzipkin/b3-propagation#why-is-debug-encoded-as-x-b3-flags-1 # https://github.com/openzipkin/zipkin-api/blob/7692ca7be4dc3be9225db550d60c4d30e6e9ec59/zipkin2-api.yaml#L475 # TODO: shared key mapping diff --git a/logs_sdk/lib/opentelemetry/sdk/logs/log_record.rb b/logs_sdk/lib/opentelemetry/sdk/logs/log_record.rb index 255158df8..861f449d5 100644 --- a/logs_sdk/lib/opentelemetry/sdk/logs/log_record.rb +++ b/logs_sdk/lib/opentelemetry/sdk/logs/log_record.rb @@ -45,7 +45,7 @@ class LogRecord < OpenTelemetry::Logs::LogRecord # current context. # @param [optional OpenTelemetry::Trace::TraceFlags] trace_flags The # trace flags associated with the current context. - # @param [optional OpenTelemetry::SDK::Resources::Resource] recource The + # @param [optional OpenTelemetry::SDK::Resources::Resource] resource The # source of the log, desrived from the LoggerProvider. # @param [optional OpenTelemetry::SDK::InstrumentationScope] instrumentation_scope # The instrumentation scope, derived from the emitting Logger diff --git a/metrics_api/README.md b/metrics_api/README.md index dcefba929..6a552e26f 100644 --- a/metrics_api/README.md +++ b/metrics_api/README.md @@ -12,7 +12,11 @@ OpenTelemetry provides a single set of APIs, libraries, agents, and collector se The `opentelemetry-metrics-api` gem defines the core OpenTelemetry interfaces in the form of abstract classes and no-op implementations. That is, it defines interfaces and data types sufficient for a library or application to code against to produce telemetry data, but does not actually collect, analyze, or export the data. -To collect and analyze telemetry data, _applications_ should also install a concrete implementation of the API, such as the `opentelemetry-metrics-sdk` gem. However, _libraries_ that produce telemetry data should depend only on `opentelemetry-metrics-api`, deferring the choise of concrete implementation to the application developer. +To collect and analyze telemetry data, _applications_ should also +install a concrete implementation of the API, such as the +`opentelemetry-metrics-sdk` gem. However, _libraries_ that produce +telemetry data should depend only on `opentelemetry-metrics-api`, +deferring the choice of concrete implementation to the application developer. This code is still under development and is not a complete implementation of the Metrics API. Until the code becomes stable, Metrics API functionality will live outside the `opentelemetry-api` library. diff --git a/metrics_api/test/opentelemetry/opentelemetry_test.rb b/metrics_api/test/opentelemetry/opentelemetry_test.rb index 81324228c..d7d768e47 100644 --- a/metrics_api/test/opentelemetry/opentelemetry_test.rb +++ b/metrics_api/test/opentelemetry/opentelemetry_test.rb @@ -8,7 +8,7 @@ describe OpenTelemetry do after do - # TODO: After Metrics SDK is incoporated into OpenTelemetry SDK, move this + # TODO: After Metrics SDK is incorporated into OpenTelemetry SDK, move this # to OpenTelemetry::TestHelpers.reset_opentelemetry OpenTelemetry.instance_variable_set( :@meter_provider, diff --git a/propagator/b3/CHANGELOG.md b/propagator/b3/CHANGELOG.md index 96fb82deb..c58f37f92 100644 --- a/propagator/b3/CHANGELOG.md +++ b/propagator/b3/CHANGELOG.md @@ -24,7 +24,7 @@ ### v0.18.0 / 2021-05-21 -* ADDED: Updated API depedency for 1.0.0.rc1 +* ADDED: Updated API dependency for 1.0.0.rc1 ### v0.17.0 / 2021-04-22 diff --git a/propagator/jaeger/CHANGELOG.md b/propagator/jaeger/CHANGELOG.md index c70ff7dc6..b57549485 100644 --- a/propagator/jaeger/CHANGELOG.md +++ b/propagator/jaeger/CHANGELOG.md @@ -39,7 +39,7 @@ ### v0.18.0 / 2021-05-21 -* ADDED: Updated API depedency for 1.0.0.rc1 +* ADDED: Updated API dependency for 1.0.0.rc1 ### v0.17.0 / 2021-04-22 diff --git a/registry/CHANGELOG.md b/registry/CHANGELOG.md index e3f64d18a..0f9578da2 100644 --- a/registry/CHANGELOG.md +++ b/registry/CHANGELOG.md @@ -12,7 +12,7 @@ ### v0.2.0 / 2022-09-14 -* Bump minimum API version depedency to 1.1 +* Bump minimum API version dependency to 1.1 ### v0.1.0 / 2022-04-11 diff --git a/registry/lib/opentelemetry/instrumentation/registry.rb b/registry/lib/opentelemetry/instrumentation/registry.rb index e3414e71c..4fa21526b 100644 --- a/registry/lib/opentelemetry/instrumentation/registry.rb +++ b/registry/lib/opentelemetry/instrumentation/registry.rb @@ -9,7 +9,7 @@ module Instrumentation # The instrumentation Registry contains information about instrumentation # available and facilitates discovery, installation and # configuration. This functionality is primarily useful for SDK - # implementors. + # implementers. class Registry def initialize @lock = Mutex.new diff --git a/sdk/README.md b/sdk/README.md index 1d10475c2..97da0a988 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -12,7 +12,13 @@ OpenTelemetry provides a single set of APIs, libraries, agents, and collector se The `opentelemetry-sdk` gem provides the reference implementation of the OpenTelemetry Ruby interfaces defined in the `opentelemetry-api` gem. That is, it includes the *functionality* needed to collect, analyze, and export telemetry data produced using the API. -Generally, Ruby *applications* should install `opentelemetry-sdk` (or other concrete implementation of the OpenTelemetry API). Using the SDK, an application can configure how it wants telemetry data to be handled, including which data should be persisted, how it should be formatted, and where it should be recorded or exported. However, *libraries* that produce telemetry data should generally depend only on `opentelemetry-api`, deferring the choise of concrete implementation to the application developer. +Generally, Ruby *applications* should install `opentelemetry-sdk` (or +other concrete implementation of the OpenTelemetry API). Using the SDK, +an application can configure how it wants telemetry data to be handled, +including which data should be persisted, how it should be formatted, +and where it should be recorded or exported. However, *libraries* that +produce telemetry data should generally depend only on +`opentelemetry-api`, deferring the choice of concrete implementation to the application developer. ## How do I get started? diff --git a/sdk/lib/opentelemetry/sdk/configurator.rb b/sdk/lib/opentelemetry/sdk/configurator.rb index 1aa918a4c..ae1bbaf07 100644 --- a/sdk/lib/opentelemetry/sdk/configurator.rb +++ b/sdk/lib/opentelemetry/sdk/configurator.rb @@ -90,7 +90,7 @@ def service_version=(service_version) ) end - # Install an instrumentation with specificied optional +config+. + # Install an instrumentation with specified optional +config+. # Use can be called multiple times to install multiple instrumentation. # Only +use+ or +use_all+, but not both when installing # instrumentation. A call to +use_all+ after +use+ will result in an diff --git a/sdk/opentelemetry-sdk.gemspec b/sdk/opentelemetry-sdk.gemspec index 0adc96fdf..de7edca8a 100644 --- a/sdk/opentelemetry-sdk.gemspec +++ b/sdk/opentelemetry-sdk.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |spec| # This is an intentionally loose dependency, since we want to be able to # release new versions of opentelemetry-semantic_conventions without requiring - # a new SDK release. The requirements of the SDK have been satisifed since the + # a new SDK release. The requirements of the SDK have been satisfied since the # initial release of opentelemetry-semantic_conventions, so we feel it is safe. spec.add_dependency 'opentelemetry-semantic_conventions' diff --git a/sdk/test/opentelemetry/sdk/configurator_test.rb b/sdk/test/opentelemetry/sdk/configurator_test.rb index 50e6c18ef..b363695b1 100644 --- a/sdk/test/opentelemetry/sdk/configurator_test.rb +++ b/sdk/test/opentelemetry/sdk/configurator_test.rb @@ -292,7 +292,7 @@ ) end - it 'accepts comma separated list with preceeding or trailing spaces as an environment variable' do + it 'accepts comma separated list with preceding or trailing spaces as an environment variable' do OpenTelemetry::TestHelpers.with_env('OTEL_TRACES_EXPORTER' => 'zipkin , console') do configurator.configure end diff --git a/sdk/test/opentelemetry/sdk/trace/export/in_memory_span_exporter_test.rb b/sdk/test/opentelemetry/sdk/trace/export/in_memory_span_exporter_test.rb index 0d00255b5..0a3da217a 100644 --- a/sdk/test/opentelemetry/sdk/trace/export/in_memory_span_exporter_test.rb +++ b/sdk/test/opentelemetry/sdk/trace/export/in_memory_span_exporter_test.rb @@ -23,7 +23,7 @@ end it 'accepts an Enumerable of SpanDatas as argument to #export' do - # An anonymous Struct serves as a handy implementor of Enumerable + # An anonymous Struct serves as a handy implementer of Enumerable enumerable = Struct.new(:span_data1, :span_data2).new enumerable.span_data1 = span_data1 enumerable.span_data2 = span_data2 diff --git a/sdk/test/opentelemetry/sdk/trace/span_limits_test.rb b/sdk/test/opentelemetry/sdk/trace/span_limits_test.rb index b8d421ea4..57aeb65e0 100644 --- a/sdk/test/opentelemetry/sdk/trace/span_limits_test.rb +++ b/sdk/test/opentelemetry/sdk/trace/span_limits_test.rb @@ -20,7 +20,7 @@ _(span_limits.link_attribute_count_limit).must_equal 128 end - it 'prioritizes specific environment varibles for attribute value length limits' do + it 'prioritizes specific environment variables for attribute value length limits' do OpenTelemetry::TestHelpers.with_env('OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT' => '35', 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT' => '33', 'OTEL_EVENT_ATTRIBUTE_VALUE_LENGTH_LIMIT' => '32') do diff --git a/semantic_conventions/lib/opentelemetry/semantic_conventions/resource.rb b/semantic_conventions/lib/opentelemetry/semantic_conventions/resource.rb index 912946f71..39e8efeef 100644 --- a/semantic_conventions/lib/opentelemetry/semantic_conventions/resource.rb +++ b/semantic_conventions/lib/opentelemetry/semantic_conventions/resource.rb @@ -104,7 +104,7 @@ module Resource # # * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). # Take care not to use the "invoked ARN" directly but replace any - # [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple + # [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invocable with multiple # different aliases. # * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) # * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id). From f4bb5acd6e4854e2172967828810ef472deefad6 Mon Sep 17 00:00:00 2001 From: dmathieu <42@dmathieu.com> Date: Wed, 31 Jul 2024 13:20:59 +0200 Subject: [PATCH 3/3] add codespell github action --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e89f44a9..ee44e64e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -207,3 +207,9 @@ jobs: with: gem: "${{ matrix.gem }}" ruby: "truffleruby" + + codespell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: make codespell