Skip to content

Commit d664009

Browse files
authored
Merge branch 'open-telemetry:main' into marcuslimdw/asyncpg-fix-multiple-instrumentor-instantiation
2 parents 4dcd813 + c68d0fd commit d664009

File tree

299 files changed

+9034
-2069
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+9034
-2069
lines changed

.github/CODEOWNERS

+7-21
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
1-
# Code owners file.
2-
# This file controls who is tagged for review for any given pull request.
3-
#
4-
# What is a "CODEOWNER"?
5-
#
6-
# A CODEOWNER lends their expertise to a specific package hosted by an OpenTelemetry repository.
7-
#
8-
# A CODEOWNER MUST:
9-
# - introduce themselves on the CNCF OTel Python channel: https://cloud-native.slack.com/archives/C01PD4HUVBL
10-
# - have enough knowledge of the corresponding instrumented library
11-
# - respond to issues
12-
# - fix failing unit tests or any other blockers to the CI/CD workflow
13-
# - update usage of `opentelemetry-python-core` APIs upon the introduction of breaking changes
14-
# - be a member of the OpenTelemetry community so that the `component-owners.yml` action to automatically assign CODEOWNERS to PRs works correctly.
15-
#
1+
# This file is only used as a way to assign any change to the approvers team
2+
# except for a change in any of the instrumentations. The actual codeowners
3+
# of the instrumentations are in .github/component_owners.yml.
164

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

8+
# ...except for changes in any instrumentation.
9+
/instrumentation
10+
2111
# Learn about CODEOWNERS file format:
2212
# https://help.github.com/en/articles/about-code-owners
23-
#
24-
# Learn about membership in OpenTelemetry community:
25-
# https://github.com/open-telemetry/community/blob/main/community-membership.md
26-
#

.github/component_owners.yml

+18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ components:
33
docs/instrumentation:
44
- nemoshlag
55

6+
67
instrumentation/opentelemetry-instrumentation-aio-pika:
78
- ofek1weiss
89

@@ -43,9 +44,26 @@ components:
4344

4445
instrumentation/opentelemetry-instrumentation-urllib:
4546
- shalevr
47+
- ocelotl
4648

4749
instrumentation/opentelemetry-instrumentation-urllib3:
4850
- shalevr
51+
- ocelotl
4952

