Fix CI errors, update GHA deps, update versions (#125)

* Fix CI errors, update GHA deps, update versions

* output syntax

* remove OTP 22 tests

* set concurrency to cancel in progress

* whitespace

* incompatible vsns and failed test

* Try pulling excludes out

* Escaping

* Just drop < 1.13 until this can move to workflows

* quote
This commit is contained in:
Bryan Naegele 2022-11-15 16:22:28 -07:00 committed by GitHub
parent a71bf882cc
commit 0e6a776ffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 121 additions and 94 deletions

View File

@ -1,3 +0,0 @@
[
inputs: ["{mix,.formatter}.exs", "{examples,instrumentation,propagators,test}/**/*.{ex,exs}"]
]

View File

@ -1,18 +1,29 @@
{ {
"otp_version": [ "otp_version": [
"24.2", "25.1.2",
"23.3.4.10", "24.3.4.6",
"22.3.4.24" "23.3.4.18"
], ],
"elixir_version": [ "elixir_version": [
"1.13.1", "1.14.2",
"1.13.4",
"1.12.3", "1.12.3",
"1.11.4" "1.11.4"
], ],
"rebar3_version": [ "rebar3_version": [
"3.16.1" "3.20"
], ],
"os": [ "os": [
"ubuntu-18.04" "ubuntu-20.04"
],
"exclude": [
{
"elixir_version": "1.11.4",
"erlang_version": "25.1.2"
},
{
"elixir_version": "1.12.3",
"erlang_version": "25.1.2"
}
] ]
} }

View File

@ -1,13 +1,13 @@
{ {
"otp_version": [ "otp_version": [
"24.2", "25.1.2",
"23.3.4.10", "24.3.4.6",
"22.3.4.24" "23.3.4.10"
], ],
"rebar3_version": [ "rebar3_version": [
"3.16.1" "3.20"
], ],
"os": [ "os": [
"ubuntu-18.04" "ubuntu-20.04"
] ]
} }

View File

@ -5,22 +5,28 @@ on:
branches: branches:
- 'main' - 'main'
types: [opened, reopened, synchronize, labeled] types: [opened, reopened, synchronize, labeled]
push: push:
branches: branches:
- 'main' - 'main'
concurrency:
group: ci-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs: jobs:
test-matrix: test-matrix:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }} matrix: ${{ steps.set-matrix.outputs.matrix }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Read file - name: Read file
id: set-matrix id: set-matrix
run: | run: |
matrixStringifiedObject="{\"otp_version\":[\"24.2\",\"23.3.4.10\",\"22.3.4.24\"],\"elixir_version\":[\"1.13.1\",\"1.12.3\",\"1.11.4\"],\"rebar3_version\":[\"3.16.1\"],\"os\":[\"ubuntu-18.04\"]}" matrixStringifiedObject="{\"otp_version\":[\"25.1.2\",\"24.3.4.6\",\"23.3.4.18\"],\"elixir_version\":[\"1.14.2\",\"1.13.4\"],\"rebar3_version\":[\"3.20\"],\"os\":[\"ubuntu-20.04\"]}"
echo "::set-output name=matrix::$matrixStringifiedObject" echo "matrix=$matrixStringifiedObject" >> $GITHUB_OUTPUT
echo "matrix_exclude="
opentelemetry-ecto: opentelemetry-ecto:
needs: [test-matrix] needs: [test-matrix]
if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_ecto')) if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_ecto'))
@ -29,7 +35,7 @@ jobs:
defaults: defaults:
run: run:
working-directory: instrumentation/${{ env.app }} working-directory: instrumentation/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry Ecto test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) name: Opentelemetry Ecto test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
strategy: strategy:
fail-fast: false fail-fast: false
@ -45,14 +51,14 @@ jobs:
POSTGRES_DB: opentelemetry_ecto_test POSTGRES_DB: opentelemetry_ecto_test
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir_version }} elixir-version: ${{ matrix.elixir_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/deps ~/deps
@ -76,20 +82,20 @@ jobs:
defaults: defaults:
run: run:
working-directory: instrumentation/${{ env.app }} working-directory: instrumentation/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry Phoenix test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) name: Opentelemetry Phoenix test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
strategy: strategy:
fail-fast: false fail-fast: false
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }} matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir_version }} elixir-version: ${{ matrix.elixir_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/deps ~/deps
@ -113,7 +119,7 @@ jobs:
defaults: defaults:
run: run:
working-directory: instrumentation/${{ env.app }} working-directory: instrumentation/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry Redix test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) name: Opentelemetry Redix test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
strategy: strategy:
fail-fast: false fail-fast: false
@ -123,14 +129,14 @@ jobs:
image: redis:alpine image: redis:alpine
ports: ['6379:6379'] ports: ['6379:6379']
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir_version }} elixir-version: ${{ matrix.elixir_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/deps ~/deps
@ -154,20 +160,20 @@ jobs:
defaults: defaults:
run: run:
working-directory: instrumentation/${{ env.app }} working-directory: instrumentation/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry Finch test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) name: Opentelemetry Finch test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
strategy: strategy:
fail-fast: false fail-fast: false
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }} matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir_version }} elixir-version: ${{ matrix.elixir_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/deps ~/deps
@ -191,20 +197,20 @@ jobs:
defaults: defaults:
run: run:
working-directory: utilities/${{ env.app }} working-directory: utilities/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry Telemetry test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) name: Opentelemetry Telemetry test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
strategy: strategy:
fail-fast: false fail-fast: false
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }} matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir_version }} elixir-version: ${{ matrix.elixir_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/deps ~/deps
@ -228,7 +234,7 @@ jobs:
defaults: defaults:
run: run:
working-directory: instrumentation/${{ env.app }} working-directory: instrumentation/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry Oban test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) name: Opentelemetry Oban test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
strategy: strategy:
fail-fast: false fail-fast: false
@ -243,14 +249,14 @@ jobs:
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: postgres
POSTGRES_DB: opentelemetry_oban_test POSTGRES_DB: opentelemetry_oban_test
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir_version }} elixir-version: ${{ matrix.elixir_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/deps ~/deps
@ -274,20 +280,20 @@ jobs:
defaults: defaults:
run: run:
working-directory: propagators/${{ env.app }} working-directory: propagators/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry Process Propagator test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) name: Opentelemetry Process Propagator test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
strategy: strategy:
fail-fast: false fail-fast: false
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }} matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir_version }} elixir-version: ${{ matrix.elixir_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/deps ~/deps
@ -311,20 +317,20 @@ jobs:
defaults: defaults:
run: run:
working-directory: instrumentation/${{ env.app }} working-directory: instrumentation/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry Tesla test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }}) name: Opentelemetry Tesla test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
strategy: strategy:
fail-fast: false fail-fast: false
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }} matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
elixir-version: ${{ matrix.elixir_version }} elixir-version: ${{ matrix.elixir_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/deps ~/deps

View File

@ -5,22 +5,27 @@ on:
branches: branches:
- 'main' - 'main'
types: [opened, reopened, synchronize, labeled] types: [opened, reopened, synchronize, labeled]
push: push:
branches: branches:
- 'main' - 'main'
concurrency:
group: ci-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs: jobs:
test-matrix: test-matrix:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }} matrix: ${{ steps.set-matrix.outputs.matrix }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Read file - name: Read file
id: set-matrix id: set-matrix
run: | run: |
matrixStringifiedObject="{\"otp_version\":[\"24.2\",\"23.3.4.10\",\"22.3.4.24\"],\"rebar3_version\":[\"3.16.1\"],\"os\":[\"ubuntu-18.04\"]}" matrixStringifiedObject="{\"otp_version\":[\"25.1.2\",\"24.3.4.6\",\"23.3.4.10\"],\"rebar3_version\":[\"3.20\"],\"os\":[\"ubuntu-20.04\"]}"
echo "::set-output name=matrix::$matrixStringifiedObject" echo "matrix=$matrixStringifiedObject" >> $GITHUB_OUTPUT
opentelemetry-cowboy: opentelemetry-cowboy:
needs: [test-matrix] needs: [test-matrix]
if: (contains(github.event.pull_request.labels.*.name, 'erlang') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_cowboy')) if: (contains(github.event.pull_request.labels.*.name, 'erlang') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_cowboy'))
@ -29,19 +34,19 @@ jobs:
defaults: defaults:
run: run:
working-directory: instrumentation/${{ env.app }} working-directory: instrumentation/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry Cowboy test on OTP ${{ matrix.otp_version }} with Rebar3 ${{ matrix.rebar3_version }} name: Opentelemetry Cowboy test on OTP ${{ matrix.otp_version }} with Rebar3 ${{ matrix.rebar3_version }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }} matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/_build ~/_build
@ -60,19 +65,19 @@ jobs:
defaults: defaults:
run: run:
working-directory: utilities/${{ env.app }} working-directory: utilities/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry Telemetry test on OTP ${{ matrix.otp_version }} with Rebar3 ${{ matrix.rebar3_version }} name: Opentelemetry Telemetry test on OTP ${{ matrix.otp_version }} with Rebar3 ${{ matrix.rebar3_version }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }} matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/_build ~/_build
@ -91,19 +96,19 @@ jobs:
defaults: defaults:
run: run:
working-directory: utilities/${{ env.app }} working-directory: utilities/${{ env.app }}
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
name: Opentelemetry AWS X-Ray test on OTP ${{ matrix.otp_version }} with Rebar3 ${{ matrix.rebar3_version }} name: Opentelemetry AWS X-Ray test on OTP ${{ matrix.otp_version }} with Rebar3 ${{ matrix.rebar3_version }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }} matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
with: with:
otp-version: ${{ matrix.otp_version }} otp-version: ${{ matrix.otp_version }}
rebar3-version: ${{ matrix.rebar3_version }} rebar3-version: ${{ matrix.rebar3_version }}
- name: Cache - name: Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/_build ~/_build

View File

@ -54,7 +54,7 @@ defmodule OpentelemetryFinch do
"net.peer.port": meta.request.port, "net.peer.port": meta.request.port,
"http.target": meta.request.path, "http.target": meta.request.path,
"http.method": meta.request.method, "http.method": meta.request.method,
"http.status_code": status, "http.status_code": status
} }
s = s =
@ -65,7 +65,10 @@ defmodule OpentelemetryFinch do
}) })
if meta.result |> elem(0) == :error do if meta.result |> elem(0) == :error do
OpenTelemetry.Span.set_status(s, OpenTelemetry.status(:error, format_error(meta.result |> elem(1)))) OpenTelemetry.Span.set_status(
s,
OpenTelemetry.status(:error, format_error(meta.result |> elem(1)))
)
end end
OpenTelemetry.Span.end_span(s) OpenTelemetry.Span.end_span(s)

View File

@ -0,0 +1,4 @@
# Used by "mix format"
[
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]

View File

@ -139,7 +139,8 @@ defmodule Tesla.Middleware.OpenTelemetryTest do
def client(url) do def client(url) do
middleware = [ middleware = [
{Tesla.Middleware.BaseUrl, url}, {Tesla.Middleware.BaseUrl, url},
{Tesla.Middleware.OpenTelemetry, span_name: fn env -> {Tesla.Middleware.OpenTelemetry,
span_name: fn env ->
"#{String.upcase(to_string(env.method))} potato" "#{String.upcase(to_string(env.method))} potato"
end}, end},
Tesla.Middleware.PathParams Tesla.Middleware.PathParams