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

Kamon context propogation issue between spring filter and controller #1258

Open
pparkar opened this issue Jan 31, 2023 Discussed in #1257 · 0 comments
Open

Kamon context propogation issue between spring filter and controller #1258

pparkar opened this issue Jan 31, 2023 Discussed in #1257 · 0 comments

Comments

@pparkar
Copy link

pparkar commented Jan 31, 2023

Discussed in #1257

Originally posted by pparkar January 31, 2023
We have a spring application with basic request filter and controller.

  • Creating a kamon context in request filter
         val kamonContext = Context
          .of(KamonConstants.requestIdKey,Some(request.getHeader("request-id"))
          .withEntry("user-id", fetchUserIdInFilter())

        Kamon.runWithContext(kamonContext) {
          filterChain.doFilter(request, response)
        }
  • Trying to access the values added in request filter from controller, however the context seems to get overridden
    Kamon.currentContext().get("user-id") comes as null
    Kamon.currentContext().get("request-id") comes as null
  • The kamon context object hash is the same on both the filter and controller. But somehow the context details does not seem to propogate.

Can someone provide any pointers on what could be happening? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant