Skip to content

Commit d1193ac

Browse files
Bandit instrumentation (#357)
* Bandit instrumentation * Delete old test * update otel http * Enable custom header extraction opts * Use jason for otp < 27 * Extract exception status code * Delete inspect * Update opentelemetry_bandit.ex * Update opentelemetry_bandit.ex * http2 fixes * bump semconv * update deps * Remove override * Add override back for the moment * Update deps * Convert opt-in attrs to plain list * Update instrumentation/opentelemetry_bandit/lib/opentelemetry_bandit.ex Co-authored-by: Greg Mefford <[email protected]> * Update instrumentation/opentelemetry_bandit/lib/opentelemetry_bandit.ex Co-authored-by: Greg Mefford <[email protected]> * Typo and format * unused value * Massage handler parameters * Assume protocols on http1 struct won't change * Break headers docs to subsection * Mark version as an rc * Dialyzer --------- Co-authored-by: Greg Mefford <[email protected]>
1 parent 0b242c8 commit d1193ac

File tree

6 files changed

+937
-362
lines changed

6 files changed

+937
-362
lines changed

.github/workflows/elixir.yml

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,47 @@ jobs:
2727
matrixStringifiedObject="$(jq -c . .github/elixir-test-matrix.json)"
2828
echo "matrix=$matrixStringifiedObject" >> $GITHUB_OUTPUT
2929
30+
opentelemetry-bandit:
31+
needs: [test-matrix]
32+
if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_bandit'))
33+
env:
34+
app: "opentelemetry_bandit"
35+
defaults:
36+
run:
37+
working-directory: instrumentation/${{ env.app }}
38+
runs-on: ubuntu-24.04
39+
name: Opentelemetry Bandit test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
40+
strategy:
41+
fail-fast: false
42+
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: erlef/setup-beam@v1
46+
with:
47+
version-type: strict
48+
otp-version: ${{ matrix.otp_version }}
49+
elixir-version: ${{ matrix.elixir_version }}
50+
rebar3-version: ${{ matrix.rebar3_version }}
51+
- name: Cache
52+
uses: actions/cache@v4
53+
with:
54+
path: |
55+
~/deps
56+
~/_build
57+
key: ${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-v3-${{ hashFiles('**/mix.lock') }}
58+
- name: Fetch deps
59+
if: steps.deps-cache.outputs.cache-hit != 'true'
60+
run: mix deps.get
61+
- name: Compile project
62+
run: mix compile --warnings-as-errors
63+
- name: Check formatting
64+
run: mix format --check-formatted
65+
if: matrix.check_formatted
66+
- name: dialyzer
67+
run: mix dialyzer
68+
- name: Test
69+
run: mix test
70+
3071
opentelemetry-broadway:
3172
needs: [test-matrix]
3273
if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_broadway'))
@@ -367,45 +408,6 @@ jobs:
367408
- name: Test
368409
run: mix test
369410

370-
opentelemetry-bandit:
371-
needs: [test-matrix]
372-
if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_bandit'))
373-
env:
374-
app: "opentelemetry_bandit"
375-
defaults:
376-
run:
377-
working-directory: instrumentation/${{ env.app }}
378-
runs-on: ubuntu-24.04
379-
name: Opentelemetry Bandit test on Elixir ${{ matrix.elixir_version }} (OTP ${{ matrix.otp_version }})
380-
strategy:
381-
fail-fast: false
382-
matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }}
383-
steps:
384-
- uses: actions/checkout@v4
385-
- uses: erlef/setup-beam@v1
386-
with:
387-
version-type: strict
388-
otp-version: ${{ matrix.otp_version }}
389-
elixir-version: ${{ matrix.elixir_version }}
390-
rebar3-version: ${{ matrix.rebar3_version }}
391-
- name: Cache
392-
uses: actions/cache@v4
393-
with:
394-
path: |
395-
~/deps
396-
~/_build
397-
key: ${{ runner.os }}-build-${{ matrix.otp_version }}-${{ matrix.elixir_version }}-v3-${{ hashFiles('**/mix.lock') }}
398-
- name: Fetch deps
399-
if: steps.deps-cache.outputs.cache-hit != 'true'
400-
run: mix deps.get
401-
- name: Compile project
402-
run: mix compile --warnings-as-errors
403-
- name: Check formatting
404-
run: mix format --check-formatted
405-
if: matrix.check_formatted
406-
- name: Test
407-
run: mix test
408-
409411
opentelemetry-redix:
410412
needs: [test-matrix]
411413
if: (contains(github.event.pull_request.labels.*.name, 'elixir') && contains(github.event.pull_request.labels.*.name, 'opentelemetry_redix'))

instrumentation/opentelemetry_bandit/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ erl_crash.dump
2525
# Temporary files, for example, from tests.
2626
/tmp/
2727
.DS_Store
28+
29+
/priv/plts/*

0 commit comments

Comments
 (0)