Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e966f7e

Browse files
committed
Merge branch 'master' of https://github.com/open-telemetry/opentelemetry-python into views
2 parents 53cc0f7 + 7a46b2d commit e966f7e

File tree

514 files changed

+26423
-2875
lines changed

Some content is hidden

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

514 files changed

+26423
-2875
lines changed

.circleci/config.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
version: 2.1
2+
3+
executors:
4+
python38:
5+
docker:
6+
- image: circleci/python:3.8
7+
8+
commands:
9+
setup_tox:
10+
description: "Install tox"
11+
steps:
12+
- run: pip install -U tox-factor
13+
14+
restore_tox_cache:
15+
description: "Restore .tox directory from previous runs for faster installs"
16+
steps:
17+
- restore_cache:
18+
# In the cache key:
19+
# - .Environment.CIRCLE_JOB: We do separate tox environments by job name, so caching and restoring is
20+
# much faster.
21+
key: tox-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tox.ini" }}-{{ checksum "dev-requirements.txt" }}
22+
23+
save_tox_cache:
24+
description: "Save .tox directory into cache for faster installs next time"
25+
steps:
26+
- save_cache:
27+
# In the cache key:
28+
# - .Environment.CIRCLE_JOB: We do separate tox environments by job name, so caching and restoring is
29+
# much faster.
30+
key: tox-cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tox.ini" }}-{{ checksum "dev-requirements.txt" }}
31+
paths:
32+
- ".tox"
33+
34+
jobs:
35+
docs:
36+
executor: python38
37+
steps:
38+
- checkout
39+
- setup_tox
40+
- restore_tox_cache
41+
- run: tox -e docs
42+
- save_tox_cache
43+
44+
lint:
45+
executor: python38
46+
steps:
47+
- checkout
48+
- setup_tox
49+
- restore_tox_cache
50+
- run: tox -e lint
51+
- save_tox_cache
52+
53+
workflows:
54+
main:
55+
jobs:
56+
- docs
57+
- lint

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ exclude =
2020
ext/opentelemetry-ext-jaeger/build/*
2121
docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/grpc/gen/
2222
docs/examples/opentelemetry-example-app/build/*
23+
opentelemetry-proto/build/*
24+
opentelemetry-proto/src/opentelemetry/proto/

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# tells github that proto code is generated
2+
opentelemetry-proto/src/**/*_pb2*.py* linguist-generated=true

.github/workflows/publish.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,24 @@ jobs:
1414
python-version: '3.7'
1515
- name: Build wheels
1616
run: ./scripts/build.sh
17+
- name: Install twine
18+
run: |
19+
pip install twine
20+
# The step below publishes to testpypi in order to catch any issues
21+
# with the package configuration that would cause a failure to upload
22+
# to pypi. One example of such a failure is if a classifier is
23+
# rejected by pypi (e.g "3 - Beta"). This would cause a failure during the
24+
# middle of the package upload causing the action to fail, and certain packages
25+
# might have already been updated, this would be bad.
26+
- name: Publish to TestPyPI
27+
env:
28+
TWINE_USERNAME: '__token__'
29+
TWINE_PASSWORD: ${{ secrets.test_pypi_token }}
30+
run: |
31+
twine upload --repository testpypi --skip-existing --verbose dist/*
1732
- name: Publish to PyPI
1833
env:
1934
TWINE_USERNAME: '__token__'
2035
TWINE_PASSWORD: ${{ secrets.pypi_password }}
2136
run: |
22-
pip install twine
2337
twine upload --skip-existing --verbose dist/*

.isort.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ line_length=79
1313
; docs: https://github.com/timothycrosley/isort#multi-line-output-modes
1414
multi_line_output=3
1515
skip=target
16-
skip_glob=**/gen/*,.venv*/*,venv*/*
16+
skip_glob=**/gen/*,.venv*/*,venv*/*,**/proto/*
1717
known_first_party=opentelemetry,opentelemetry_example_app
1818
known_third_party=psutil,pytest,redis,redis_opentracing

.pylintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extension-pkg-whitelist=
77

88
# Add files or directories to the blacklist. They should be base names, not
99
# paths.
10-
ignore=CVS,gen
10+
ignore=CVS,gen,proto
1111

1212
# Add files or directories matching the regex patterns to the blacklist. The
1313
# regex matches against base names, not paths.
@@ -226,7 +226,7 @@ dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
226226

227227
# Argument names that match this expression will be ignored. Default to name
228228
# with leading underscore.
229-
ignored-argument-names=_.*|^ignored_|^unused_
229+
ignored-argument-names=_.*|^ignored_|^unused_|^kwargs|^args
230230

231231
# Tells whether we should check for unused import in __init__ files.
232232
init-import=no

.travis.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ language: python
44

55
cache: pip
66

7-
python:
8-
- 'pypy3'
9-
- '3.8'
10-
- '3.4'
11-
- '3.5'
12-
- '3.6'
13-
- '3.7'
7+
matrix:
8+
include:
9+
- python: 3.8
10+
env: TOXENV=lint
11+
- python: pypy3
12+
- python: 3.8
13+
- python: 3.4
14+
- python: 3.5
15+
- python: 3.6
16+
- python: 3.7
17+
- python: 3.8
18+
env: TOXENV=docker-tests
19+
- python: 3.8
20+
env: TOXENV=docs
1421

1522
#matrix:
1623
# allow_failures:

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,30 @@ Meeting notes are available as a public [Google doc](https://docs.google.com/doc
103103

104104
Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telemetry/teams/python-approvers)):
105105

106-
- [Alex Boten](https://github.com/codeboten), LightStep
107-
- [Carlos Alberto Cortez](https://github.com/carlosalberto), LightStep
108-
- [Christian Neumüller](https://github.com/Oberon00), Dynatrace
106+
- [Carlos Alberto Cortez](https://github.com/carlosalberto), Lightstep
107+
- [Tahir H. Butt](https://github.com/majorgreys) DataDog
108+
- [Chris Kleinknecht](https://github.com/c24t), Google
109+
- [Diego Hurtado](https://github.com/ocelotl)
109110
- [Hector Hernandez](https://github.com/hectorhdzg), Microsoft
110-
- [Leighton Chen](https://github.com/lzchen), Microsoft
111111
- [Mauricio Vásquez](https://github.com/mauriciovasquezbernal), Kinvolk
112112
- [Reiley Yang](https://github.com/reyang), Microsoft
113113

114114
*Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#approver).*
115115

116116
Maintainers ([@open-telemetry/python-maintainers](https://github.com/orgs/open-telemetry/teams/python-maintainers)):
117117

118-
- [Chris Kleinknecht](https://github.com/c24t), Google
118+
- [Alex Boten](https://github.com/codeboten), Lightstep
119+
- [Leighton Chen](https://github.com/lzchen), Microsoft
119120
- [Yusuke Tsutsumi](https://github.com/toumorokoshi), Zillow Group
120121

121122
*Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#maintainer).*
122123

124+
### Thanks to all the people who already contributed!
125+
126+
<a href="https://github.com/open-telemetry/opentelemetry-python/graphs/contributors">
127+
<img src="https://contributors-img.web.app/image?repo=open-telemetry/opentelemetry-python" />
128+
</a>
129+
123130
## Release Schedule
124131

125132
OpenTelemetry Python is under active development.

RELEASING.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Releasing OpenTelemetry Packages (for maintainers only)
2+
This document explains how to publish all OT modules at version x.y.z. Ensure that you’re following semver when choosing a version number.
3+
4+
Release Process:
5+
* [Checkout a clean repo](#checkout-a-clean-repo)
6+
* [Create a new branch](#create-a-new-branch)
7+
* [Open a Pull Request](#open-a-pull-request)
8+
* [Create a Release](#Create-a-Release)
9+
* [Move stable tag](#Move-stable-tag)
10+
* [Update master](#Update-master)
11+
* [Check PyPI](#Check-PyPI)
12+
* [Troubleshooting](#troubleshooting)
13+
14+
## Checkout a clean repo
15+
- To avoid pushing untracked changes, check out the repo in a new dir
16+
17+
## Create a new branch
18+
The following script does the following:
19+
- update master locally
20+
- creates a new release branch `release/<version>`
21+
- updates version and changelog files
22+
- commits the change to a new branch `release/<version>-auto`
23+
24+
*NOTE: This script was run by a GitHub Action but required the Action bot to be excluded from the CLA check, which it currently is not.*
25+
26+
```bash
27+
./scripts/prepare_release.sh 0.7b0
28+
```
29+
30+
## Open a Pull Request
31+
32+
The PR should be opened from the `release/<version>-auto` branch created as part of running `prepare_release.sh` in the steps above.
33+
34+
## Create a Release
35+
36+
- Create the GH release from the release branch, using a new tag for this micro version, e.g. `v0.7.0`
37+
- Copy the changelogs from all packages that changed into the release notes (and reformat to remove hard line wraps)
38+
39+
40+
## Check PyPI
41+
42+
This should be handled automatically on release by the [publish action](https://github.com/open-telemetry/opentelemetry-python/blob/master/.github/workflows/publish.yml).
43+
44+
- Check the [action logs](https://github.com/open-telemetry/opentelemetry-python/actions?query=workflow%3APublish) to make sure packages have been uploaded to PyPI
45+
- Check the release history (e.g. https://pypi.org/project/opentelemetry-api/#history) on PyPI
46+
47+
If for some reason the action failed, see [Publish failed](#publish-failed) below
48+
49+
## Move stable tag
50+
51+
This will ensure the docs are pointing at the stable release.
52+
53+
```bash
54+
git tag -d stable
55+
git tag stable
56+
git push origin stable
57+
```
58+
59+
## Update master
60+
61+
Ensure the version and changelog updates have been applied to master.
62+
63+
```bash
64+
# checkout a new branch from master
65+
git checkout -b v0.7b0-master-update
66+
# cherry pick the change from the release branch
67+
git cherry-pick $(git log -n 1 origin/release/0.7b0 --format="%H")
68+
# update the version number, make it a "dev" greater than release number, e.g. 0.8.dev0
69+
perl -i -p -e 's/0.7b0/0.8.dev0/' $(git grep -l "0.7b0" | grep -vi CHANGELOG)
70+
# open a PR targeting master see #331
71+
git commit -m
72+
```
73+
74+
## Troubleshooting
75+
76+
### Publish failed
77+
78+
If for some reason the action failed, do it manually:
79+
80+
- Switch to the release branch (important so we don't publish packages with "dev" versions)
81+
- Build distributions with `./scripts/build.sh`
82+
- Delete distributions we don't want to push (e.g. `testutil`)
83+
- Push to PyPI as `twine upload --skip-existing --verbose dist/*`
84+
- Double check PyPI!

dev-requirements.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
pylint==2.4.4
2-
flake8~=3.7
2+
flake8==3.7.9
33
isort~=4.3
44
black>=19.3b0,==19.*
5-
mypy==0.740
5+
mypy==0.770
66
sphinx~=2.1
77
sphinx-rtd-theme~=0.4
88
sphinx-autodoc-typehints~=1.10.2
99
pytest!=5.2.3
1010
pytest-cov>=2.8
1111
readme-renderer~=24.0
12-
httpretty~=1.0
12+
grpcio-tools==1.29.0
13+
mypy-protobuf==1.21
14+
protobuf==3.12.2

docs-requirements.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,29 @@ sphinx-rtd-theme~=0.4
33
sphinx-autodoc-typehints~=1.10.2
44

55
# Required by ext packages
6-
aiohttp ~= 3.0
6+
asgiref~=3.0
7+
asyncpg>=0.12.0
8+
ddtrace>=0.34.0
9+
aiohttp~= 3.0
710
Deprecated>=1.2.6
11+
django>=2.2
812
PyMySQL~=0.9.3
913
flask~=1.0
1014
mysql-connector-python~=8.0
1115
opentracing~=2.2.0
1216
prometheus_client>=0.5.0,<1.0.0
1317
psycopg2-binary>=2.7.3.1
18+
pymemcache~=1.3
1419
pymongo~=3.1
20+
pyramid>=1.7
1521
redis>=2.6
22+
sqlalchemy>=1.0
1623
thrift>=0.10.0
17-
wrapt >=1.0.0,<2.0.0
24+
wrapt>=1.0.0,<2.0.0
25+
celery>=4.0
26+
psutil~=5.7.0
27+
boto~=2.0
28+
google-cloud-trace >=0.23.0
29+
google-cloud-monitoring>=0.36.0
30+
botocore~=1.0
31+
starlette~=0.13

docs/api/trace.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ Submodules
88

99
trace.sampling
1010
trace.status
11+
trace.span
1112

1213
Module contents
1314
---------------
1415

15-
.. automodule:: opentelemetry.trace
16+
.. automodule:: opentelemetry.trace

docs/api/trace.span.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
opentelemetry.trace.span
2+
========================
3+
4+
.. automodule:: opentelemetry.trace.span
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/auto_instrumentation/auto_instrumentation.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/auto_instrumentation/instrumentor.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)