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

Add methods to add new context on Message #490

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

edsonjab
Copy link
Contributor

Fix issue #486

@edsonjab
Copy link
Contributor Author

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<>();
Copy link

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;
Copy link

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.

@rvowles
Copy link

rvowles commented Aug 14, 2024

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

@edsonjab edsonjab marked this pull request as ready for review September 25, 2024 15:06
@seg-atlantis-prod
Copy link

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

@seg-atlantis-prod
Copy link

Error parsing command: EOF found when expecting closing quote

@seg-atlantis-prod
Copy link

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

@seg-atlantis-prod
Copy link

Error parsing command: EOF found when expecting closing quote

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

Successfully merging this pull request may close these issues.

3 participants