From e74fc96c3325d1d1b372bc4a36b311dbae48183d Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Wed, 16 Oct 2024 10:47:55 -0700 Subject: [PATCH] test: debugging stuff --- .github/actions/test_gem/action.yml | 7 +- .github/workflows/ci-markdown-link.yml | 28 +- .github/workflows/ci-markdownlint.yml | 34 +- .github/workflows/ci.yml | 348 +++++++++--------- .../exporter/otlp/metrics/metrics_exporter.rb | 4 + .../otlp/metrics/metrics_exporter_test.rb | 7 +- 6 files changed, 220 insertions(+), 208 deletions(-) diff --git a/.github/actions/test_gem/action.yml b/.github/actions/test_gem/action.yml index 009270fd8..b19dbd968 100644 --- a/.github/actions/test_gem/action.yml +++ b/.github/actions/test_gem/action.yml @@ -96,7 +96,12 @@ runs: echo "::endgroup::" done else - bundle exec rake test + i=0; while bundle exec rake test + do + echo i: $i + ((i=i+1)) + done + echo i: $i fi working-directory: "${{ steps.setup.outputs.gem_dir }}" diff --git a/.github/workflows/ci-markdown-link.yml b/.github/workflows/ci-markdown-link.yml index 7b42be0c1..b4dd46c2d 100644 --- a/.github/workflows/ci-markdown-link.yml +++ b/.github/workflows/ci-markdown-link.yml @@ -1,17 +1,17 @@ -name: Markdown Link Check +# name: Markdown Link Check -on: - pull_request: +# on: +# pull_request: -jobs: - markdown-link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 +# jobs: +# markdown-link-check: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 - - name: "Markdown Link Check" - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - config-file: '.markdown-link-check.json' - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' +# - name: "Markdown Link Check" +# uses: gaurav-nelson/github-action-markdown-link-check@v1 +# with: +# config-file: '.markdown-link-check.json' +# use-quiet-mode: 'yes' +# use-verbose-mode: 'yes' diff --git a/.github/workflows/ci-markdownlint.yml b/.github/workflows/ci-markdownlint.yml index f91609fdb..185913b49 100644 --- a/.github/workflows/ci-markdownlint.yml +++ b/.github/workflows/ci-markdownlint.yml @@ -1,20 +1,20 @@ -name: Markdown Lint Check +# name: Markdown Lint Check -on: - pull_request: +# on: +# pull_request: -jobs: - markdownlint-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 +# jobs: +# markdownlint-check: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 - # equivalent cli: markdownlint-cli2 "**/*.md" "#**/CHANGELOG.md" --config .markdownlint.json - - name: "Markdown Lint Check" - uses: DavidAnson/markdownlint-cli2-action@v16 - with: - fix: false - globs: | - **/*.md - !**/CHANGELOG.md - continue-on-error: true +# # equivalent cli: markdownlint-cli2 "**/*.md" "#**/CHANGELOG.md" --config .markdownlint.json +# - name: "Markdown Lint Check" +# uses: DavidAnson/markdownlint-cli2-action@v16 +# with: +# fix: false +# globs: | +# **/*.md +# !**/CHANGELOG.md +# continue-on-error: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1eadcc02c..5d3d4b96b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,137 +14,137 @@ concurrency: cancel-in-progress: true # Cancel any previous runs of this workflow jobs: - base: - strategy: - fail-fast: false - matrix: - gem: - - opentelemetry-api - - opentelemetry-common - - opentelemetry-logs-api - - opentelemetry-logs-sdk - - opentelemetry-metrics-api - - opentelemetry-metrics-sdk - - opentelemetry-registry - - opentelemetry-sdk - - opentelemetry-sdk-experimental - - opentelemetry-semantic_conventions - - opentelemetry-test-helpers - os: - - ubuntu-latest - - macos-latest - - windows-latest - name: ${{ matrix.gem }} / ${{ matrix.os }} - 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: - gem: "${{ matrix.gem }}" - ruby: "3.2" - - name: "Test Ruby 3.1" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "${{ matrix.gem }}" - ruby: "3.1" - - name: "Test Ruby 3.0" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "${{ matrix.gem }}" - ruby: "3.0" - yard: true - rubocop: true - build: true - - name: "Test JRuby" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - 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" + # base: + # strategy: + # fail-fast: false + # matrix: + # gem: + # - opentelemetry-api + # - opentelemetry-common + # - opentelemetry-logs-api + # - opentelemetry-logs-sdk + # - opentelemetry-metrics-api + # - opentelemetry-metrics-sdk + # - opentelemetry-registry + # - opentelemetry-sdk + # - opentelemetry-sdk-experimental + # - opentelemetry-semantic_conventions + # - opentelemetry-test-helpers + # os: + # - ubuntu-latest + # - macos-latest + # - windows-latest + # name: ${{ matrix.gem }} / ${{ matrix.os }} + # 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: + # gem: "${{ matrix.gem }}" + # ruby: "3.2" + # - name: "Test Ruby 3.1" + # if: "${{ matrix.os == 'ubuntu-latest' }}" + # uses: ./.github/actions/test_gem + # with: + # gem: "${{ matrix.gem }}" + # ruby: "3.1" + # - name: "Test Ruby 3.0" + # if: "${{ matrix.os == 'ubuntu-latest' }}" + # uses: ./.github/actions/test_gem + # with: + # gem: "${{ matrix.gem }}" + # ruby: "3.0" + # yard: true + # rubocop: true + # build: true + # - name: "Test JRuby" + # if: "${{ matrix.os == 'ubuntu-latest' }}" + # uses: ./.github/actions/test_gem + # 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: fail-fast: false matrix: gem: - - opentelemetry-exporter-jaeger - - opentelemetry-exporter-otlp - - opentelemetry-exporter-otlp-common - - opentelemetry-exporter-otlp-grpc - - opentelemetry-exporter-otlp-http - - opentelemetry-exporter-zipkin + # - opentelemetry-exporter-jaeger + # - opentelemetry-exporter-otlp + # - opentelemetry-exporter-otlp-common + # - opentelemetry-exporter-otlp-grpc + # - opentelemetry-exporter-otlp-http + # - opentelemetry-exporter-zipkin - opentelemetry-exporter-otlp-metrics os: - ubuntu-latest - - macos-latest - - windows-latest - exclude: + # - macos-latest + # - windows-latest + # exclude: # Doesn't build on macos - - os: macos-latest - gem: opentelemetry-exporter-jaeger - - os: windows-latest - gem: opentelemetry-exporter-otlp-grpc + # - os: macos-latest + # gem: opentelemetry-exporter-jaeger + # - os: windows-latest + # gem: opentelemetry-exporter-otlp-grpc name: ${{ matrix.gem }} / ${{ matrix.os }} 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: - gem: "${{ matrix.gem }}" - ruby: "3.2" - - name: "Test Ruby 3.1" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "${{ matrix.gem }}" - ruby: "3.1" - - name: "Test Ruby 3.0" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "${{ matrix.gem }}" - ruby: "3.0" - yard: true - rubocop: true - build: true - - name: "JRuby Filter" - id: jruby_skip - shell: bash - run: | - echo "skip=false" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "opentelemetry-exporter-otlp" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ 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" - if: "${{ matrix.os == 'ubuntu-latest' && steps.jruby_skip.outputs.skip == 'false' }}" - uses: ./.github/actions/test_gem - with: - gem: "${{ matrix.gem }}" - ruby: "jruby" + # - 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: + # gem: "${{ matrix.gem }}" + # ruby: "3.2" + # - name: "Test Ruby 3.1" + # if: "${{ matrix.os == 'ubuntu-latest' }}" + # uses: ./.github/actions/test_gem + # with: + # gem: "${{ matrix.gem }}" + # ruby: "3.1" + # - name: "Test Ruby 3.0" + # if: "${{ matrix.os == 'ubuntu-latest' }}" + # uses: ./.github/actions/test_gem + # with: + # gem: "${{ matrix.gem }}" + # ruby: "3.0" + # yard: true + # rubocop: true + # build: true + # - name: "JRuby Filter" + # id: jruby_skip + # shell: bash + # run: | + # echo "skip=false" >> $GITHUB_OUTPUT + # [[ "${{ matrix.gem }}" == "opentelemetry-exporter-otlp" ]] && echo "skip=true" >> $GITHUB_OUTPUT + # [[ "${{ 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" + # if: "${{ matrix.os == 'ubuntu-latest' && steps.jruby_skip.outputs.skip == 'false' }}" + # uses: ./.github/actions/test_gem + # with: + # gem: "${{ matrix.gem }}" + # ruby: "jruby" - name: "Truffleruby Filter" id: truffleruby_skip shell: bash @@ -160,61 +160,61 @@ jobs: gem: "${{ matrix.gem }}" ruby: "truffleruby" - propagators: - strategy: - fail-fast: false - matrix: - gem: - - opentelemetry-propagator-b3 - - opentelemetry-propagator-jaeger - os: - - ubuntu-latest - - macos-latest - - windows-latest - name: ${{ matrix.gem }} / ${{ matrix.os }} - 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: - gem: "${{ matrix.gem }}" - ruby: "3.2" - - name: "Test Ruby 3.1" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "${{ matrix.gem }}" - ruby: "3.1" - - name: "Test Ruby 3.0" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - with: - gem: "${{ matrix.gem }}" - ruby: "3.0" - yard: true - rubocop: true - build: true - - name: "Test JRuby" - if: "${{ matrix.os == 'ubuntu-latest' }}" - uses: ./.github/actions/test_gem - 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" + # propagators: + # strategy: + # fail-fast: false + # matrix: + # gem: + # - opentelemetry-propagator-b3 + # - opentelemetry-propagator-jaeger + # os: + # - ubuntu-latest + # - macos-latest + # - windows-latest + # name: ${{ matrix.gem }} / ${{ matrix.os }} + # 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: + # gem: "${{ matrix.gem }}" + # ruby: "3.2" + # - name: "Test Ruby 3.1" + # if: "${{ matrix.os == 'ubuntu-latest' }}" + # uses: ./.github/actions/test_gem + # with: + # gem: "${{ matrix.gem }}" + # ruby: "3.1" + # - name: "Test Ruby 3.0" + # if: "${{ matrix.os == 'ubuntu-latest' }}" + # uses: ./.github/actions/test_gem + # with: + # gem: "${{ matrix.gem }}" + # ruby: "3.0" + # yard: true + # rubocop: true + # build: true + # - name: "Test JRuby" + # if: "${{ matrix.os == 'ubuntu-latest' }}" + # uses: ./.github/actions/test_gem + # 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" - codespell: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: make codespell + # codespell: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - run: make codespell diff --git a/exporter/otlp-metrics/lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb b/exporter/otlp-metrics/lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb index a6150fefb..3fa1972d8 100644 --- a/exporter/otlp-metrics/lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb +++ b/exporter/otlp-metrics/lib/opentelemetry/exporter/otlp/metrics/metrics_exporter.rb @@ -84,6 +84,8 @@ def pull # metrics Array[MetricData] def export(metrics, timeout: nil) + puts 'MetricsExporter#export' + puts metrics @mutex.synchronize do send_bytes(encode(metrics), timeout: timeout) end @@ -184,6 +186,8 @@ def send_bytes(bytes, timeout:) end def encode(metrics_data) + puts 'def encode' + puts metrics_data Opentelemetry::Proto::Collector::Metrics::V1::ExportMetricsServiceRequest.encode( Opentelemetry::Proto::Collector::Metrics::V1::ExportMetricsServiceRequest.new( resource_metrics: metrics_data diff --git a/exporter/otlp-metrics/test/opentelemetry/exporter/otlp/metrics/metrics_exporter_test.rb b/exporter/otlp-metrics/test/opentelemetry/exporter/otlp/metrics/metrics_exporter_test.rb index bd9d45876..96d5fde5a 100644 --- a/exporter/otlp-metrics/test/opentelemetry/exporter/otlp/metrics/metrics_exporter_test.rb +++ b/exporter/otlp-metrics/test/opentelemetry/exporter/otlp/metrics/metrics_exporter_test.rb @@ -556,8 +556,8 @@ end it 'translates all the things' do - skip 'Intermittently fails' if RUBY_ENGINE == 'truffleruby' - + # skip 'Intermittently fails' if RUBY_ENGINE == 'truffleruby' + puts '*********************************************' stub_request(:post, 'http://localhost:4318/v1/metrics').to_return(status: 200) meter_provider.add_metric_reader(exporter) meter = meter_provider.meter('test') @@ -638,6 +638,9 @@ ) ) + puts 'decoded encoded_estr' + puts Opentelemetry::Proto::Collector::Metrics::V1::ExportMetricsServiceRequest.decode(encoded_etsr) + assert_requested(:post, 'http://localhost:4318/v1/metrics') do |req| req.body == Zlib.gzip(encoded_etsr) # is asserting that the body of the HTTP request is equal to the result of gzipping the encoded_etsr. end