Skip to content

Tracing report levels #208

@brettlangdon

Description

@brettlangdon

It might be nice to be able to define a tracing reporting level, like a log level, to traces and then set a global "trace level".

My reasoning here is there are some cases in development/testing where I want to trace many more things to be able to debug a specific problem or performance issue. However, these traces are just too much/noisy to leave in for production.

Not sure if there is already a way to handle such a case? Unless I create a separate Tracer instance and just enable/disable that one as needed?

from ddtrace import tracer

# report all traces of level 'debug' or higher
tracer.set_level('debug')

# Trace this function only when level is 'debug'
@tracer.wrap(level='debug')
def child():
    pass


# Always trace this function
@tracer.wrap()
def parent():
    child()


with tracer.trace('main', service='main'):
    parent()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions