Skip to content
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

Make the extra field inserted by virtualfield a transient field #13455

Open
123liuziming opened this issue Mar 5, 2025 · 5 comments · May be fixed by #13493
Open

Make the extra field inserted by virtualfield a transient field #13455

123liuziming opened this issue Mar 5, 2025 · 5 comments · May be fixed by #13493
Labels
enhancement New feature or request needs triage New issue that requires triage

Comments

@123liuziming
Copy link
Contributor

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

Yes, sometimes users may serialize some Java bean, which may be instrumented by OpenTelemetry Java Agent. Java Agent may insert an extra field through VirtualField, and it will led to a serialization failure.

Image

Describe the solution you'd like

Make the extra field inserted by virtualfield a transient field and Java will ignore such transient field while doing serialization

Describe alternatives you've considered

No

Additional context

No response

@123liuziming 123liuziming added enhancement New feature or request needs triage New issue that requires triage labels Mar 5, 2025
@laurit
Copy link
Contributor

laurit commented Mar 5, 2025

Are you sure this is because virtual fields or just guessing? To me it looks more likely that you somehow end up serializing request attributes map.

@123liuziming
Copy link
Contributor Author

123liuziming commented Mar 5, 2025

My bad, it is because the agent put the response into the request attributes map. Actually the virtual field has been marked as transient

Image

@123liuziming
Copy link
Contributor Author

Seems that we can only use a custom serializer to avoid the case?

@123liuziming
Copy link
Contributor Author

Or can we mark the AsyncListenerResponse as a virtual field of request rather than putting it into request's attribute map since the virtual field is transient

@trask
Copy link
Member

trask commented Mar 12, 2025

@123liuziming, just in case you were looking into this after our discussion in last week's APAC meeting, wanted to give you a heads up that it looks like @laurit may be exploring options for this in #13493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New issue that requires triage
Projects
None yet
3 participants