-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add methods to add new context on Message #490
Conversation
Hi @rvowles, I was making some test about your situation and create this draft to know if it works for you those changes |
@@ -125,6 +133,27 @@ private Message buildMessage(MessageBuilder builder) { | |||
return message; | |||
} | |||
|
|||
private void addExternalContext(String contextKey, Object contextValue) { | |||
this.externalContext = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a private method - and I can't see aanything calling it? Also it replaces the external context every time so it would only ever have 1 key?
@@ -55,6 +58,7 @@ public class Analytics { | |||
this.messageTransformers = messageTransformers; | |||
this.messageInterceptors = messageInterceptors; | |||
this.log = log; | |||
this.externalContext = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context needs to be added in a MessageTransformer as it needs to be added when the message is being built. If we are in a server side app dropping segment tracking events, it would need to have picked up the context for that individual request which is traditionally ThreadLocalContext. Its not on the Analytics object itself.
I will link to my PR - here is the transformer, you see I have to replace the context which means nuking any other transformer's context and potentially getting nuked. Here is an example of it being used |
Atlantis commands can't be run on fork pull requests. To enable, set --allow-fork-prs or, to disable this message, set --silence-fork-pr-errors |
|
Atlantis commands can't be run on fork pull requests. To enable, set --allow-fork-prs or, to disable this message, set --silence-fork-pr-errors |
|
Fix issue #486