Add support for composite samplers in declarative config#5201
Conversation
| if config.trace_id_ratio_based is not None: | ||
| ratio = config.trace_id_ratio_based.ratio | ||
| return TraceIdRatioBased(ratio if ratio is not None else 1.0) | ||
| if config.composite_development is not None: |
There was a problem hiding this comment.
Even if this is still in development this is not gated under an option to filter stable only components because with declarative config the enablement of experimental stuff is explicit by the user
| """An exact match of an attribute value""" | ||
|
|
||
| def __init__(self, key: str, value: AnyValue): | ||
| logging.warning( |
There was a problem hiding this comment.
This is a predicate I had around when implemented the rule based sampler, does not make much sense to keep around since we have one that implements a superset of its features
| return f"{self.key}={self.value}" | ||
|
|
||
|
|
||
| class AlwaysMatchPredicate: |
There was a problem hiding this comment.
Even if these are not spec'ed in the SDK specification I've added these predicates near the rule based sampler. It looked more natural to have them here instead of in sdk configuration side for discoverability if you are not using declarative config. I think Java does not do that though.
|
Thanks for the PR! Just a heads-up: we no longer update Please add the appropriate changelog fragment for this change instead of editing |
…le based sampler Assisted-by: Cursor
Assisted-by: Cursor
bbddc5a to
240b1e7
Compare
| return (value,) | ||
|
|
||
|
|
||
| def _glob_matches(value: str, glob_pattern: str) -> bool: |
There was a problem hiding this comment.
Why not use fnmatch here? Also, do we need to handle escaping and such?
|
One small comment/question, but overall LGTM |
Description
This adds support for the in development composite samplers to declarative config support.
Refs #3631
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Contrib Repo Change?
Checklist: