Skip to content

[FEATURE]: Opt out of service name defaulting #17934

@jbw-vtl

Description

@jbw-vtl

Package Name

No response

Package Version(s)

No response

Describe the goal of the feature

We are reviewing using ddtrace for user level / clientside / workstation level tracing of python library function usage.
These will be environments without DD_SERVICE defined and generally non service environment.

At some point over v3, ddtrace started automatically detecting service names based on e.g. the folder name of the command running the script, populating the base service field.
I understand this might be desirable for apps rather than having no service name / undefined-python-service, however sometimes this behaviour is not wanted and seems fairly intrusive.

We are explicitly sending the service tag in our custom traces which is being reported successfully, however would like to somehow opt-out / disable the base service detection for such environments.

Currently we are leveraging fairly invasive monkey patching & the wrapt library with a pattern such as below

@wrapt.when_imported("ddtrace.internal.schema")
def _patch_ddtrace_service_name_defaulting(ddtrace_internal_schema: ModuleType) -> None:
    ddtrace_internal_schema.DEFAULT_SPAN_SERVICE_NAME = None
Image

Is your feature request related to a problem?

No response

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions