-
Notifications
You must be signed in to change notification settings - Fork 20
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
use innerEvent to encapsulate user data only when the tracing is enabled #49
Conversation
context/context.go
Outdated
@@ -363,7 +372,7 @@ func (ctx *FunctionContext) Send(outputName string, data []byte) ([]byte, error) | |||
|
|||
payload = data | |||
|
|||
if traceable(output.ComponentType) { | |||
if isTracingEnabled(ctx) && traceable(output.ComponentType) && !ctx.GetOptions().GetSendWithRawData() { |
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.
What happens if tracing is enabled and the user chooses to send with raw data?
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.
I see, let me define the priority as follows:
the user decides whether to send raw data > tracing is enabled > target is traceable
Does this make sense?
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.
I think the logic is added specially for SkyWalking. Can we replace the !GetSendWithRawData
with something like IsTracingProviderSkyWalking
?
If user enables skywalking tracing, it has to be cloud events, else keep the original data.
Does this make sense?
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.
done
this also supports allowing the user to decide whether to use the raw data to send Signed-off-by: laminar <fangtian@kubesphere.io>
innerEvent will be enabled when all of the following conditions are met:
|
If skywalking is enabled for tracing but innerEvent is disabled (for example |
That's a nice move. |
The sync function tracing still works while the async function tracing doesn't, is that right? |
the tracing will be broken in this case. |
yes, the sync function can carry the tracing metadata through HTTP headers. |
this PR also supports allowing the user to decide whether to use the raw data to send.
example:
Signed-off-by: laminar fangtian@kubesphere.io