Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

wasm: API to add tags to active span from wasm filter #384

Closed
wants to merge 14 commits into from

Conversation

mohit-a21
Copy link

Signed-off-by: Mohit Agarwal [email protected]

Description: This change adds an API, activeSpanSetTag which allows a filter to customize span info and help in adding tracing info.
Risk Level: Low
Testing: As part of the change, test cases have been added along the lines of test cases for existing APIs. Along with that manual testing has been done to verify the API.
Docs Changes: Docs have been updated regarding the API so added.
Fixes: #383

Signed-off-by: Mohit Agarwal <[email protected]>
@mohit-a21
Copy link
Author

/retest

Signed-off-by: Mohit Agarwal <[email protected]>
@mohit-a21
Copy link
Author

mohit-a21 commented Jan 29, 2020

I have run the asan test cases locally. They seem to be running fine. Any suggestions on something that I might be missing?
Used this to run it locally.

./ci/run_envoy_docker.sh "./ci/do_ci.sh bazel.asan //test/extensions/access_loggers/wasm/... //test/extensions/filters/http/wasm/... //test/extensions/filters/network/wasm/... //test/extensions/wasm/... //test/extensions/common/wasm/..."

@PiotrSikora
Copy link
Contributor

@mohit-a21 thanks for your contribution! ASan is a bit flaky on the CircleCI lately, I kicked off another run.

Having said that, we're doing some cleanup/reorg across the repos, so I'll hold off merging you contribution until those are completed (should be sometime next week).

Mohit Agarwal added 2 commits February 12, 2020 15:46
@mohit-a21
Copy link
Author

@PiotrSikora Thanks a lot for looking into this.

@zhongfox
Copy link

@PiotrSikora nice work, how's going about this pr? looking forward envoy with rust

@mohit-a21
Copy link
Author

@PiotrSikora is the repo open for contribution? Thanks!

@PiotrSikora
Copy link
Contributor

@mohit-a21 I think so, I need to confirm one more thing. I'll get back to you tomorrow.

@@ -164,6 +164,9 @@ extern "C" void proxy_on_grpc_trailing_metadata(uint32_t context_id, uint32_t to
extern "C" void proxy_on_grpc_receive(uint32_t context_id, uint32_t token, uint32_t response_size);
extern "C" void proxy_on_grpc_close(uint32_t context_id, uint32_t token, uint32_t status_code);

extern "C" WasmResult proxy_active_span_set_tag(const char* key_ptr, size_t key_size, const char* value_ptr,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the ABI level, this should be called proxy_set_active_span_tag().

Also, you should move it into host exports section above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Mohit Agarwal added 4 commits February 28, 2020 16:36
@mohit-a21 mohit-a21 requested a review from PiotrSikora March 1, 2020 08:17
@mohit-a21
Copy link
Author

@mohit-a21 I think so, I need to confirm one more thing. I'll get back to you tomorrow.

@PiotrSikora Any updates on this? Thanks!

@mohit-a21
Copy link
Author

@PiotrSikora Hey, Are you guys accepting patches now? Thanks!

@PiotrSikora
Copy link
Contributor

@mohit-a21 apologies for the delay, could you open a PR against https://github.com/proxy-wasm/spec with the ABI change? Thanks!

@mohit-a21
Copy link
Author

@mohit-a21 apologies for the delay, could you open a PR against https://github.com/proxy-wasm/spec with the ABI change? Thanks!

Thanks, @PiotrSikora. Will do.

@mohit-a21
Copy link
Author

@PiotrSikora Hey I have created a PR(proxy-wasm/spec#5) in https://github.com/proxy-wasm/spec . Please review. Thanks!

if (!decoder_callbacks_) {
return;
}
Tracing::Span& span = decoder_callbacks_->activeSpan();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered a version of this function that uses encoder_callbacks_, maybe as a backup? I ask because I don't know if decoder_callbacks_ is valid in the context of the HTTP encoder. Do you have.an example of this working within the onResponseBody() of a Context subclass?

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

Successfully merging this pull request may close these issues.

Add apis for adding tags to span from wasm filters
5 participants