Skip to content

Commit 03ea10a

Browse files
authored
Merge branch 'main' into kludex/fix-type-hints-on-opentelemetry-instrumentation
2 parents 3aff468 + 3e394a4 commit 03ea10a

File tree

4 files changed

+12
-8
lines changed
  • instrumentation
    • opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3
    • opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics

4 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
([#3100](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3100))
1818
- Add support to database stability opt-in in `_semconv` utilities and add tests
1919
([#3111](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3111))
20+
- `opentelemetry-instrumentation-system-metrics` Add `py.typed` file to enable PEP 561
21+
([#3132](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3132))
22+
- `opentelemetry-opentelemetry-sqlite3` Add `py.typed` file to enable PEP 561
23+
([#3133](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3133))
2024
- `opentelemetry-instrumentation-falcon` add support version to v4
2125
([#3086](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3086))
2226
- add support to Python 3.13

instrumentation/opentelemetry-instrumentation-sqlite3/src/opentelemetry/instrumentation/sqlite3/py.typed

Whitespace-only changes.

instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@
7676
---
7777
"""
7878

79+
from __future__ import annotations
80+
7981
import gc
8082
import logging
8183
import os
8284
import sys
8385
import threading
8486
from platform import python_implementation
85-
from typing import Collection, Dict, Iterable, List, Optional
87+
from typing import Any, Collection, Iterable
8688

8789
import psutil
8890

89-
# FIXME Remove this pylint disabling line when Github issue is cleared
90-
# pylint: disable=no-name-in-module
9191
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
9292
from opentelemetry.instrumentation.system_metrics.package import _instruments
9393
from opentelemetry.instrumentation.system_metrics.version import __version__
@@ -96,7 +96,7 @@
9696
_logger = logging.getLogger(__name__)
9797

9898

99-
_DEFAULT_CONFIG = {
99+
_DEFAULT_CONFIG: dict[str, list[str] | None] = {
100100
"system.cpu.time": ["idle", "user", "system", "irq"],
101101
"system.cpu.utilization": ["idle", "user", "system", "irq"],
102102
"system.memory.usage": ["used", "free", "cached"],
@@ -129,8 +129,8 @@
129129
class SystemMetricsInstrumentor(BaseInstrumentor):
130130
def __init__(
131131
self,
132-
labels: Optional[Dict[str, str]] = None,
133-
config: Optional[Dict[str, List[str]]] = None,
132+
labels: dict[str, str] | None = None,
133+
config: dict[str, list[str] | None] | None = None,
134134
):
135135
super().__init__()
136136
if config is None:
@@ -176,7 +176,7 @@ def __init__(
176176
def instrumentation_dependencies(self) -> Collection[str]:
177177
return _instruments
178178

179-
def _instrument(self, **kwargs):
179+
def _instrument(self, **kwargs: Any):
180180
# pylint: disable=too-many-branches
181181
meter_provider = kwargs.get("meter_provider")
182182
self._meter = get_meter(
@@ -408,7 +408,7 @@ def _instrument(self, **kwargs):
408408
description="Number of file descriptors in use by the process.",
409409
)
410410

411-
def _uninstrument(self, **__):
411+
def _uninstrument(self, **kwargs: Any):
412412
pass
413413

414414
def _get_open_file_descriptors(

instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)