Skip to content

Commit 4e84e2d

Browse files
Merge branch 'main' into otlp-http-metrics-export-max-batch
2 parents a3913ae + 64de448 commit 4e84e2d

File tree

71 files changed

+3086
-257
lines changed

Some content is hidden

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

71 files changed

+3086
-257
lines changed

.github/workflows/benchmarks.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ jobs:
1111
sdk-benchmarks:
1212
permissions:
1313
contents: write # required for pushing to gh-pages
14-
runs-on: equinix-bare-metal
14+
runs-on: oracle-bare-metal-64cpu-512gb-x86-64
15+
container:
16+
image: python:3.13-slim
1517
steps:
18+
- name: Install Git # since Git isn't available in the container image used above
19+
run: |
20+
apt-get update
21+
apt-get install -y git
22+
- name: Make repo safe for Git inside container
23+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
1624
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
1725
uses: actions/checkout@v4
18-
- name: Set up Python
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version: "3.13"
22-
architecture: 'x64'
2326
- name: Install tox
2427
run: pip install tox-uv
2528
- name: Run tox

CHANGELOG.md

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

8+
**Breaking changes ongoing**
9+
10+
> [!IMPORTANT]
11+
> We are working on stabilizing the Log signal that would require making deprecations and breaking changes. We will try to reduce the releases that may require an update to your code, especially for instrumentations or for sdk developers.
12+
813
## Unreleased
914

