Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into marcuslimdw/asyncpg-fix-multi…
Browse files Browse the repository at this point in the history
…ple-instrumentor-instantiation
  • Loading branch information
marcuslimdw authored Jan 31, 2024
2 parents 4dcd813 + c68d0fd commit d664009
Show file tree
Hide file tree
Showing 299 changed files with 9,034 additions and 2,069 deletions.
28 changes: 7 additions & 21 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
# Code owners file.
# This file controls who is tagged for review for any given pull request.
#
# What is a "CODEOWNER"?
#
# A CODEOWNER lends their expertise to a specific package hosted by an OpenTelemetry repository.
#
# A CODEOWNER MUST:
# - introduce themselves on the CNCF OTel Python channel: https://cloud-native.slack.com/archives/C01PD4HUVBL
# - have enough knowledge of the corresponding instrumented library
# - respond to issues
# - fix failing unit tests or any other blockers to the CI/CD workflow
# - update usage of `opentelemetry-python-core` APIs upon the introduction of breaking changes
# - be a member of the OpenTelemetry community so that the `component-owners.yml` action to automatically assign CODEOWNERS to PRs works correctly.
#
# This file is only used as a way to assign any change to the approvers team
# except for a change in any of the instrumentations. The actual codeowners
# of the instrumentations are in .github/component_owners.yml.


# For anything not explicitly taken by someone else:
# Assigns any change to the approvers team...
* @open-telemetry/opentelemetry-python-contrib-approvers

# ...except for changes in any instrumentation.
/instrumentation

# Learn about CODEOWNERS file format:
# https://help.github.com/en/articles/about-code-owners
#
# Learn about membership in OpenTelemetry community:
# https://github.com/open-telemetry/community/blob/main/community-membership.md
#
18 changes: 18 additions & 0 deletions .github/component_owners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ components:
docs/instrumentation:
- nemoshlag


instrumentation/opentelemetry-instrumentation-aio-pika:
- ofek1weiss

Expand Down Expand Up @@ -43,9 +44,26 @@ components:

instrumentation/opentelemetry-instrumentation-urllib:
- shalevr
- ocelotl

instrumentation/opentelemetry-instrumentation-urllib3:
- shalevr
- ocelotl

instrumentation/opentelemetry-instrumentation-sqlalchemy:
- shalevr

instrumentation/opentelemetry-instrumentation-flask:
- ocelotl

instrumentation/opentelemetry-instrumentation-jinja2:
- ocelotl

instrumentation/opentelemetry-instrumentation-logging:
- ocelotl

instrumentation/opentelemetry-instrumentation-requests:
- ocelotl

instrumentation/opentelemetry-instrumentation-cassandra:
- mattcontinisio
95 changes: 95 additions & 0 deletions .github/workflows/instrumentations_0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Contrib Repo Tests

on:
push:
branches-ignore:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150

jobs:
instrumentations-0:
env:
# We use these variables to convert between tox and GHA version literals
py37: 3.7
py38: 3.8
py39: 3.9
py310: "3.10"
py311: "3.11"
pypy3: pypy-3.7
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [py37, py38, py39, py310, py311, pypy3]
package:
# Do not add more instrumentations here, add them in instrumentations_1.yml.
# The reason for this separation of instrumentations into more than one YAML file is
# the limit of jobs that can be run from a Github actions matrix:
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
# "A matrix will generate a maximum of 256 jobs per workflow run. This limit applies
# to both GitHub-hosted and self-hosted runners."
- "aiohttp-client"
- "aiohttp-server"
- "aiopg"
- "aio-pika"
- "asgi"
- "asyncpg"
- "aws-lambda"
- "boto"
- "boto3sqs"
- "botocore"
- "cassandra"
- "celery"
- "confluent-kafka"
- "dbapi"
- "django"
- "elasticsearch"
- "falcon"
- "fastapi"
- "flask"
- "grpc"
- "httpx"
- "jinja2"
- "kafka-python"
- "logging"
- "mysql"
- "mysqlclient"
- "sio-pika"
- "psycopg2"
- "pymemcache"
- "pymongo"
- "pymysql"
- "pyramid"
- "redis"
- "remoulade"
- "requests"
- "sklearn"
- "sqlalchemy"
- "sqlite3"
- "starlette"
- "system-metrics"
- "tornado"
- "tortoiseorm"
os: [ubuntu-20.04]
steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2
- name: Set up Python ${{ env[matrix.python-version] }}
uses: actions/setup-python@v4
with:
python-version: ${{ env[matrix.python-version] }}
- name: Install tox
run: pip install tox==3.27.1 tox-factor
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v1
with:
path: |
.tox
~/.cache/pip
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
57 changes: 57 additions & 0 deletions .github/workflows/instrumentations_1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Contrib Repo Tests

on:
push:
branches-ignore:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150

