Skip to content

Commit

Permalink
avoid casting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Verhoog committed May 2, 2024
1 parent b9a145a commit 8b1320b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ddtrace/internal/telemetry/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
import time
from types import ModuleType
from typing import cast
from typing import TYPE_CHECKING # noqa:F401
from typing import Any # noqa:F401
from typing import Dict # noqa:F401
Expand Down Expand Up @@ -423,11 +422,13 @@ def _app_started_event(self, register_app_shutdown=True):
if register_app_shutdown:
atexit.register(self.app_shutdown)

package_source_entry = ["instrumentation_config_id", "", "default"]
inst_config_id_entry = ("instrumentation_config_id", "", "default")
if "DD_INSTRUMENTATION_CONFIG_ID" in os.environ:
package_source_entry[1] = os.environ["DD_INSTRUMENTATION_CONFIG_ID"]
package_source_entry[2] = "environment"
package_source_entry_t = cast(Tuple[str, str, str], tuple(package_source_entry))
inst_config_id_entry = (
"instrumentation_config_id",
os.environ["DD_INSTRUMENTATION_CONFIG_ID"],
"environment",
)

self.add_configurations(
[
Expand All @@ -442,7 +443,7 @@ def _app_started_event(self, register_app_shutdown=True):
self._telemetry_entry("trace_http_header_tags"),
self._telemetry_entry("tags"),
self._telemetry_entry("_tracing_enabled"),
package_source_entry_t,
inst_config_id_entry,
(TELEMETRY_STARTUP_LOGS_ENABLED, config._startup_logs_enabled, "unknown"),
(TELEMETRY_DYNAMIC_INSTRUMENTATION_ENABLED, di_config.enabled, "unknown"),
(TELEMETRY_EXCEPTION_DEBUGGING_ENABLED, ed_config.enabled, "unknown"),
Expand Down

0 comments on commit 8b1320b

Please sign in to comment.