-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid attributes on Spans, Events, Links, and Resources #203
Comments
The general approach here sounds good to me. |
Assign this to me plz :) |
Any thoughts on where is the right place in the SDK to insert this validation logic? I was thinking it could be done right before calling the exporter's
|
A couple of options:
|
Since SDK spans should only be created if they're going to be sampled, would it be reasonable to eagerly drop invalid attributes on span creation and also drop in I think we could probably do the same on Event and Link creation. Since they are immutable it requires making a copy to drop invalid data, which is somewhat cumbersome. It's harder to ensure that they will be sampled before doing the work, but it might be ok to eagerly drop attributes on initialization? The upside to this approach is that processors will only see valid data, the slight downside, is that events and links might processed, but not sampled. |
Cool, I'm exploring this option. A few other questions:
|
The downside of any eager validation is that more work is required even if attributes are dropped for other reasons (e.g. max links, events, or attributes is exceeded). Everything span-attribute-related should go through |
Would it be safe to defer all attribute validation (key correctness, value correctness, attributes hash size) until |
Actually disregard that, I suppose |
The most flexible approach is to perform validation in an optional (but enabled by default) processor, but that implies that processors earlier in the pipeline may see invalid data. There are scenarios where that could be just fine (for example, processors that rewrite or drop spans). The main reason to eagerly limit attribute hash size is to limit the heap size kept live by data in the pipeline. |
Bumped this to Alpha 0.4 so we can proceed with the 0.3 release (as discussed on the SIG call). |
We've discussed this before and temporarily went with the idea of a strict mode, that was never finished and the Exception handing spec discourages an OTel implementation from raising unhandled exceptions. See: #14 and #126.
We are in the situation where invalid attributes on spans, links, events and resources can make it into the export pipeline where currently it breaks things. In order to free the export pipeline from having to validate all data, we should ensure that attributes that make to the pipeline are valid.
I'm proposing the following strategy for attribute validation:
The text was updated successfully, but these errors were encountered: