2021-09-12 19:49:24 +00:00
|
|
|
name: Elixir
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
types: [opened, reopened, synchronize, labeled]
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
|
|
|
|
jobs:
|
2021-09-13 00:49:05 +00:00
|
|
|
test-matrix:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Read file
|
|
|
|
id: set-matrix
|
|
|
|
run: |
|
2021-12-28 21:14:26 +00:00
|
|
|
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\"]}"
|
2021-09-13 00:49:05 +00:00
|
|
|
echo "::set-output name=matrix::$matrixStringifiedObject"
|
2021-10-08 21:38:18 +00:00
|
|
|
opentelemetry-ecto:
|
|
|
|
needs: [test-matrix]
|
|
|
|
if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_ecto'))
|
|
|
|
env:
|
|
|
|
app: 'opentelemetry_ecto'
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: instrumentation/${{ env.app }}
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
name: Opentelemetry Ecto test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
|
|
|
|
services:
|
|
|
|
postgres:
|
2021-10-14 03:11:26 +00:00
|
|
|
image: circleci/postgres:13.3-ram
|
2021-10-08 21:38:18 +00:00
|
|
|
ports: ['5432:5432']
|
|
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: postgres
|
2021-10-14 03:11:26 +00:00
|
|
|
POSTGRES_PASSWORD: postgres
|
2021-10-08 21:38:18 +00:00
|
|
|
POSTGRES_DB: opentelemetry_ecto_test
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: erlef/setup-beam@v1
|
|
|
|
with:
|
|
|
|
otp-version: ${{ matrix.otp_version }}
|
|
|
|
elixir-version: ${{ matrix.elixir_version }}
|
|
|
|
rebar3-version: ${{ matrix.rebar3_version }}
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
2021-12-28 21:14:26 +00:00
|
|
|
~/deps
|
|
|
|
~/_build
|
|
|
|
key: ${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-v3-${{ hashFiles('**/mix.lock') }}
|
2021-10-08 21:38:18 +00:00
|
|
|
- name: Fetch deps
|
|
|
|
if: steps.deps-cache.outputs.cache-hit != 'true'
|
|
|
|
run: mix deps.get
|
|
|
|
- name: Compile project
|
|
|
|
run: mix compile --warnings-as-errors
|
|
|
|
- name: Check formatting
|
|
|
|
run: mix format --check-formatted
|
|
|
|
- name: Test
|
|
|
|
run: mix test
|
|
|
|
|
2021-09-12 19:49:24 +00:00
|
|
|
opentelemetry-phoenix:
|
2021-09-13 00:49:05 +00:00
|
|
|
needs: [test-matrix]
|
2021-09-13 01:27:27 +00:00
|
|
|
if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_phoenix'))
|
2021-09-13 00:49:05 +00:00
|
|
|
env:
|
|
|
|
app: 'opentelemetry_phoenix'
|
2021-09-12 19:49:24 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: instrumentation/${{ env.app }}
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
name: Opentelemetry Phoenix test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
2021-09-13 00:49:05 +00:00
|
|
|
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
|
2021-09-12 19:49:24 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: erlef/setup-beam@v1
|
|
|
|
with:
|
|
|
|
otp-version: ${{ matrix.otp_version }}
|
|
|
|
elixir-version: ${{ matrix.elixir_version }}
|
|
|
|
rebar3-version: ${{ matrix.rebar3_version }}
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
2021-12-28 21:14:26 +00:00
|
|
|
~/deps
|
|
|
|
~/_build
|
|
|
|
key: ${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-v3-${{ hashFiles('**/mix.lock') }}
|
2021-09-12 19:49:24 +00:00
|
|
|
- name: Fetch deps
|
|
|
|
if: steps.deps-cache.outputs.cache-hit != 'true'
|
|
|
|
run: mix deps.get
|
|
|
|
- name: Compile project
|
|
|
|
run: mix compile --warnings-as-errors
|
|
|
|
- name: Check formatting
|
|
|
|
run: mix format --check-formatted
|
|
|
|
- name: Test
|
2022-01-04 21:39:19 +00:00
|
|
|
run: mix test
|
|
|
|
|
|
|
|
opentelemetry-redix:
|
|
|
|
needs: [test-matrix]
|
|
|
|
if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_redix'))
|
|
|
|
env:
|
|
|
|
app: 'opentelemetry_redix'
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: instrumentation/${{ env.app }}
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
name: Opentelemetry Redix test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
|
|
|
|
services:
|
|
|
|
redis:
|
|
|
|
image: redis:alpine
|
|
|
|
ports: ['6379:6379']
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: erlef/setup-beam@v1
|
|
|
|
with:
|
|
|
|
otp-version: ${{ matrix.otp_version }}
|
|
|
|
elixir-version: ${{ matrix.elixir_version }}
|
|
|
|
rebar3-version: ${{ matrix.rebar3_version }}
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
2022-01-05 05:34:06 +00:00
|
|
|
~/deps
|
|
|
|
~/_build
|
|
|
|
key: ${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-v3-${{ hashFiles('**/mix.lock') }}
|
2022-01-04 21:39:19 +00:00
|
|
|
- name: Fetch deps
|
|
|
|
if: steps.deps-cache.outputs.cache-hit != 'true'
|
|
|
|
run: mix deps.get
|
|
|
|
- name: Compile project
|
|
|
|
run: mix compile --warnings-as-errors
|
|
|
|
- name: Check formatting
|
|
|
|
run: mix format --check-formatted
|
|
|
|
- name: Test
|
2021-09-12 19:49:24 +00:00
|
|
|
run: mix test
|
2021-11-28 01:33:47 +00:00
|
|
|
|
|
|
|
opentelemetry-telemetry:
|
|
|
|
needs: [test-matrix]
|
|
|
|
if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_telemetry'))
|
|
|
|
env:
|
|
|
|
app: 'opentelemetry_telemetry'
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: utilities/${{ env.app }}
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
name: Opentelemetry Telemetry test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: erlef/setup-beam@v1
|
|
|
|
with:
|
|
|
|
otp-version: ${{ matrix.otp_version }}
|
|
|
|
elixir-version: ${{ matrix.elixir_version }}
|
|
|
|
rebar3-version: ${{ matrix.rebar3_version }}
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
2021-12-28 21:14:26 +00:00
|
|
|
~/deps
|
|
|
|
~/_build
|
|
|
|
key: ${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-v3-${{ hashFiles('**/mix.lock') }}
|
2021-11-28 01:33:47 +00:00
|
|
|
- name: Fetch deps
|
|
|
|
if: steps.deps-cache.outputs.cache-hit != 'true'
|
|
|
|
run: mix deps.get
|
|
|
|
- name: Compile project
|
|
|
|
run: mix compile --warnings-as-errors
|
|
|
|
- name: Check formatting
|
|
|
|
run: mix format --check-formatted
|
|
|
|
- name: Test
|
|
|
|
run: mix test
|
Add opentelemetry integration to Oban (#6)
By default a new trace is automatically started when a job is processed
by monitoring these events:
* `[:oban, :job, :start]` — at the point a job is fetched from the database and will execute
* `[:oban, :job, :stop]` — after a job succeeds and the success is recorded in the database
* `[:oban, :job, :exception]` — after a job fails and the failure is recorded in the database
To also record a span when a job is created and to link traces together
`Oban.insert/2` has to be replaced by `OpentelemetryOban.insert/2`.
Before:
```elixir
%{id: 1, in_the: "business", of_doing: "business"}
|> MyApp.Business.new()
|> Oban.insert()
```
After:
```elixir
%{id: 1, in_the: "business", of_doing: "business"}
|> MyApp.Business.new()
|> OpentelemetryOban.insert()
```
Co-authored-by: Tristan Sloughter <t@crashfast.com>
2021-12-08 15:41:36 +00:00
|
|
|
|
|
|
|
opentelemetry-oban:
|
|
|
|
needs: [test-matrix]
|
|
|
|
if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_oban'))
|
|
|
|
env:
|
|
|
|
app: 'opentelemetry_oban'
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: instrumentation/${{ env.app }}
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
name: Opentelemetry Oban test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: circleci/postgres:13.3-ram
|
|
|
|
ports: ['5432:5432']
|
|
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
POSTGRES_DB: opentelemetry_oban_test
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: erlef/setup-beam@v1
|
|
|
|
with:
|
|
|
|
otp-version: ${{ matrix.otp_version }}
|
|
|
|
elixir-version: ${{ matrix.elixir_version }}
|
|
|
|
rebar3-version: ${{ matrix.rebar3_version }}
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
2021-12-28 21:14:26 +00:00
|
|
|
~/deps
|
|
|
|
~/_build
|
|
|
|
key: ${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-v3-${{ hashFiles('**/mix.lock') }}
|
Add opentelemetry integration to Oban (#6)
By default a new trace is automatically started when a job is processed
by monitoring these events:
* `[:oban, :job, :start]` — at the point a job is fetched from the database and will execute
* `[:oban, :job, :stop]` — after a job succeeds and the success is recorded in the database
* `[:oban, :job, :exception]` — after a job fails and the failure is recorded in the database
To also record a span when a job is created and to link traces together
`Oban.insert/2` has to be replaced by `OpentelemetryOban.insert/2`.
Before:
```elixir
%{id: 1, in_the: "business", of_doing: "business"}
|> MyApp.Business.new()
|> Oban.insert()
```
After:
```elixir
%{id: 1, in_the: "business", of_doing: "business"}
|> MyApp.Business.new()
|> OpentelemetryOban.insert()
```
Co-authored-by: Tristan Sloughter <t@crashfast.com>
2021-12-08 15:41:36 +00:00
|
|
|
- name: Fetch deps
|
|
|
|
if: steps.deps-cache.outputs.cache-hit != 'true'
|
|
|
|
run: mix deps.get
|
|
|
|
- name: Compile project
|
|
|
|
run: mix compile --warnings-as-errors
|
|
|
|
- name: Check formatting
|
|
|
|
run: mix format --check-formatted
|
|
|
|
- name: Test
|
|
|
|
run: mix test
|