5053
instrumentation/opentelemetry-instrumentation-sqlalchemy:
5154
- shalevr
55+
56+
instrumentation/opentelemetry-instrumentation-flask:
57+
- ocelotl
58+
59+
instrumentation/opentelemetry-instrumentation-jinja2:
60+
- ocelotl
61+
62+
instrumentation/opentelemetry-instrumentation-logging:
63+
- ocelotl
64+
65+
instrumentation/opentelemetry-instrumentation-requests:
66+
- ocelotl
67+
68+
instrumentation/opentelemetry-instrumentation-cassandra:
69+
- mattcontinisio
+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Contrib Repo Tests
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'release/*'
7+
pull_request:
8+
env:
9+
CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150
10+
11+
jobs:
12+
instrumentations-0:
13+
env:
14+
# We use these variables to convert between tox and GHA version literals
15+
py37: 3.7
16+
py38: 3.8
17+
py39: 3.9
18+
py310: "3.10"
19+
py311: "3.11"
20+
pypy3: pypy-3.7
21+
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
25+
matrix:
26+
python-version: [py37, py38, py39, py310, py311, pypy3]
27+
package:
28+
# Do not add more instrumentations here, add them in instrumentations_1.yml.
29+
# The reason for this separation of instrumentations into more than one YAML file is
30+
# the limit of jobs that can be run from a Github actions matrix:
31+
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
32+
# "A matrix will generate a maximum of 256 jobs per workflow run. This limit applies
33+
# to both GitHub-hosted and self-hosted runners."
34+
- "aiohttp-client"
35+
- "aiohttp-server"
36+
- "aiopg"
37+
- "aio-pika"
38+
- "asgi"
39+
- "asyncpg"
40+
- "aws-lambda"
41+
- "boto"
42+
- "boto3sqs"
43+
- "botocore"
44+
- "cassandra"
45+
- "celery"
46+
- "confluent-kafka"
47+
- "dbapi"
48+
- "django"
49+
- "elasticsearch"
50+
- "falcon"
51+
- "fastapi"
52+
- "flask"
53+
- "grpc"
54+
- "httpx"
55+
- "jinja2"
56+
- "kafka-python"
57+
- "logging"
58+
- "mysql"
59+
- "mysqlclient"
60+
- "sio-pika"
61+
- "psycopg2"
62+
- "pymemcache"
63+
- "pymongo"
64+
- "pymysql"
65+
- "pyramid"
66+
- "redis"
67+
- "remoulade"
68+
- "requests"
69+
- "sklearn"
70+
- "sqlalchemy"
71+
- "sqlite3"
72+
- "starlette"
73+
- "system-metrics"
74+
- "tornado"
75+
- "tortoiseorm"
76+
os: [ubuntu-20.04]
77+
steps:
78+
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
79+
uses: actions/checkout@v2
80+
- name: Set up Python ${{ env[matrix.python-version] }}
81+
uses: actions/setup-python@v4
82+
with:
83+
python-version: ${{ env[matrix.python-version] }}
84+
- name: Install tox
85+
run: pip install tox==3.27.1 tox-factor
86+
- name: Cache tox environment
87+
# Preserves .tox directory between runs for faster installs
88+
uses: actions/cache@v1
89+
with:
90+
path: |
91+
.tox
92+
~/.cache/pip
93+
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
94+
- name: run tox
95+
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Contrib Repo Tests
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'release/*'
7+
pull_request:
8+
env:
9+
CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150
10+
11+
jobs:
12+
instrumentations-1:
13+
env:
14+
# We use these variables to convert between tox and GHA version literals
15+
py37: 3.7
16+
py38: 3.8
17+
py39: 3.9
18+
py310: "3.10"
19+
py311: "3.11"
20+
pypy3: pypy-3.7
21+
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
25+
matrix:
26+
python-version: [py37, py38, py39, py310, py311, pypy3]
27+
package:
28+
- "urllib"
29+
- "urllib3v"
30+
- "wsgi"
31+
- "distro"
32+
- "richconsole"
33+
- "prometheus-remote-write"
34+
- "sdkextension-aws"
35+
- "propagator-aws-xray"
36+
- "propagator-ot-trace"
37+
- "resource-detector-container"
38+
os: [ubuntu-20.04]
39+
steps:
40+
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
41+
uses: actions/checkout@v2
42+
- name: Set up Python ${{ env[matrix.python-version] }}
43+
uses: actions/setup-python@v4
44+
with:
45+
python-version: ${{ env[matrix.python-version] }}
46+
- name: Install tox
47+
run: pip install tox==3.27.1 tox-factor
48+
- name: Cache tox environment
49+
# Preserves .tox directory between runs for faster installs
50+
uses: actions/cache@v1
51+
with:
52+
path: |
53+
.tox
54+
~/.cache/pip
55+
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
56+
- name: run tox
57+
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json

.github/workflows/test.yml

+1-84
Original file line numberDiff line numberDiff line change
@@ -6,92 +6,9 @@ on:
66
- 'release/*'
77
pull_request:
88
env:
9-
CORE_REPO_SHA: 2387b4465d930b020df79692a8097e1d54b66ec1
9+
CORE_REPO_SHA: 84c0e4f38d4fcdb8c13fd3988469fbb8cda28150
1010

