Skip to content

Commit

Permalink
Merge branch 'main' into update-configuration-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylareopelle committed Aug 28, 2024
2 parents 8ec788b + a217e9a commit 6d42d46
Show file tree
Hide file tree
Showing 119 changed files with 2,952 additions and 665 deletions.
2 changes: 2 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ot
te
10 changes: 10 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -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 =
8 changes: 4 additions & 4 deletions .github/actions/test_gem/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ runs:
# ...but not for appraisals, sadly.
- name: Install Ruby ${{ inputs.ruby }} with dependencies
if: "${{ steps.setup.outputs.appraisals == 'false' }}"
uses: ruby/setup-ruby@v1.179.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: "${{ inputs.ruby }}"
working-directory: "${{ steps.setup.outputs.gem_dir }}"
bundler: "2.5.10"
bundler: "2.5.17"
bundler-cache: true
cache-version: "v1-${{ steps.setup.outputs.cache_key }}"

# If we're using appraisals, do it all manually.
- name: Install Ruby ${{ inputs.ruby }} without dependencies
if: "${{ steps.setup.outputs.appraisals == 'true' }}"
uses: ruby/setup-ruby@v1.179.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: "${{ inputs.ruby }}"
bundler: "2.5.10"
bundler: "2.5.17"
working-directory: "${{ steps.setup.outputs.gem_dir }}"
- name: Install dependencies and generate appraisals
if: "${{ steps.setup.outputs.appraisals == 'true' }}"
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request
cancel-in-progress: true # Cancel any previous runs of this workflow

jobs:
base:
strategy:
Expand All @@ -18,6 +22,7 @@ jobs:
- opentelemetry-api
- opentelemetry-common
- opentelemetry-logs-api
- opentelemetry-logs-sdk
- opentelemetry-metrics-api
- opentelemetry-metrics-sdk
- opentelemetry-registry
Expand Down Expand Up @@ -207,3 +212,9 @@ jobs:
with:
gem: "${{ matrix.gem }}"
ruby: "truffleruby"

codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make codespell
2 changes: 1 addition & 1 deletion .github/workflows/release-hook-on-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.179.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-hook-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.179.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-perform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.179.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/release-request-weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Open release request - Weekly

on:
schedule:
- cron: "0 15 * * 2"

jobs:
release-request:
if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby' }}
env:
ruby_version: "3.0"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/[email protected]
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Toys
run: "gem install --no-document toys -v 0.15.5"
- name: Open release pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
toys release request --yes --verbose \
"--release-ref=${{ github.ref }}" \
< /dev/null
2 changes: 1 addition & 1 deletion .github/workflows/release-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.179.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1.179.0
uses: ruby/setup-ruby@v1.190.0
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
stale:

if: ${{ github.repository == 'open-telemetry/opentelemetry-ruby' }}
runs-on: ubuntu-latest

steps:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@
# rbenv configuration
.ruby-version

# Python virtual env for codespell
venv

tags
14 changes: 14 additions & 0 deletions .toys/.data/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ gems:
directory: exporter/otlp
version_constant: [OpenTelemetry, Exporter, OTLP, VERSION]

- name: opentelemetry-exporter-otlp-metrics
directory: exporter/otlp-metrics
version_constant: [OpenTelemetry, Exporter, OTLP, Metrics, VERSION]

- name: opentelemetry-exporter-zipkin
directory: exporter/zipkin
version_constant: [OpenTelemetry, Exporter, Zipkin, VERSION]
Expand All @@ -84,3 +88,13 @@ gems:
directory: test_helpers
version_rb_path: lib/opentelemetry/test_helpers/version.rb
version_constant: [OpenTelemetry, TestHelpers, VERSION]

- name: opentelemetry-metrics-api
directory: metrics_api
version_rb_path: lib/opentelemetry/metrics/version.rb
version_constant: [OpenTelemetry, Metrics, VERSION]

- name: opentelemetry-metrics-sdk
directory: metrics_sdk
version_rb_path: lib/opentelemetry/sdk/metrics/version.rb
version_constant: [OpenTelemetry, SDK, Metrics, VERSION]
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 9 additions & 1 deletion api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release History: opentelemetry-api

### v1.4.0 / 2024-08-27

* ADDED: Include backtrace first line for better debug info

### v1.3.0 / 2024-07-24

* ADDED: Add add_link to span api/sdk

### v1.2.5 / 2024-02-20

* FIXED: Replace Context stack on clear
Expand Down Expand Up @@ -67,7 +75,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
Expand Down
5 changes: 4 additions & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
2 changes: 1 addition & 1 deletion api/lib/opentelemetry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def logger
# @return [Callable] configured error handler or a default that logs the
# exception and message at ERROR level.
def error_handler
@error_handler ||= ->(exception: nil, message: nil) { logger.error("OpenTelemetry error: #{[message, exception&.message].compact.join(' - ')}") }
@error_handler ||= ->(exception: nil, message: nil) { logger.error("OpenTelemetry error: #{[message, exception&.message, exception&.backtrace&.first].compact.join(' - ')}") }
end

# Handles an error by calling the configured error_handler.
Expand Down
2 changes: 1 addition & 1 deletion api/lib/opentelemetry/baggage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/lib/opentelemetry/baggage/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/lib/opentelemetry/trace/propagation/trace_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/lib/opentelemetry/trace/span_kind.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/lib/opentelemetry/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

module OpenTelemetry
## Current OpenTelemetry version
VERSION = '1.2.5'
VERSION = '1.4.0'
end
2 changes: 1 addition & 1 deletion api/opentelemetry-api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-test-helpers'
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rubocop', '~> 1.30'
spec.add_development_dependency 'rubocop', '~> 1.65'
spec.add_development_dependency 'simplecov', '~> 0.17'
spec.add_development_dependency 'yard', '~> 0.9'
spec.add_development_dependency 'yard-doctest', '~> 0.1.6'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 3 additions & 1 deletion api/test/opentelemetry_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ def error(message)
rescue StandardError => e
OpenTelemetry.handle_error(exception: e, message: 'hi')
end
_(OpenTelemetry.logger.messages).must_equal ['OpenTelemetry error: foo', 'OpenTelemetry error: hell', 'OpenTelemetry error: hi - bar']
_(OpenTelemetry.logger.messages[0]).must_equal('OpenTelemetry error: foo')
_(OpenTelemetry.logger.messages[1]).must_match(%r{OpenTelemetry error: hell - .+/opentelemetry_test\.rb:\d+:in .+'})
_(OpenTelemetry.logger.messages[2]).must_match(%r{OpenTelemetry error: hi - bar - .+/opentelemetry_test\.rb:\d+:in .+'})
end

it 'calls user specified error handler' do
Expand Down
2 changes: 1 addition & 1 deletion common/opentelemetry-common.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-test-helpers'
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rubocop', '~> 1.3'
spec.add_development_dependency 'rubocop', '~> 1.65'
spec.add_development_dependency 'simplecov', '~> 0.17'
spec.add_development_dependency 'yard', '~> 0.9'
spec.add_development_dependency 'yard-doctest', '~> 0.1.6'
Expand Down
Loading

0 comments on commit 6d42d46

Please sign in to comment.