Skip to content

Change enable property on Instrumenter to a Predicate<Instrumenter> or a Supplier<Boolean> #11927

Open
@osvaldopina

Description

@osvaldopina

Is your feature request related to a problem? Please describe.

Allows a fine grain control over span creation for a Instrumenter.

Describe the solution you'd like

...
private final Predicate<Instrumenter> enabled;
...

...

 public boolean shouldStart(Context parentContext, REQUEST request) {
     if (!enabled.test(this)) {
      return false;
    }

...

Or

...
private final Supplier<Boolean> enabled;
...

...

 public boolean shouldStart(Context parentContext, REQUEST request) {
     if (!enabled.get()) {
      return false;
    }

...

Describe alternatives you've considered

I could not find any other way to enable or disable Instrumenter span creation on th fly. If there is such a mecanism this feature request would not be necessary.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions