Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inject trace context into AWS Step Functions input #7585
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
Inject trace context into AWS Step Functions input #7585
Changes from 25 commits
7f8721d
a974597
7ecfa8c
fa36832
22c652b
eb642b0
0778f3d
f9d0eea
421856b
895341a
9d76dec
aba1119
e56f2d3
3039780
370df6d
a644a8b
fc6e570
ee83940
973cd79
96f7f39
fdb01a2
8417f6e
0aac239
2992508
da7af0b
ca13195
2d4507d
29a651c
a434846
1197c1d
0f304c7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 method could be made more performant with the following approach:
{
and}
to avoid creating an intermediate stringrequest.indexOf('{')
etc. which is faster{
and}
"{" + DATADOG_KEY + ":" + ddTraceContextJSON + "}"
{
and}
trim it and store it inexistingJSON
existingJSON
is empty you can return"{" + DATADOG_KEY + ":" + ddTraceContextJSON + "}"
"{" + existingJSON + "," + DATADOG_KEY + ":" + ddTraceContextJSON + "}"
you could also extract
DATADOG_KEY + ":" + ddTraceContextJSON
to a local variable to avoid repeating itThere 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.
Also I assume we know the original string will always be JSON?
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.
Yes, the original string must be a JSON string (if empty, it must be
{}
) in order for AWS to accept the request. However, the user could end up putting an incorrect json string; in that case, we should leave the request unchanged so that the error comes from AWS, not the tracer.