Skip to content

Commit c8dbcf1

Browse files
authored
Merge branch 'main' into docs/periodic-exporting-metric-reader-ref
2 parents 0faddaf + 26c7166 commit c8dbcf1

43 files changed

Lines changed: 2390 additions & 116 deletions

Some content is hidden

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

.github/workflows/stale.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Mark stale PRs
2+
3+
on:
4+
schedule:
5+
- cron: "12 3 * * *"
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
stale:
13+
permissions:
14+
contents: read
15+
issues: write
16+
pull-requests: write
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
20+
with:
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
days-before-pr-stale: 14
23+
days-before-pr-close: 14
24+
days-before-issue-stale: -1
25+
days-before-issue-close: -1
26+
stale-pr-message: >
27+
This PR has been automatically marked as stale because it has not had
28+
any activity for 14 days. It will be closed if no further activity
29+
occurs within 14 days of this comment.
30+
31+
If you're still working on this, please add a comment or push new commits.
32+
close-pr-message: >
33+
This PR has been closed due to inactivity. Please reopen if you would
34+
like to continue working on it.
35+
exempt-pr-labels: "hold,WIP,blocked by spec,do not merge"

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ignore=CVS,gen,proto
1111

1212
# Add files or directories matching the regex patterns to be excluded. The
1313
# regex matches against base names, not paths.
14-
ignore-patterns=
14+
ignore-patterns=^models\.py$
1515

1616
# Python code to execute, usually for sys.path manipulation such as
1717
# pygtk.require().

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
## Unreleased
1414

