question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom attributes in MDC are getting lost

See original GitHub issue

boot.zip Hi i am facing an issue where in custom attributes in MDC are getting lost when using config spring.sleuth.sampler.probability=1.0 Application log:-

2019-02-25 22:33:46.360  INFO [boot-1,aa5519088fb5bc53,aa5519088fb5bc53,true,10.20.30.40] 22508 --- [nio-2040-exec-1] c.s.study.controller.SampleControllerA   : SampleControllerA hello starts
2019-02-25 22:33:46.393  INFO [boot-1,aa5519088fb5bc53,bf4da017c8a86e69,true,10.20.30.40] 22508 --- [nio-2040-exec-2] c.s.study.controller.SampleControllerB   : SampleControllerB hi starts and ends
2019-02-25 22:33:46.422  INFO [boot-1,aa5519088fb5bc53,aa5519088fb5bc53,true,] 22508 --- [nio-2040-exec-1] c.s.study.controller.SampleControllerA   : SampleControllerA hello ends

After making a rest call trueclientip attribute in MDC is getting lost

Sample application code is attached

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mpkorstanjecommented, Feb 26, 2021

@marcingrzejszczak this no longer reproduceable with spring-cloud-sleuth:3.0.1. Feel free to close.

https://github.com/mpkorstanje/sleuth-custom-mdc-attributes-removed

0reactions
mpkorstanjecommented, Jan 4, 2021

I’m having trouble running your workaround though. I get a runtime exception on startup. I’m running Greenwich.RELEASE / Spring Boot 2.1.9.RELEASE if that matters.

Not a clue sorry.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preserve custom MDC attributes during exception-handling in ...
I want the MDC to be cleared after a response has been sent by the thread, as the last action. The MDC should...
Read more >
sap mdg consolidation key attribute structure not generated
In my custom table, I have only PARTNER as a key field in my Ztable which is already linked to BP table by...
Read more >
Chapter 8: Mapped Diagnostic Context - Logback - QOS.ch
The MDC manages contextual information on a per thread basis. Typically, while starting to service a new client request, the developer will insert...
Read more >
Logging - Documentation - Akka
MDC allows for adding additional context dependent attributes to log entries. Out of the box, Akka will place the path of the actor...
Read more >
Collect custom attributes - New Relic Documentation
By adding custom attributes to your data, you can do more in-depth and customized analysis of your business. For example, for New Relic...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found