open-telemetry / open-telemetry/opentelemetry-java-instrumentation

Servlet snippet inject not work after call getOutputStream

Open
#8,869 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
2.6k
Forks
1.2k
Avg merge
2d 18h
Merged PRs (30d)
228

Description

Describe the bug
I'm using tomcat deploy web, The request after call Servlet3SnippetInjectingResponseWrapper.getOutputStream,snippet inject not work for me
I think the reason is the method getOutputSteam is called before method setContentType

What did you expect to see?
The script is added to the page

What did you see instead?
No change

What version are you using?
1.27

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Servlet3SnippetInjectingResponseWrapper.getOutputStream and compare its behavior with setContentType in the Tomcat deployment described by issue 8869. Reproduce the case where getOutputStream is called first; done means the script is added to the page as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.