Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
xuan-cao-swi authored Mar 27, 2024
2 parents bc161c7 + 40171ab commit 06176fc
Show file tree
Hide file tree
Showing 118 changed files with 3,137 additions and 445 deletions.
4 changes: 2 additions & 2 deletions .github/actions/test_gem/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ runs:
# ...but not for appraisals, sadly.
- name: Install Ruby ${{ inputs.ruby }} with dependencies
if: "${{ steps.setup.outputs.appraisals == 'false' }}"
uses: ruby/setup-ruby@v1.152.0
uses: ruby/setup-ruby@v1.165.1
with:
ruby-version: "${{ inputs.ruby }}"
working-directory: "${{ steps.setup.outputs.gem_dir }}"
Expand All @@ -69,7 +69,7 @@ runs:
# 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.152.0
uses: ruby/setup-ruby@v1.165.1
with:
ruby-version: "${{ inputs.ruby }}"
bundler: "latest"
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: "Test Ruby 3.3"
uses: ./.github/actions/test_gem
with:
gem: "${{ matrix.gem }}"
ruby: "3.3"
- name: "Test Ruby 3.2"
uses: ./.github/actions/test_gem
with:
Expand Down Expand Up @@ -77,6 +82,7 @@ jobs:
- opentelemetry-exporter-otlp-grpc
- opentelemetry-exporter-otlp-http
- opentelemetry-exporter-zipkin
- opentelemetry-exporter-otlp-metrics
os:
- ubuntu-latest
- macos-latest
Expand All @@ -91,6 +97,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: "Test Ruby 3.3"
uses: ./.github/actions/test_gem
with:
gem: "${{ matrix.gem }}"
ruby: "3.3"
- name: "Test Ruby 3.2"
uses: ./.github/actions/test_gem
with:
Expand Down Expand Up @@ -120,6 +131,7 @@ jobs:
[[ "${{ matrix.gem }}" == "opentelemetry-exporter-otlp-common" ]] && echo "skip=true" >> $GITHUB_OUTPUT
[[ "${{ matrix.gem }}" == "opentelemetry-exporter-otlp-http" ]] && echo "skip=true" >> $GITHUB_OUTPUT
[[ "${{ matrix.gem }}" == "opentelemetry-exporter-otlp-grpc" ]] && echo "skip=true" >> $GITHUB_OUTPUT
[[ "${{ matrix.gem }}" == "opentelemetry-exporter-otlp-metrics" ]] && echo "skip=true" >> $GITHUB_OUTPUT
# This is essentially a bash script getting evaluated, so we need to return true or the whole job fails.
true
- name: "Test JRuby"
Expand Down Expand Up @@ -158,6 +170,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: "Test Ruby 3.3"
uses: ./.github/actions/test_gem
with:
gem: "${{ matrix.gem }}"
ruby: "3.3"
- name: "Test Ruby 3.2"
uses: ./.github/actions/test_gem
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-hook-on-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1.165.1
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
uses: actions/checkout@v2
- name: Install Toys
run: "gem install --no-document toys"
run: "gem install --no-document toys -v 0.15.5"
- name: Process release request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-hook-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1.165.1
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
uses: actions/checkout@v2
- name: Install Toys
run: "gem install --no-document toys"
run: "gem install --no-document toys -v 0.15.5"
- name: Update open releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-perform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1.165.1
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
uses: actions/checkout@v2
- name: Install Toys
run: "gem install --no-document toys"
run: "gem install --no-document toys -v 0.15.5"
- name: Perform release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1.165.1
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
uses: actions/checkout@v2
- name: Install Toys
run: "gem install --no-document toys"
run: "gem install --no-document toys -v 0.15.5"
- name: Open release pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1.165.1
with:
ruby-version: ${{ env.ruby_version }}
- name: Checkout repo
uses: actions/checkout@v2
- name: Install Toys
run: "gem install --no-document toys"
run: "gem install --no-document toys -v 0.15.5"
- name: Retry release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v9
name: Clean up stale issues and PRs
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the `keep` label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot."
stale-issue-label: "stale"
exempt-issue-labels: "keep"
days-before-issue-stale: 30
days-before-issue-close: 30
stale-pr-message: "👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the `keep` label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot"
stale-pr-label: "stale"
exempt-pr-labels: "keep"
days-before-pr-stale: 30
days-before-pr-close: 30
3 changes: 2 additions & 1 deletion .toys/.toys.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
toys_version! ">= 0.14.5"
toys_version! ">= 0.15.5"

load_git remote: "https://github.com/dazuma/toys.git",
path: ".toys/release",
as: "release",
commit: "common-tools/v0.15.5.1",
update: 3600
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# https://help.github.com/en/articles/about-code-owners
#

* @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd
* @fbogsany @mwear @robertlaurin @dazuma @ericmustin @arielvalentin @ahayworth @plantfansam @robbkidd @kaylareopelle
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration for Ruby base image
ARG ALPINE_VERSION=3.10
ARG RUBY_VERSION=2.6.5
ARG ALPINE_VERSION=3.13
ARG RUBY_VERSION=3.0.0

FROM ruby:"${RUBY_VERSION}-alpine${ALPINE_VERSION}" as ruby

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Approvers ([@open-telemetry/ruby-approvers](https://github.com/orgs/open-telemet
- [Andrew Hayworth](https://github.com/ahayworth), Shopify
- [Sam Handler](https://github.com/plantfansam), Shopify
- [Robb Kidd](https://github.com/robbkidd), Honeycomb
- [Kayla Reopelle](https://github.com/kaylareopelle), New Relic

*Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#approver).*

Expand Down Expand Up @@ -66,7 +67,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[contrib-repo]: https://github.com/open-telemetry/opentelemetry-ruby-contrib
[contrib-instrumentations]: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation
[examples-github]: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/examples
[getting-started]: https://opentelemetry.io/docs/ruby/
[getting-started]: https://opentelemetry.io/docs/languages/ruby/
[issues-good-first-issue]: https://github.com/open-telemetry/opentelemetry-ruby/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[issues-help-wanted]: https://github.com/open-telemetry/opentelemetry-ruby/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace :each do
foreach_gem('bundle exec rake yard')
end

desc "Run rubocop in each gem"
task :rubocop do
foreach_gem('bundle exec rake rubocop')
end
Expand Down
23 changes: 1 addition & 22 deletions api/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
AllCops:
TargetRubyVersion: "3.0"
inherit_from: ../contrib/rubocop.yml

Lint/UnusedMethodArgument:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/LineLength:
Enabled: false
Metrics/MethodLength:
Max: 20
Metrics/ParameterLists:
Enabled: false
Naming/FileName:
Exclude:
- "lib/opentelemetry-api.rb"
Lint/MissingSuper:
Enabled: false
Lint/ConstantDefinitionInBlock:
Exclude:
- "test/**/*"
Style/StringConcatenation:
Exclude:
- "test/**/*"
Style/ModuleFunction:
Enabled: false
Style/ExplicitBlockArgument:
Enabled: false
8 changes: 8 additions & 0 deletions api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release History: opentelemetry-api

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

* FIXED: Replace Context stack on clear

### v1.2.4 / 2024-02-06

* FIXED: SystemStackError in Composite Text Map Propagator (#1590)

### v1.2.3 / 2023-09-18

* FIXED: Optimize span and trace ID generation
Expand Down
5 changes: 4 additions & 1 deletion api/lib/opentelemetry/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ def value(key)
current.value(key)
end

# Clears the fiber-local Context stack. This allocates a new array for the
# stack, which is important in some use-cases to avoid sharing the backing
# array between fibers.
def clear
stack.clear
Thread.current[STACK_KEY] = []
end

def empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def extract(carrier, context: Context.current, getter: Context::Propagation.text
# @return [Array<String>] a list of fields that will be used by this propagator.
def fields
injectors = @injectors || @propagators
injectors.flat_map(&fields).uniq
injectors.flat_map(&:fields).uniq
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion api/lib/opentelemetry/trace/trace_flags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class << self
# @param [Integer] flags 8-bit byte of bit flags
# @return [TraceFlags]
def from_byte(flags)
flags = 0 unless flags & ~0xFF == 0 # rubocop:disable Style/NumericPredicate
flags = 0 unless flags & ~0xFF == 0

new(flags)
end
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.3'
VERSION = '1.2.5'
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def inject(carrier, context:, setter: nil)
end
carrier
end

def fields
[@key]
end
end

class TestExtractor
Expand Down Expand Up @@ -124,6 +128,12 @@ def get(carrier, key)
_(context['k3']).must_equal('V3')
end
end

describe '#fields' do
it 'returns all fields from injectors' do
_(propagator.fields).must_equal(%w[k1 k2 k3])
end
end
end

describe 'with buggy injectors / extractors' do
Expand Down
25 changes: 1 addition & 24 deletions common/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
AllCops:
TargetRubyVersion: '3.0'
NewCops: disable
SuggestExtensions: false
inherit_from: ../contrib/rubocop.yml

Bundler/OrderedGems:
Exclude:
- gemfiles/**/*
Lint/UnusedMethodArgument:
Enabled: false
Lint/MissingSuper:
Enabled: false
Lint/ConstantDefinitionInBlock:
Exclude:
- "test/**/*"
Style/StringConcatenation:
Exclude:
- "test/**/*"
Metrics/AbcSize:
Enabled: false
Layout/LineLength:
Enabled: false
Metrics/MethodLength:
Max: 20
Metrics/ParameterLists:
Enabled: false
Style/FrozenStringLiteralComment:
Exclude:
- gemfiles/**/*
Style/ModuleFunction:
Enabled: false
Style/StringLiterals:
Exclude:
- gemfiles/**/*
Expand Down
4 changes: 4 additions & 0 deletions common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History: opentelemetry-common

### v0.20.1 / 2024-02-06

* FIXED: Patch the issue for frozen string on ruby < 3.0 with string interpolation

### v0.20.0 / 2023-06-08

* BREAKING CHANGE: Remove support for EoL Ruby 2.7
Expand Down
2 changes: 1 addition & 1 deletion common/lib/opentelemetry/common/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

module OpenTelemetry
module Common
VERSION = '0.20.0'
VERSION = '0.20.1'
end
end
Loading

0 comments on commit 06176fc

Please sign in to comment.