OpenFeign / OpenFeign/feign

Actual request may be manipulated after it has been logged

Open
#507 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

proposal waiting for votes
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

In my Spring enabled App I'm using Feign (spring-cloud-starter-feign) and Sleuth (spring-cloud-starter-sleuth).
Now I wanted to check whether in an HTTP request Sleuth's traceId is transferred in the HTTP headers. Thus I used Feign's Logger.Level.HEADERS. I could see headers being logged, but the trace information was missing - although it was actually being transferred.

From debugging I found out that logging takes place before Sleuth's tracing information is added to the headers, thus the information is misleading.
Here the succession of logging and request manipulation is defined: feign.SynchronousMethodHandler.executeAndDecode(RequestTemplate)
Here the manipulation of the request headers takes place: org.springframework.cloud.sleuth.instrument.web.client.feign.TraceFeignClient.execute(Request, Options)

I would expect that if I enable Logger.Level.HEADERS I see all the header information that is actually being sent.

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

Read Feign's SynchronousMethodHandler.executeAndDecode(RequestTemplate) alongside Spring Cloud Sleuth's TraceFeignClient.execute(Request, Options) to trace when logging and header manipulation occur. Reproduce the request with Logger.Level.HEADERS and Sleuth enabled; done means the logged headers match the headers actually sent, including the traceId.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.