refactor: Use typed interfaces for generating EnvFilters from config - #33
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
==========================================
+ Coverage 75.83% 76.53% +0.69%
==========================================
Files 5 5
Lines 269 277 +8
==========================================
+ Hits 204 212 +8
Misses 65 65
Continue to review full report in Codecov by Harness.
|
I think this is just nicer than returning a string that the consumer is expected to parse. I wish we could do this without any string parsing at all, but this functionality is still missing.
RasmusRendal
force-pushed
the
RasmusRendal/refactor_envfilter
branch
from
September 1, 2026 13:17
c1d109a to
93eac0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think this is just nicer than returning a string that the consumer is
expected to parse.
I wish we could do this without any string parsing at all, but this
functionality is still missing.
This is arguably not a super important PR, but it's just something weird I spotted and wanted to fix.
Note
Low Risk
Internal refactor of filter construction with no change to telemetry export or security-sensitive paths; misconfiguration still surfaces as the same parse errors at init.
Overview
Refactors how tracing log levels from OpenTelemetry config become subscriber filters.
ProviderConfigandStdoutLogsConfigno longer build a comma-separated filter string for callers to parse;get_filternow returns aResult<EnvFilter, ParseError>built via sharedfilter_from_config(general level, per-dependency overrides, main crate level).In
init_otel, stdout, OTLP logs, traces, and metrics layers callget_filterdirectly instead ofEnvFilter::from_str, with parse failures still mapped throughOtelInitError::EnvFilterError. Behavior should match the previous string format; the change is API shape and where parsing happens.Reviewed by Cursor Bugbot for commit 93eac0f. Bugbot is set up for automated code reviews on this repo. Configure here.