Skip to content

Commit

Permalink
chore: add telemetry item for instrumentation config id
Browse files Browse the repository at this point in the history
When enabling library injection remotely, we'd like to see which
services have been instrumented as a result. To do this we are proposing
to submit the configuration ID that was used to instrument the service.
  • Loading branch information
Kyle-Verhoog committed May 2, 2024
1 parent 7a55b3e commit e1347b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ddtrace/internal/telemetry/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,11 @@ 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"]
if "DD_INSTRUMENTATION_CONFIG_ID" in os.environ:
package_source_entry[1] = os.environ["DD_INSTRUMENTATION_CONFIG_ID"]
package_source_entry[2] = "environment"

self.add_configurations(
[
self._telemetry_entry("_trace_enabled"),
Expand All @@ -435,6 +440,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,
(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 e1347b5

Please sign in to comment.