Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions solarwinds_apm/apm_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import os
import re
from functools import reduce
from typing import Any
from typing import Any, Optional

from opentelemetry.environment_variables import OTEL_PROPAGATORS
from opentelemetry.sdk.resources import Resource
Expand Down Expand Up @@ -91,17 +91,20 @@ class SolarWindsApmConfig:

def __init__(
self,
otel_resource: Resource = Resource.create(),
otel_resource: Optional[Resource] = None, # noqa: UP045
**kwargs: int,
) -> None:
"""Initialize SolarWinds APM configuration.

Parameters:
otel_resource (Resource): OpenTelemetry resource with detector attributes.
otel_resource (Optional[Resource]): OpenTelemetry resource with detector attributes.
In normal usage, passed from Configurator after detector resource created.
Defaults to Resource.create() for backward compatibility.
Defaults to None; Resource.create() is called at runtime for backward compatibility.
**kwargs (int): Additional configuration keyword arguments.
"""
if otel_resource is None:
otel_resource = Resource.create()

self.__config = {}
# Update the config with default values
self.__config = {
Expand Down
Loading