15+
- Add experimental composite samplers
16+
([#4714](https://github.com/open-telemetry/opentelemetry-python/pull/4714))
17+
- Filter duplicate logs out of some internal `logger`'s logs on the export logs path that might otherwise endlessly log or cause a recursion depth exceeded issue in cases where logging itself results in an exception.
18+
([#4695](https://github.com/open-telemetry/opentelemetry-python/pull/4695)).
19+
- docs: linked the examples with their github source code location and added Prometheus example
20+
([#4728](https://github.com/open-telemetry/opentelemetry-python/pull/4728))
21+
- Permit to override default HTTP OTLP exporters headers
22+
([#4634](https://github.com/open-telemetry/opentelemetry-python/pull/4634))
23+
- semantic-conventions: Bump to 1.37.0
24+
([#4731](https://github.com/open-telemetry/opentelemetry-python/pull/4731))
1025
- Add configurable `max_export_batch_size` to OTLP HTTP metrics exporter
1126
([#4576](https://github.com/open-telemetry/opentelemetry-python/pull/4576))
1227

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# OpenTelemetry Python
22
[![Slack](https://img.shields.io/badge/slack-@cncf/otel/python-brightgreen.svg?logo=slack)](https://cloud-native.slack.com/archives/C01PD4HUVBL)
33
[![Build Status 0](https://github.com/open-telemetry/opentelemetry-python/actions/workflows/test_0.yml/badge.svg?branch=main)](https://github.com/open-telemetry/opentelemetry-python/actions/workflows/test_0.yml)
4-
[![Build Status 1](https://github.com/open-telemetry/opentelemetry-python/actions/workflows/test_1.yml/badge.svg?branch=main)](https://github.com/open-telemetry/opentelemetry-python/actions/workflows/test_1.yml)
54
[![Minimum Python Version](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
65
[![Release](https://img.shields.io/github/v/release/open-telemetry/opentelemetry-python?include_prereleases&style=)](https://github.com/open-telemetry/opentelemetry-python/releases/)
76
[![Read the Docs](https://readthedocs.org/projects/opentelemetry-python/badge/?version=latest)](https://opentelemetry-python.readthedocs.io/en/latest/)
7+
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/11060/badge)](https://www.bestpractices.dev/projects/11060)
88

99
## Project Status
1010

@@ -14,10 +14,15 @@ See the [OpenTelemetry Instrumentation for Python](https://opentelemetry.io/docs
1414
| ------- | ------------ | ------- |
1515
| Traces | Stable | N/A |
1616
| Metrics | Stable | N/A |
17-
| Logs | Experimental | N/A |
17+
| Logs | Development* | N/A |
1818

1919
Project versioning information and stability guarantees can be found [here](./rationale.md#versioning-and-releasing).
2020

21+
***Breaking Changes**
22+
23+
> [!IMPORTANT]
24+
> We are working on stabilizing the Log signal which would require making deprecations and breaking changes. We will try to reduce the releases that may require an update to your code, especially for instrumentations or for SDK developers.
25+
2126
## Getting started
2227

2328
You can find the getting started guide for OpenTelemetry Python [here](https://opentelemetry.io/docs/instrumentation/python/getting-started/).
@@ -98,14 +103,14 @@ Meeting notes are available as a public [Google doc](https://docs.google.com/doc
98103
### Maintainers
99104

100105
- [Aaron Abbott](https://github.com/aabmass), Google
101-
- [Diego Hurtado](https://github.com/ocelotl), Lightstep
102106
- [Leighton Chen](https://github.com/lzchen), Microsoft
103107
- [Riccardo Magliocchetti](https://github.com/xrmx), Elastic
104108

105109
For more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer).
106110

107111
### Approvers
108112

113+
- [Dylan Russell](https://github.com/dylanrussell), Google
109114
- [Emídio Neto](https://github.com/emdneto), PicPay
110115
- [Jeremy Voss](https://github.com/jeremydvoss), Microsoft
111116
- [Owais Lone](https://github.com/owais), Splunk
@@ -120,6 +125,7 @@ For more information about the approver role, see the [community repository](htt
120125

121126
- [Alex Boten](https://github.com/codeboten)
122127
- [Chris Kleinknecht](https://github.com/c24t)
128+
- [Diego Hurtado](https://github.com/ocelotl), Lightstep
123129
- [Owais Lone](https://github.com/owais)
124130
- [Reiley Yang](https://github.com/reyang)
125131
- [Srikanth Chekuri](https://github.com/srikanthccv)

docs/examples/auto-instrumentation/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from sys import argv
15+
import sys
1616

1717
from requests import get
1818

@@ -31,16 +31,16 @@
3131
BatchSpanProcessor(ConsoleSpanExporter())
3232
)
3333

34-
35-
assert len(argv) == 2
34+
# Get parameter from command line argument or use default value "testing"
35+
param_value = sys.argv[1] if len(sys.argv) > 1 else "testing"
3636

3737
with tracer.start_as_current_span("client"):
3838
with tracer.start_as_current_span("client-server"):
3939
headers = {}
4040
inject(headers)
4141
requested = get(
4242
"http://localhost:8082/server_request",
43-
params={"param": argv[1]},
43+
params={"param": param_value},
4444
headers=headers,
4545
)
4646

docs/examples/django/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Django Instrumentation
44
This shows how to use ``opentelemetry-instrumentation-django`` to automatically instrument a
55
Django app.
66

7-
For more user convenience, a Django app is already provided in this directory.
7+
The source files of these examples are available :scm_web:`here <docs/examples/django/>`.
88

99
Preparation
1010
-----------

docs/examples/error_handler/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Overview
66

77
This example shows how to use the global error handler.
88

9+
The source files of these examples are available :scm_web:`here <docs/examples/error_handler/>`.
910

1011
Preparation
1112
-----------

docs/examples/fork-process-model/README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ get around this limitation of the span processor.
1010
Please see http://bugs.python.org/issue6721 for the problems about Python locks in (multi)threaded
1111
context with fork.
1212

13+
The source code for the examples with Flask app are available :scm_web:`here <docs/examples/fork-process-model/>`.
14+
1315
Gunicorn post_fork hook
1416
-----------------------
1517

@@ -61,6 +63,3 @@ uWSGI postfork decorator
6163
OTLPSpanExporter(endpoint="http://localhost:4317")
6264
)
6365
trace.get_tracer_provider().add_span_processor(span_processor)
64-
65-
66-
The source code for the examples with Flask app are available :scm_web:`here <docs/examples/fork-process-model/>`.

docs/examples/logs/README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ OpenTelemetry Logs SDK
66
:mod:`opentelemetry.sdk._logs` are subject to change in minor/patch releases and make no
77
backward compatibility guarantees at this time.
88

9+
The source files of these examples are available :scm_web:`here <docs/examples/logs/>`.
10+
911
Start the Collector locally to see data being exported. Write the following file:
1012

1113
.. code-block:: yaml

docs/examples/metrics/instruments/README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
OpenTelemetry Metrics SDK
22
=========================
33

4+
The source files of these examples are available :scm_web:`here <docs/examples/metrics/instruments/>`.
5+
46
Start the Collector locally to see data being exported. Write the following file:
57

68
.. code-block:: yaml
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Prometheus Instrumentation
2+
==========================
3+
4+
This shows how to use ``opentelemetry-exporter-prometheus`` to automatically generate Prometheus metrics.
5+
6+
The source files of these examples are available :scm_web:`here <docs/examples/prometheus-grafana/>`.
7+
8+
Preparation
9+
-----------
10+
11+
This example will be executed in a separate virtual environment:
12+
13+
.. code-block::
14+
15+
$ mkdir prometheus_auto_instrumentation
16+
$ virtualenv prometheus_auto_instrumentation
17+
$ source prometheus_auto_instrumentation/bin/activate
18+
19+
20+
Installation
21+
------------
22+
23+
.. code-block::
24+
25+
$ pip install -r requirements.txt
26+
27+
28+
Execution
29+
---------
30+
31+
.. code-block::
32+
33+
$ python ./prometheus-monitor.py
34+
$ Server is running at http://localhost:8000
35+
36+
Now you can visit http://localhost:8000/metrics to see Prometheus metrics.
37+
You should see something like:
38+
39+
.. code-block::
40+
41+
# HELP python_gc_objects_collected_total Objects collected during gc
42+
# TYPE python_gc_objects_collected_total counter
43+
python_gc_objects_collected_total{generation="0"} 320.0
44+
python_gc_objects_collected_total{generation="1"} 58.0
45+
python_gc_objects_collected_total{generation="2"} 0.0
46+
# HELP python_gc_objects_uncollectable_total Uncollectable objects found during GC
47+
# TYPE python_gc_objects_uncollectable_total counter
48+
python_gc_objects_uncollectable_total{generation="0"} 0.0
49+
python_gc_objects_uncollectable_total{generation="1"} 0.0
50+
python_gc_objects_uncollectable_total{generation="2"} 0.0
51+
# HELP python_gc_collections_total Number of times this generation was collected
52+
# TYPE python_gc_collections_total counter
53+
python_gc_collections_total{generation="0"} 61.0
54+
python_gc_collections_total{generation="1"} 5.0
55+
python_gc_collections_total{generation="2"} 0.0
56+
# HELP python_info Python platform information
57+
# TYPE python_info gauge
58+
python_info{implementation="CPython",major="3",minor="8",patchlevel="5",version="3.8.5"} 1.0
59+
# HELP MyAppPrefix_my_counter_total
60+
# TYPE MyAppPrefix_my_counter_total counter
61+
MyAppPrefix_my_counter_total 964.0
62+
63+
``MyAppPrefix_my_counter_total`` is the custom counter created in the application with the custom prefix ``MyAppPrefix``.

0 commit comments

Comments
 (0)