OpenFeign / OpenFeign/feign

Real URL from Load Blancer can't be logged with Feign Logger

Open
#1,490 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When using a load balancer, the request template has a service name instead of the host.
When logRequest() method of Feign Logger is called, the request contains service name instead of the host, so the real host can't be logged, this seems to be by design, but when logAndRebufferResponse() method of the Feign Logger is called it is expected to have real URL in response.request().url(), but it still contains only service name because of this approach:
https://github.com/OpenFeign/feign/blob/8d5d65c2521984a9f752a52167e152a40fde8072/core/src/main/java/feign/SynchronousMethodHandler.java#L121
I think it should be fixed earlier than in Feign 12 because it makes it impossible to see which instance from the load balancer was called and makes it hard to investigate problems with connecting to services.

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 core/src/main/java/feign/SynchronousMethodHandler.java around line 121 and compare how the request URL is represented when logRequest() and logAndRebufferResponse() are called. Trace the load-balancer request through these logger methods to determine where the service name replaces the resolved host. Done means the response request URL exposes the real instance URL for logging; the issue does not name a test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.