Skip to content

Way to disable logging for certain code paths (scheduled jobs, etc.) #1897

Closed
@paveljakov

Description

@paveljakov

Is your feature request related to a problem? Please describe.
Problem we are solving is Java agent logging dependencies of Quartz scheduled jobs. Currently we have periodic jobs that run quite often and perform actions, e.g. perform DB queries, etc. We are generating quite a lot of automatically collected AI dependencies as a result of action performed in these jobs. It would be nice if we could either limit sampling rate or disable automatic log collection for such code paths.

Describe the solution you would like
Few options possible:

  1. Add Quarts Job support to AI agent - this would probably generate custom spans for quartz jobs, that we could use to configure sampling overrides on.
  2. Or add ability to configure sampling rate programmatically (using SDK or something else), so that it would be possible to limit/disable entire code paths from logging dependencies, etc.
  3. Add sampling overrides support for SDK custom telemetry;
  4. Provide any other suggestions how to solve periodic jobs dependency telemetry problem.

Describe alternatives you have considered
What we have tried:

  • Sampling overrides - kind of works, but you have to explicitly override each and every DB query, etc. Not very manageable solution;
  • Create custom parent Span using SDK and use sampling override for parent - sampling override does not work on custom SDK telemetry;
  • Create custom parent Span using @WithSpan and use sampling override for parent - Span created with @WithSpan is InProc and does not contain any attributes we could apply sampling overrides on (adding custom attributes with span processor also does not help, because sampling overrides do not work for "added" attributes by span processors).

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