Skip to content

Commit 34230b2

Browse files
author
Alex Boten
committed
Merge remote-tracking branch 'origin/main' into metrics
2 parents 2318e1e + 58521be commit 34230b2

File tree

299 files changed

+7264
-3037
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

+7264
-3037
lines changed

.flake8

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ exclude =
1616
venv*/
1717
target
1818
__pycache__
19-
exporter/opentelemetry-exporter-jaeger/src/opentelemetry/exporter/jaeger/gen/
20-
exporter/opentelemetry-exporter-jaeger/build/*
21-
exporter/opentelemetry-exporter-zipkin/src/opentelemetry/exporter/zipkin/encoder/v2/protobuf/gen/
19+
exporter/opentelemetry-exporter-jaeger-proto-grpc/src/opentelemetry/exporter/jaeger/proto/grpc/gen/
20+
exporter/opentelemetry-exporter-jaeger-proto-grpc/build/*
21+
exporter/opentelemetry-exporter-jaeger-thrift/src/opentelemetry/exporter/jaeger/thrift/gen/
22+
exporter/opentelemetry-exporter-jaeger-thrift/build/*
23+
exporter/opentelemetry-exporter-zipkin-proto-http/src/opentelemetry/exporter/zipkin/proto/http/v2/gen/
2224
docs/examples/opentelemetry-example-app/src/opentelemetry_example_app/grpc/gen/
2325
docs/examples/opentelemetry-example-app/build/*
2426
opentelemetry-proto/build/*

.github/workflows/test.yml

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ env:
1010
# Otherwise, set variable to the commit of your branch on
1111
# opentelemetry-python-contrib which is compatible with these Core repo
1212
# changes.
13-
CONTRIB_REPO_SHA: 6e328246c895ff433b14430c9edddfead072287c
13+
CONTRIB_REPO_SHA: 4fc64a01c118c640e273f56d2afb1b4597b82f0f
1414

1515
jobs:
1616
build:
1717
env:
1818
# We use these variables to convert between tox and GHA version literals
19-
py35: 3.5
2019
py36: 3.6
2120
py37: 3.7
2221
py38: 3.8
@@ -27,18 +26,9 @@ jobs:
2726
strategy:
2827
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
2928
matrix:
30-
python-version: [ py35, py36, py37, py38, py39, pypy3 ]
29+
python-version: [ py36, py37, py38, py39, pypy3 ]
3130
package: ["instrumentation", "core", "exporter", "propagator"]
3231
os: [ ubuntu-latest ]
33-
include:
34-
# py35-instrumentation segfaults on 18.04 so we instead run on 20.04
35-
- python-version: py35
36-
package: instrumentation
37-
os: ubuntu-20.04
38-
exclude:
39-
- os: ubuntu-latest
40-
python-version: py35
41-
package: instrumentation
4232
steps:
4333
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
4434
uses: actions/checkout@v2
@@ -118,7 +108,6 @@ jobs:
118108
contrib-build:
119109
env:
120110
# We use these variables to convert between tox and GHA version literals
121-
py35: 3.5
122111
py36: 3.6
123112
py37: 3.7
124113
py38: 3.8
@@ -128,18 +117,9 @@ jobs:
128117
strategy:
129118
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
130119
matrix:
131-
python-version: [ py35, py36, py37, py38, py39, pypy3 ]
120+
python-version: [ py36, py37, py38, py39, pypy3 ]
132121
package: ["instrumentation", "exporter"]
133122
os: [ ubuntu-latest ]
134-
include:
135-
# py35-instrumentation segfaults on 18.04 so we instead run on 20.04
136-
- python-version: py35
137-
package: instrumentation
138-
os: ubuntu-20.04
139-
exclude:
140-
- os: ubuntu-latest
141-
python-version: py35
142-
package: instrumentation
143123
steps:
144124
- name: Checkout Contrib Repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
145125
uses: actions/checkout@v2

CHANGELOG.md

Lines changed: 116 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,139 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v0.18b0...HEAD)
7+
## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.0.0...HEAD)
8+
9+
### Added
10+
- Added `py.typed` file to every package. This should resolve a bunch of mypy
11+
errors for users.
12+
([#1720](https://github.com/open-telemetry/opentelemetry-python/pull/1720))
13+
14+
### Changed
15+
- Adjust `B3Format` propagator to be spec compliant by not modifying context
16+
when propagation headers are not present/invalid/empty
17+
([#1728](https://github.com/open-telemetry/opentelemetry-python/pull/1728))
18+
- Update bootstrap cmd to use exact version when installing instrumentation packages.
19+
([#1722](https://github.com/open-telemetry/opentelemetry-python/pull/1722))
20+
- Renamed `otlp_metric` entrypoint to `otlp_proto_grpc_metric` for OTLP Proto gRPC
21+
MetricsExporter.
22+
23+
24+
## [1.0.0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.0.0) - 2021-03-26
25+
### Added
26+
- Document how to work with fork process web server models(Gunicorn, uWSGI etc...)
27+
([#1609](https://github.com/open-telemetry/opentelemetry-python/pull/1609))
28+
- Add `max_attr_value_length` support to Jaeger exporter
29+
([#1633](https://github.com/open-telemetry/opentelemetry-python/pull/1633))
30+
- Moved `use_span` from Tracer to `opentelemetry.trace.use_span`.
31+
([#1668](https://github.com/open-telemetry/opentelemetry-python/pull/1668))
32+
- `opentelemetry.trace.use_span()` will now overwrite previously set status on span in case an
33+
exception is raised inside the context manager and `set_status_on_exception` is set to `True`.
34+
([#1668](https://github.com/open-telemetry/opentelemetry-python/pull/1668))
35+
- Add `udp_split_oversized_batches` support to jaeger exporter
36+
([#1500](https://github.com/open-telemetry/opentelemetry-python/pull/1500))
37+
38+
### Changed
39+
- remove `service_name` from constructor of jaeger and opencensus exporters and
40+
use of env variable `OTEL_PYTHON_SERVICE_NAME`
41+
([#1669])(https://github.com/open-telemetry/opentelemetry-python/pull/1669)
42+
- Rename `IdsGenerator` to `IdGenerator`
43+
([#1651](https://github.com/open-telemetry/opentelemetry-python/pull/1651))
44+
- Make TracerProvider's resource attribute private
45+
([#1652](https://github.com/open-telemetry/opentelemetry-python/pull/1652))
46+
- Rename Resource's `create_empty` to `get_empty`
47+
([#1653](https://github.com/open-telemetry/opentelemetry-python/pull/1653))
48+
- Renamed `BatchExportSpanProcessor` to `BatchSpanProcessor` and `SimpleExportSpanProcessor` to
49+
`SimpleSpanProcessor`
50+
([#1656](https://github.com/open-telemetry/opentelemetry-python/pull/1656))
51+
- Rename `DefaultSpan` to `NonRecordingSpan`
52+
([#1661](https://github.com/open-telemetry/opentelemetry-python/pull/1661))
53+
- Fixed distro configuration with `OTEL_TRACES_EXPORTER` env var set to `otlp`
54+
([#1657](https://github.com/open-telemetry/opentelemetry-python/pull/1657))
55+
- Moving `Getter`, `Setter` and `TextMapPropagator` out of `opentelemetry.trace.propagation` and
56+
into `opentelemetry.propagators`
57+
([#1662](https://github.com/open-telemetry/opentelemetry-python/pull/1662))
58+
- Rename `BaggagePropagator` to `W3CBaggagePropagator`
59+
([#1663](https://github.com/open-telemetry/opentelemetry-python/pull/1663))
60+
- Rename `JaegerSpanExporter` to `JaegerExporter` and rename `ZipkinSpanExporter` to `ZipkinExporter`
61+
([#1664](https://github.com/open-telemetry/opentelemetry-python/pull/1664))
62+
- Expose `StatusCode` from the `opentelemetry.trace` module
63+
([#1681](https://github.com/open-telemetry/opentelemetry-python/pull/1681))
64+
- Status now only sets `description` when `status_code` is set to `StatusCode.ERROR`
65+
([#1673](https://github.com/open-telemetry/opentelemetry-python/pull/1673))
66+
- Update OTLP exporter to use OTLP proto `0.7.0`
67+
([#1674](https://github.com/open-telemetry/opentelemetry-python/pull/1674))
68+
- Remove time_ns from API and add a warning for older versions of Python
69+
([#1602](https://github.com/open-telemetry/opentelemetry-python/pull/1602))
70+
- Hide implementation classes/variables in api/sdk
71+
([#1684](https://github.com/open-telemetry/opentelemetry-python/pull/1684))
72+
- Cleanup OTLP exporter compression options, add tests
73+
([#1671](https://github.com/open-telemetry/opentelemetry-python/pull/1671))
74+
- Initial documentation for environment variables
75+
([#1680](https://github.com/open-telemetry/opentelemetry-python/pull/1680))
76+
- Change Zipkin exporter to obtain service.name from span
77+
([#1696](https://github.com/open-telemetry/opentelemetry-python/pull/1696))
78+
- Split up `opentelemetry-exporter-jaeger` package into `opentelemetry-exporter-jaeger-proto-grpc` and
79+
`opentelemetry-exporter-jaeger-thrift` packages to reduce dependencies for each one.
80+
([#1694](https://github.com/open-telemetry/opentelemetry-python/pull/1694))
81+
- Added `opentelemetry-exporter-otlp-proto-grpc` and changed `opentelemetry-exporter-otlp` to
82+
install it as a dependency. This will allow for the next package/protocol to also be in
83+
its own package.
84+
([#1695](https://github.com/open-telemetry/opentelemetry-python/pull/1695))
85+
- Change Jaeger exporters to obtain service.name from span
86+
([#1703](https://github.com/open-telemetry/opentelemetry-python/pull/1703))
87+
- Fixed an unset `OTEL_TRACES_EXPORTER` resulting in an error
88+
([#1707](https://github.com/open-telemetry/opentelemetry-python/pull/1707))
89+
- Split Zipkin exporter into `opentelemetry-exporter-zipkin-json` and
90+
`opentelemetry-exporter-zipkin-proto-http` packages to reduce dependencies. The
91+
`opentelemetry-exporter-zipkin` installs both.
92+
([#1699](https://github.com/open-telemetry/opentelemetry-python/pull/1699))
93+
- Make setters and getters optional
94+
([#1690](https://github.com/open-telemetry/opentelemetry-python/pull/1690))
95+
96+
### Removed
97+
- Removed unused `get_hexadecimal_trace_id` and `get_hexadecimal_span_id` methods.
98+
([#1675](https://github.com/open-telemetry/opentelemetry-python/pull/1675))
99+
- Remove `OTEL_EXPORTER_*_ INSECURE` env var
100+
([#1682](https://github.com/open-telemetry/opentelemetry-python/pull/1682))
101+
- Removing support for Python 3.5
102+
([#1706](https://github.com/open-telemetry/opentelemetry-python/pull/1706))
103+
104+
## [0.19b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v0.19b0) - 2021-03-26
105+
106+
### Changed
107+
- remove `service_name` from constructor of jaeger and opencensus exporters and
108+
use of env variable `OTEL_PYTHON_SERVICE_NAME`
109+
([#1669])(https://github.com/open-telemetry/opentelemetry-python/pull/1669)
110+
- Rename `IdsGenerator` to `IdGenerator`
111+
([#1651](https://github.com/open-telemetry/opentelemetry-python/pull/1651))
112+
113+
### Removed
114+
- Removing support for Python 3.5
115+
([#1706](https://github.com/open-telemetry/opentelemetry-python/pull/1706))
8116

9117
## [0.18b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v0.18b0) - 2021-02-16
10118

11119
### Added
12120
- Add urllib to opentelemetry-bootstrap target list
13-
([#1584])(https://github.com/open-telemetry/opentelemetry-python/pull/1584)
121+
([#1584](https://github.com/open-telemetry/opentelemetry-python/pull/1584))
14122

15123
## [1.0.0rc1](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.0.0rc1) - 2021-02-12
16124

17125
### Changed
18126
- Tracer provider environment variables are now consistent with the rest
19-
([#1571](https://github.com/open-telemetry/opentelemetry-python/pull/1571)])
127+
([#1571](https://github.com/open-telemetry/opentelemetry-python/pull/1571))
20128
- Rename `TRACE_` to `TRACES_` for environment variables
21-
([#1595](https://github.com/open-telemetry/opentelemetry-python/pull/1595)])
129+
([#1595](https://github.com/open-telemetry/opentelemetry-python/pull/1595))
22130
- Limits for Span attributes, events and links have been updated to 128
23-
([1597](https://github.com/open-telemetry/opentelemetry-python/pull/1597)])
131+
([1597](https://github.com/open-telemetry/opentelemetry-python/pull/1597))
24132
- Read-only Span attributes have been moved to ReadableSpan class
25133
([#1560](https://github.com/open-telemetry/opentelemetry-python/pull/1560))
26134
- `BatchExportSpanProcessor` flushes export queue when it reaches `max_export_batch_size`
27-
([#1521])(https://github.com/open-telemetry/opentelemetry-python/pull/1521)
135+
([#1521](https://github.com/open-telemetry/opentelemetry-python/pull/1521))
28136

29137
### Added
30138
- Added `end_on_exit` argument to `start_as_current_span`
31-
([#1519](https://github.com/open-telemetry/opentelemetry-python/pull/1519)])
139+
([#1519](https://github.com/open-telemetry/opentelemetry-python/pull/1519))
32140
- Add `Span.set_attributes` method to set multiple values with one call
33141
([#1520](https://github.com/open-telemetry/opentelemetry-python/pull/1520))
34142
- Make sure Resources follow semantic conventions
@@ -68,7 +176,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
68176
- `opentelemetry-exporter-zipkin` Add support for array attributes in Span and Resource exports
69177
([#1285](https://github.com/open-telemetry/opentelemetry-python/pull/1285))
70178
- Added `__repr__` for `DefaultSpan`, added `trace_flags` to `__repr__` of
71-
`SpanContext` ([#1485](https://github.com/open-telemetry/opentelemetry-python/pull/1485)])
179+
`SpanContext` ([#1485](https://github.com/open-telemetry/opentelemetry-python/pull/1485))
72180
- `opentelemetry-sdk` Add support for OTEL_TRACE_SAMPLER and OTEL_TRACE_SAMPLER_ARG env variables
73181
([#1496](https://github.com/open-telemetry/opentelemetry-python/pull/1496))
74182
- Adding `opentelemetry-distro` package to add default configuration for

CONTRIBUTING.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ information on this and other language SIGs.
66

77
See the [public meeting notes](https://docs.google.com/document/d/1CIMGoIOZ-c3-igzbd6_Pnxx1SjAkjwqoYSUWxPY8XIs/edit)
88
for a summary description of past meetings. To request edit access, join the
9-
meeting or get in touch on [Gitter](https://gitter.im/open-telemetry/opentelemetry-python).
9+
meeting or get in touch on [Slack](https://cloud-native.slack.com/archives/C01PD4HUVBL).
1010

1111
See to the [community membership document](https://github.com/open-telemetry/community/blob/main/community-membership.md)
1212
on how to become a [**Member**](https://github.com/open-telemetry/community/blob/main/community-membership.md#member),
@@ -20,7 +20,7 @@ Please take a look at this list first, your contributions may belong in one of t
2020

2121
1. [OpenTelemetry Contrib](https://github.com/open-telemetry/opentelemetry-python-contrib): Instrumentations for third-party
2222
libraries and frameworks. There is an ongoing effort to migrate into the Opentelemetry Contrib repo some of the existing
23-
programmatic instrumentations that are now in the `ext` directory in the main OpenTelemetry repo. Please ask in the Gitter
23+
programmatic instrumentations that are now in the `ext` directory in the main OpenTelemetry repo. Please ask in the Slack
2424
channel (see below) for guidance if you want to contribute with these instrumentations.
2525

2626
# Find the right branch
@@ -30,12 +30,15 @@ The default branch for this repo is `main`. Changes that pertain to `metrics` go
3030
## Find a Buddy and get Started Quickly!
3131

3232
If you are looking for someone to help you find a starting point and be a resource for your first contribution, join our
33-
Gitter and find a buddy!
33+
Slack and find a buddy!
3434

35-
1. Join [Gitter.im](https://gitter.im) and join our [chat room](https://gitter.im/open-telemetry/opentelemetry-python).
35+
1. Join [Slack](https://slack.cncf.io/) and join our [channel](https://cloud-native.slack.com/archives/C01PD4HUVBL).
3636
2. Post in the room with an introduction to yourself, what area you are interested in (check issues marked "Help Wanted"),
3737
and say you are looking for a buddy. We will match you with someone who has experience in that area.
3838

39+
The Slack channel will be used for introductions and an entry point for external people to be triaged and redirected. For
40+
discussions, please open up an issue or a Github [Discussion](https://github.com/open-telemetry/opentelemetry-python/discussions).
41+
3942
Your OpenTelemetry buddy is your resource to talk to directly on all aspects of contributing to OpenTelemetry: providing
4043
context, reviewing PRs, and helping those get merged. Buddies will not be available 24/7, but is committed to responding
4144
during their normal contribution hours.

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040

4141
This page describes the Python [OpenTelemetry](https://opentelemetry.io/) implementation. OpenTelemetry is an observability framework for cloud-native software.
4242

43+
## Requirements
44+
Unless otherwise noted, all published artifacts support Python 3.6 or higher. See CONTRIBUTING.md for additional instructions for building this project for development.
45+
4346
## Getting started
4447

4548
The goal of OpenTelemetry is to provide a single set of APIs to capture distributed traces and metrics from your application and send them to an observability platform. This project lets you do just that for applications written in Python.
@@ -98,11 +101,15 @@ machine.
98101

99102
1. Install scalene using the following command
100103

101-
`pip install scalene`
104+
```sh
105+
pip install scalene
106+
```
102107

103108
2. Run the `scalene` tests on any of the example Python programs
104109

105-
`scalene opentelemetry-<PACKAGE>/tests/performance/resource-usage/<PATH_TO_TEST>/profile_resource_usage_<NAME_OF_TEST>.py`
110+
```sh
111+
scalene opentelemetry-<PACKAGE>/tests/performance/resource-usage/<PATH_TO_TEST>/profile_resource_usage_<NAME_OF_TEST>.py
112+
```
106113

107114

108115
## Documentation
@@ -124,13 +131,10 @@ Meeting notes are available as a public [Google doc](https://docs.google.com/doc
124131
Approvers ([@open-telemetry/python-approvers](https://github.com/orgs/open-telemetry/teams/python-approvers)):
125132

126133
- [Aaron Abbott](https://github.com/aabmass), Google
127-
- [Carlos Alberto Cortez](https://github.com/carlosalberto), Lightstep
128-
- [Tahir H. Butt](https://github.com/majorgreys) DataDog
129-
- [Chris Kleinknecht](https://github.com/c24t), Google
130134
- [Diego Hurtado](https://github.com/ocelotl)
131135
- [Hector Hernandez](https://github.com/hectorhdzg), Microsoft
132136
- [Owais Lone](https://github.com/owais), Splunk
133-
- [Reiley Yang](https://github.com/reyang), Microsoft
137+
- [Srikanth Chekuri](https://github.com/lonewolf3739)
134138
- [Yusuke Tsutsumi](https://github.com/toumorokoshi), Google
135139

136140
*For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver).*

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ flake8~=3.7
33
isort~=5.6
44
black>=19.3b0,==19.*
55
httpretty~=1.0
6-
mypy==0.790
6+
mypy==0.812
77
sphinx~=2.1
88
sphinx-rtd-theme~=0.4
99
sphinx-autodoc-typehints~=1.10.2

docs/conf.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,12 @@
101101
# Even if wrapt is added to intersphinx_mapping, sphinx keeps failing
102102
# with "class reference target not found: ObjectProxy".
103103
("py:class", "ObjectProxy"),
104+
("py:class", "opentelemetry.trace._LinkBase",),
104105
# TODO: Understand why sphinx is not able to find this local class
105-
("py:class", "opentelemetry.trace.propagation.textmap.TextMapPropagator",),
106-
("py:class", "opentelemetry.trace.propagation.textmap.DictGetter",),
107-
(
108-
"any",
109-
"opentelemetry.trace.propagation.textmap.TextMapPropagator.extract",
110-
),
111-
(
112-
"any",
113-
"opentelemetry.trace.propagation.textmap.TextMapPropagator.inject",
114-
),
106+
("py:class", "opentelemetry.propagators.textmap.TextMapPropagator",),
107+
("py:class", "opentelemetry.propagators.textmap.DefaultGetter",),
108+
("any", "opentelemetry.propagators.textmap.TextMapPropagator.extract",),
109+
("any", "opentelemetry.propagators.textmap.TextMapPropagator.inject",),
115110
]
116111

117112
# Add any paths that contain templates here, relative to this directory.

docs/examples/auto-instrumentation/README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ Manually instrumented server
3737
def server_request():
3838
with tracer.start_as_current_span(
3939
"server_request",
40-
context=propagators.extract(DictGetter(), request.headers
41-
),
40+
context=propagators.extract(request.headers),
4241
):
4342
print(request.args.get("param"))
4443
return "served"
@@ -151,7 +150,7 @@ and run the following command instead:
151150

152151
.. code:: sh
153152
154-
$ opentelemetry-instrument -e console_span,console_metrics python server_uninstrumented.py
153+
$ opentelemetry-instrument --trace-exporter console_span --metrics-exporter console_metrics python server_uninstrumented.py
155154
156155
In the console where you previously executed ``client.py``, run the following
157156
command again:

0 commit comments

Comments
 (0)