This repository has been archived by the owner on Dec 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 88
wasm: API to add tags to active span from wasm filter #384
Closed
Closed
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
67ff7ce
API to add tags to active span from wasm filter
5a646c5
Fix formatting issues.
a575ba4
Kick CI
77b77b3
Merge branch 'master' of ssh://github.com/envoyproxy/envoy-wasm into …
a2723c9
Updated the *.wasm files
7a4dc77
Merge remote-tracking branch 'origin' into tracing_api
6e895eb
Updated TestRequestMapImpl to TestRequestHeaderMapImpl
d51e776
Merge remote-tracking branch 'origin' into tracing_api
b59ae2c
Address review comments
8f5719b
Merge remote-tracking branch 'origin' into tracing_api
11d79cd
Fixed the failing test case
6a85783
Reset the .wasm files in test dir
e95c5be
Merge remote-tracking branch 'origin' into tracing_api
8903beb
Merge branch 'master' into tracing_api
mohit-a21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1073,6 +1073,15 @@ void Context::scriptLog(spdlog::level::level_enum level, absl::string_view messa | |
// Connection | ||
bool Context::isSsl() { return decoder_callbacks_->connection()->ssl() != nullptr; } | ||
|
||
// Tracing | ||
void Context::activeSpanSetTag(absl::string_view key, absl::string_view value) { | ||
if (!decoder_callbacks_) { | ||
return; | ||
} | ||
Tracing::Span& span = decoder_callbacks_->activeSpan(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you considered a version of this function that uses |
||
span.setTag(key, value); | ||
} | ||
|
||
// | ||
// Calls into the WASM code. | ||
// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
all: headers_cpp.wasm async_call_cpp.wasm metadata_cpp.wasm grpc_call_cpp.wasm shared_cpp.wasm queue_cpp.wasm root_id_cpp.wasm | ||
all: headers_cpp.wasm async_call_cpp.wasm metadata_cpp.wasm grpc_call_cpp.wasm shared_cpp.wasm queue_cpp.wasm root_id_cpp.wasm tracing_cpp.wasm | ||
|
||
include ../../../../../../api/wasm/cpp/Makefile.base_lite |
2 changes: 1 addition & 1 deletion
2
test/extensions/filters/http/wasm/test_data/Makefile.docker_cpp_builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
DOCKER_SDK=/external_sdk | ||
|
||
all: headers_cpp.wasm async_call_cpp.wasm metadata_cpp.wasm grpc_call_cpp.wasm shared_cpp.wasm queue_cpp.wasm http_callout_cpp.wasm grpc_callout_cpp.wasm | ||
all: headers_cpp.wasm async_call_cpp.wasm metadata_cpp.wasm grpc_call_cpp.wasm shared_cpp.wasm queue_cpp.wasm http_callout_cpp.wasm grpc_callout_cpp.wasm tracing_cpp.wasm | ||
chown ${uid}.${gid} *.wasm | ||
|
||
include ${DOCKER_SDK}/Makefile.base_lite |
Binary file modified
BIN
+58 Bytes
(100%)
test/extensions/filters/http/wasm/test_data/async_call_cpp.wasm
Binary file not shown.
Binary file modified
BIN
-7.78 KB
(96%)
test/extensions/filters/http/wasm/test_data/grpc_call_cpp.wasm
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-4 Bytes
(100%)
test/extensions/filters/http/wasm/test_data/headers_cpp.wasm
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-8.06 KB
(96%)
test/extensions/filters/http/wasm/test_data/metadata_cpp.wasm
Binary file not shown.
Binary file modified
BIN
+64 Bytes
(100%)
test/extensions/filters/http/wasm/test_data/queue_cpp.wasm
Binary file not shown.
Binary file modified
BIN
+297 Bytes
(100%)
test/extensions/filters/http/wasm/test_data/shared_cpp.wasm
Binary file not shown.
18 changes: 18 additions & 0 deletions
18
test/extensions/filters/http/wasm/test_data/tracing_cpp.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// NOLINT(namespace-envoy) | ||
#include <string> | ||
#include <unordered_map> | ||
|
||
#include "proxy_wasm_intrinsics.h" | ||
|
||
class ExampleContext : public Context { | ||
public: | ||
explicit ExampleContext(uint32_t id, RootContext* root) : Context(id, root) {} | ||
|
||
FilterHeadersStatus onRequestHeaders(uint32_t) override; | ||
}; | ||
static RegisterContextFactory register_ExampleContext(CONTEXT_FACTORY(ExampleContext)); | ||
|
||
FilterHeadersStatus ExampleContext::onRequestHeaders(uint32_t) { | ||
activeSpanSetTag("tag_1", "tag_value_1"); | ||
return FilterHeadersStatus::Continue; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
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.
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.
At the ABI level, this should be called
proxy_set_active_span_tag()
.Also, you should move it into host exports section above.
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.