jobs:
instrumentations-1:
env:
# We use these variables to convert between tox and GHA version literals
py37: 3.7
py38: 3.8
py39: 3.9
py310: "3.10"
py311: "3.11"
pypy3: pypy-3.7
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [py37, py38, py39, py310, py311, pypy3]
package:
- "urllib"
- "urllib3v"
- "wsgi"
- "distro"
- "richconsole"
- "prometheus-remote-write"
- "sdkextension-aws"
- "propagator-aws-xray"
- "propagator-ot-trace"
- "resource-detector-container"
os: [ubuntu-20.04]
steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2
- name: Set up Python ${{ env[matrix.python-version] }}
uses: actions/setup-python@v4
with:
python-version: ${{ env[matrix.python-version] }}
- name: Install tox
run: pip install tox==3.27.1 tox-factor
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v1
with:
path: |
.tox
~/.cache/pip
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
85 changes: 1 addition & 84 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,92 +6,9 @@ on:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: 2387b4465d930b020df79692a8097e1d54b66ec1
CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150

jobs:
build:
env:
# We use these variables to convert between tox and GHA version literals
py37: 3.7
py38: 3.8
py39: 3.9
py310: "3.10"
py311: "3.11"
pypy3: "pypy3.7"
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [ py37, py38, py39, py310, py311, pypy3 ]
package: ["instrumentation", "distro", "exporter", "sdkextension", "propagator"]
os: [ ubuntu-20.04 ]
steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2
- name: Set up Python ${{ env[matrix.python-version] }}
uses: actions/setup-python@v4
with:
python-version: ${{ env[matrix.python-version] }}
- name: Install tox
run: pip install tox==3.27.1 tox-factor
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v1
with:
path: |
.tox
~/.cache/pip
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
# - name: Find and merge ${{ matrix.package }} benchmarks
# # TODO: Add at least one benchmark to every package type to remove this (#249)
# if: matrix.package == 'sdkextension' || matrix.package == 'propagator'
# run: >-
# mkdir -p benchmarks;
# jq -s '.[0].benchmarks = ([.[].benchmarks] | add)
# | if .[0].benchmarks == null then null else .[0] end'
# **/**/tests/*${{ matrix.package }}*-benchmark.json > benchmarks/output_${{ matrix.package }}.json
# - name: Upload all benchmarks under same key as an artifact
# if: ${{ success() }}
# uses: actions/upload-artifact@v2
# with:
# name: benchmarks
# path: benchmarks/output_${{ matrix.package }}.json
# combine-benchmarks:
# runs-on: ubuntu-latest
# needs: build
# if: ${{ always() }}
# name: Combine benchmarks from previous build job
# steps:
# - name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
# uses: actions/checkout@v2
# - name: Download all benchmarks as artifact using key
# uses: actions/download-artifact@v2
# with:
# name: benchmarks
# path: benchmarks
# - name: Find and merge all benchmarks
# run: >-
# jq -s '.[0].benchmarks = ([.[].benchmarks] | add)
# | if .[0].benchmarks == null then null else .[0] end'
# benchmarks/output_*.json > output.json;
# - name: Report on benchmark results
# uses: benchmark-action/github-action-benchmark@v1
# with:
# name: OpenTelemetry Python Benchmarks - Python ${{ env[matrix.python-version ]}} - ${{ matrix.package }}
# tool: pytest
# output-file-path: output.json
# github-token: ${{ secrets.GITHUB_TOKEN }}
# max-items-in-chart: 100
# # Alert with a commit comment on possible performance regression
# alert-threshold: 200%
# fail-on-alert: true
# # Make a commit on `gh-pages` with benchmarks from previous step
# auto-push: ${{ github.ref == 'refs/heads/main' }}
# gh-pages-branch: gh-pages
# benchmark-data-dir-path: benchmarks
misc:
strategy:
fail-fast: false
Expand Down
13 changes: 3 additions & 10 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-whitelist=
extension-pkg-whitelist=cassandra

# Add list of files or directories to be excluded. They should be base names, not
# paths.
Expand All @@ -29,7 +29,7 @@ limit-inference-results=100

# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
load-plugins=pylint.extensions.no_self_use

# Pickle collected data for later comparisons.
persistent=yes
Expand Down Expand Up @@ -69,7 +69,6 @@ disable=missing-docstring,
duplicate-code,
ungrouped-imports, # Leave this up to isort
wrong-import-order, # Leave this up to isort
bad-continuation, # Leave this up to black
line-too-long, # Leave this up to black
exec-used,
super-with-arguments, # temp-pylint-upgrade
Expand All @@ -81,6 +80,7 @@ disable=missing-docstring,
invalid-overridden-method, # temp-pylint-upgrade
missing-module-docstring, # temp-pylint-upgrade
import-error, # needed as a workaround as reported here: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/290
cyclic-import,

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -268,13 +268,6 @@ max-line-length=79
# Maximum number of lines in a module.
max-module-lines=1000

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
Expand Down
Loading

0 comments on commit d664009

Please sign in to comment.