Skip to content

Conversation

@jvimal-eg
Copy link
Owner

Motivation

Following a conversation on Discord, I learnt that an EnvFilter
constructed like this:

target[span{field=value}]=debug

enables the debug level for any event emitted within the context of
span.

It would be ideal if the debug level were consistently applied to
events as well as spans. This would mean that the target=debug filter
would also be applied to events generated within the context of the
span.

Solution

Add a new field inside CallsiteMatcher to keep track of the most
specific target match among Directives that match a callsite Metadata.

Open questions:

  • It looks like a clone of a String is needed. Unsure if there is a
    way to avoid it?
  • We take the maximum level that matches a callsite. It's unclear what
    we should do in cases where there's a conflict between the maximum
    level and the most specific target match:
target[span{field=value}]=debug,target::foo[span{field=value}]=info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants