Skip to content

Commit

Permalink
feat: support truffleruby (#1295)
Browse files Browse the repository at this point in the history
* feat: support truffleruby

Does what it says on the tin. By "support" I mean "turn it on in CI and
see if everything works."

The compatibility list is actually a bit better than JRuby!

Notably, I needed to exclude the OTLP exporter to make tests pass. I'm
not certain it's a real bug; I just haven't tried to fix those test
failures yet.

* fixup: exclude more grpc things

Co-authored-by: Francis Bogsanyi <[email protected]>
  • Loading branch information
ahayworth and fbogsany authored Aug 10, 2022
1 parent fcecf41 commit d3990c6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/actions/test_gem/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ runs:
echo "::set-output name=cache_key::mri"
if [[ "${{ inputs.ruby }}" == "jruby" ]]; then
echo "::set-output name=cache_key::jruby"
elif [[ "${{ inputs.ruby }}" == "truffleruby" ]]; then
echo "::set-output name=cache_key::truffleruby"
fi
echo "::set-output name=appraisals::false"
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ jobs:
with:
gem: "${{ matrix.gem }}"
ruby: "jruby"
- name: "Test truffleruby"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "${{ matrix.gem }}"
ruby: "truffleruby"

exporters:
strategy:
Expand Down Expand Up @@ -119,6 +125,23 @@ jobs:
with:
gem: "${{ matrix.gem }}"
ruby: "jruby"
- name: "Truffleruby Filter"
id: truffleruby_skip
shell: bash
run: |
echo "::set-output name=skip::false"
[[ "${{ matrix.gem }}" == "opentelemetry-exporter-otlp" ]] && echo "::set-output name=skip::true"
[[ "${{ matrix.gem }}" == "opentelemetry-exporter-otlp-common" ]] && echo "::set-output name=skip::true"
[[ "${{ matrix.gem }}" == "opentelemetry-exporter-otlp-http" ]] && echo "::set-output name=skip::true"
[[ "${{ matrix.gem }}" == "opentelemetry-exporter-otlp-grpc" ]] && echo "::set-output name=skip::true"
# This is essentially a bash script getting evaluated, so we need to return true or the whole job fails.
true
- name: "Test truffleruby"
if: "${{ matrix.os == 'ubuntu-latest' && steps.truffleruby_skip.outputs.skip == 'false' }}"
uses: ./.github/actions/test_gem
with:
gem: "${{ matrix.gem }}"
ruby: "truffleruby"

propagators:
strategy:
Expand Down Expand Up @@ -161,3 +184,9 @@ jobs:
with:
gem: "${{ matrix.gem }}"
ruby: "jruby"
- name: "Test truffleruby"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "${{ matrix.gem }}"
ruby: "truffleruby"
4 changes: 3 additions & 1 deletion website_docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ Manual instrumentation can be added using the [OpenTelemetry API][manual].
These instructions will explain how to set up automatic and manual instrumentation for a Ruby service.
In order to follow along, you will need:

- MRI Ruby >= `2.7`, or jruby >= `9.3.2.0`
- MRI Ruby >= `2.7`, jruby >= `9.3.2.0`, or truffleruby >= 22.1
- Docker Compose

> jruby only targets compatibility with MRI Ruby 2.6.8; which is EOL. This project does not officially support MRI Ruby 2.6.8, and provides jruby support on a best-effort basis until the jruby project supports compatibility with more modern Ruby runtimes.
> truffleruby is tested, but support is best-effort at this time.
### Installation

The first step is to add these gems to your Gemfile:
Expand Down

0 comments on commit d3990c6

Please sign in to comment.