15+
- `opentelemetry-sdk`: deprecate `LoggingHandler` in favor of `opentelemetry-instrumentation-logging`, see `opentelemetry-instrumentation-logging` documentation
16+
([#4919](https://github.com/open-telemetry/opentelemetry-python/pull/4919))
17+
- `opentelemetry-sdk`: Clarify log processor error handling expectations in documentation
18+
([#4915](https://github.com/open-telemetry/opentelemetry-python/pull/4915))
19+
- bump semantic-conventions to v1.40.0
20+
([#4941](https://github.com/open-telemetry/opentelemetry-python/pull/4941))
21+
- Add stale PR GitHub Action
22+
([#4926](https://github.com/open-telemetry/opentelemetry-python/pull/4926))
1523
- `opentelemetry-sdk`: Drop unused Jaeger exporter environment variables (exporter removed in 1.22.0)
1624
([#4918](https://github.com/open-telemetry/opentelemetry-python/issues/4918))
1725
- `opentelemetry-sdk`: Clarify timeout units in environment variable documentation
@@ -52,6 +60,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5260
([#4913](https://github.com/open-telemetry/opentelemetry-python/pull/4913))
5361
- bump semantic-conventions to v1.39.0
5462
([#4914](https://github.com/open-telemetry/opentelemetry-python/pull/4914))
63+
- `opentelemetry-sdk`: automatically generate configuration models using OTel config JSON schema
64+
([#4879](https://github.com/open-telemetry/opentelemetry-python/pull/4879))
5565

5666
## Version 1.39.0/0.60b0 (2025-12-03)
5767

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ Please fork this repo in a personal Github account instead.
291291

292292
One of the maintainers will merge the PR once it is **ready to merge**.
293293

294+
### Stale PRs
295+
296+
PRs with no activity for 14 days will be automatically marked as stale and closed after a further 14 days of inactivity. To prevent a PR from being marked stale, ensure there is regular activity (commits, comments, reviews, etc).
297+
298+
Project managers can also exempt a PR from this by applying one of the following labels: `hold`, `WIP`, `blocked by spec`, `do not merge`.
299+
294300
## Design Choices
295301

296302
As with other OpenTelemetry clients, opentelemetry-python follows the

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ For more information about the maintainer role, see the [community repository](h
116116
- [Héctor Hernández](https://github.com/hectorhdzg), Microsoft
117117
- [Jeremy Voss](https://github.com/jeremydvoss), Microsoft
118118
- [Liudmila Molkova](https://github.com/lmolkova), Grafana Labs
119+
- [Lukas Hering](https://github.com/herin049), Capital One
119120
- [Owais Lone](https://github.com/owais), Splunk
120121
- [Pablo Collins](https://github.com/pmcollins), Splunk
121122
- [Shalev Roda](https://github.com/shalevr), Cisco

docs/examples/logs/example.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
from opentelemetry.exporter.otlp.proto.grpc._log_exporter import (
66
OTLPLogExporter,
77
)
8-
from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
8+
9+
# this is available in the opentelemetry-instrumentation-logging package
10+
from opentelemetry.instrumentation.logging.handler import LoggingHandler
11+
from opentelemetry.sdk._logs import LoggerProvider
912
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
1013
from opentelemetry.sdk.resources import Resource
1114
from opentelemetry.sdk.trace import TracerProvider

opentelemetry-api/src/opentelemetry/metrics/_internal/instrument.py

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,14 @@ def add(
183183
attributes: Optional[Attributes] = None,
184184
context: Optional[Context] = None,
185185
) -> None:
186-
pass
186+
"""Records an increment to the counter.
187+
188+
Args:
189+
amount: The amount to increment the counter by. Must be non-negative.
190+
attributes: Optional set of attributes to associate with the measurement.
191+
context: Optional context to associate with the measurement. If not
192+
provided, the current context is used.
193+
"""
187194

188195

189196
class NoOpCounter(Counter):
@@ -234,7 +241,18 @@ def add(
234241
attributes: Optional[Attributes] = None,
235242
context: Optional[Context] = None,
236243
) -> None:
237-
pass
244+
"""Records an increment or decrement to the counter.
245+
246+
Unlike `Counter`, the ``amount`` may be negative, allowing the
247+
instrument to track values that go up and down (e.g. number of
248+
active requests, queue depth).
249+
250+
Args:
251+
amount: The amount to add to the counter. May be positive or negative.
252+
attributes: Optional set of attributes to associate with the measurement.
253+
context: Optional context to associate with the measurement. If not
254+
provided, the current context is used.
255+
"""
238256

239257

240258
class NoOpUpDownCounter(UpDownCounter):
@@ -376,7 +394,20 @@ def record(
376394
attributes: Optional[Attributes] = None,
377395
context: Optional[Context] = None,
378396
) -> None:
379-
pass
397+
"""Records a measurement.
398+
399+
Used to report measurements that are likely to be statistically
400+
meaningful, such as request durations, payload sizes, or any value
401+
for which a distribution (e.g. percentiles) is useful.
402+
403+
Args:
404+
amount: The measurement to record. Should be non-negative in most
405+
cases; negative values are only meaningful when the histogram
406+
is used to track signed deltas.
407+
attributes: Optional set of attributes to associate with the measurement.
408+
context: Optional context to associate with the measurement. If not
409+
provided, the current context is used.
410+
"""
380411

381412

382413
class NoOpHistogram(Histogram):
@@ -486,7 +517,18 @@ def set(
486517
attributes: Optional[Attributes] = None,
487518
context: Optional[Context] = None,
488519
) -> None:
489-
pass
520+
"""Records the current value of the gauge.
521+
522+
The gauge reports the last recorded value when observed. It is
523+
intended for non-additive measurements where only the current
524+
value matters (e.g. CPU utilisation percentage, room temperature).
525+
526+
Args:
527+
amount: The current value to record.
528+
attributes: Optional set of attributes to associate with the measurement.
529+
context: Optional context to associate with the measurement. If not
530+
provided, the current context is used.
531+
"""
490532

491533

492534
class NoOpGauge(Gauge):

opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,13 @@ def _init_logging(
326326
set_event_logger_provider(event_logger_provider)
327327

328328
if setup_logging_handler:
329+
warnings.warn(
330+
"The `OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED` environment variable "
331+
"and the `LoggingHandler` in `opentelemetry-sdk` that it controls are deprecated."
332+
"Install `opentelemetry-instrumentation-logging` package instead.",
333+
DeprecationWarning,
334+
)
335+
329336
# Add OTel handler
330337
handler = LoggingHandler(
331338
level=logging.NOTSET, logger_provider=provider

0 commit comments

Comments
 (0)