1111
jobs:
12-
build:
13-
env:
14-
# We use these variables to convert between tox and GHA version literals
15-
py37: 3.7
16-
py38: 3.8
17-
py39: 3.9
18-
py310: "3.10"
19-
py311: "3.11"
20-
pypy3: "pypy3.7"
21-
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
22-
runs-on: ${{ matrix.os }}
23-
strategy:
24-
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
25-
matrix:
26-
python-version: [ py37, py38, py39, py310, py311, pypy3 ]
27-
package: ["instrumentation", "distro", "exporter", "sdkextension", "propagator"]
28-
os: [ ubuntu-20.04 ]
29-
steps:
30-
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
31-
uses: actions/checkout@v2
32-
- name: Set up Python ${{ env[matrix.python-version] }}
33-
uses: actions/setup-python@v4
34-
with:
35-
python-version: ${{ env[matrix.python-version] }}
36-
- name: Install tox
37-
run: pip install tox==3.27.1 tox-factor
38-
- name: Cache tox environment
39-
# Preserves .tox directory between runs for faster installs
40-
uses: actions/cache@v1
41-
with:
42-
path: |
43-
.tox
44-
~/.cache/pip
45-
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
46-
- name: run tox
47-
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
48-
# - name: Find and merge ${{ matrix.package }} benchmarks
49-
# # TODO: Add at least one benchmark to every package type to remove this (#249)
50-
# if: matrix.package == 'sdkextension' || matrix.package == 'propagator'
51-
# run: >-
52-
# mkdir -p benchmarks;
53-
# jq -s '.[0].benchmarks = ([.[].benchmarks] | add)
54-
# | if .[0].benchmarks == null then null else .[0] end'
55-
# **/**/tests/*${{ matrix.package }}*-benchmark.json > benchmarks/output_${{ matrix.package }}.json
56-
# - name: Upload all benchmarks under same key as an artifact
57-
# if: ${{ success() }}
58-
# uses: actions/upload-artifact@v2
59-
# with:
60-
# name: benchmarks
61-
# path: benchmarks/output_${{ matrix.package }}.json
62-
# combine-benchmarks:
63-
# runs-on: ubuntu-latest
64-
# needs: build
65-
# if: ${{ always() }}
66-
# name: Combine benchmarks from previous build job
67-
# steps:
68-
# - name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
69-
# uses: actions/checkout@v2
70-
# - name: Download all benchmarks as artifact using key
71-
# uses: actions/download-artifact@v2
72-
# with:
73-
# name: benchmarks
74-
# path: benchmarks
75-
# - name: Find and merge all benchmarks
76-
# run: >-
77-
# jq -s '.[0].benchmarks = ([.[].benchmarks] | add)
78-
# | if .[0].benchmarks == null then null else .[0] end'
79-
# benchmarks/output_*.json > output.json;
80-
# - name: Report on benchmark results
81-
# uses: benchmark-action/github-action-benchmark@v1
82-
# with:
83-
# name: OpenTelemetry Python Benchmarks - Python ${{ env[matrix.python-version ]}} - ${{ matrix.package }}
84-
# tool: pytest
85-
# output-file-path: output.json
86-
# github-token: ${{ secrets.GITHUB_TOKEN }}
87-
# max-items-in-chart: 100
88-
# # Alert with a commit comment on possible performance regression
89-
# alert-threshold: 200%
90-
# fail-on-alert: true
91-
# # Make a commit on `gh-pages` with benchmarks from previous step
92-
# auto-push: ${{ github.ref == 'refs/heads/main' }}
93-
# gh-pages-branch: gh-pages
94-
# benchmark-data-dir-path: benchmarks
9512
misc:
9613
strategy:
9714
fail-fast: false

.pylintrc

+3-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# A comma-separated list of package or module names from where C extensions may
44
# be loaded. Extensions are loading into the active Python interpreter and may
55
# run arbitrary code.
6-
extension-pkg-whitelist=
6+
extension-pkg-whitelist=cassandra
77

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

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

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

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

271-
# List of optional constructs for which whitespace checking is disabled. `dict-
272-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
273-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
274-
# `empty-line` allows space-only lines.
275-
no-space-check=trailing-comma,
276-
dict-separator
277-
278271
# Allow the body of a class to be on the same line as the declaration if body
279272
# contains single statement.
280273
single-line-class-stmt=no

0 commit comments

Comments
 (0)