Skip to content

Commit 9837531

Browse files
committed
sdk: add type annotations to resource detectors
1 parent 4b32917 commit 9837531

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/elasticotel/sdk/resources/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
from opentelemetry.semconv._incubating.attributes import telemetry_attributes
2020
from opentelemetry.sdk.resources import (
21+
Attributes,
2122
Resource,
2223
ResourceDetector,
2324
PROCESS_RUNTIME_DESCRIPTION,
@@ -42,7 +43,7 @@ def detect(self) -> "Resource":
4243
),
4344
)
4445
)
45-
resource_info = {
46+
resource_info: Attributes = {
4647
PROCESS_RUNTIME_DESCRIPTION: sys.version,
4748
PROCESS_RUNTIME_NAME: sys.implementation.name,
4849
PROCESS_RUNTIME_VERSION: runtime_version,
@@ -54,7 +55,7 @@ class TelemetryDistroResourceDetector(ResourceDetector):
5455
"""Resource detector to fill telemetry.distro attributes"""
5556

5657
def detect(self) -> "Resource":
57-
resource_info = {
58+
resource_info: Attributes = {
5859
telemetry_attributes.TELEMETRY_DISTRO_NAME: "elastic",
5960
telemetry_attributes.TELEMETRY_DISTRO_VERSION: version.__version__,
6061
}

0 commit comments

Comments
 (0)