Expose span context to filters#894
Conversation
|
@mattklein123 / @htuch . I am not sure if you want elaborate tests for this PR. If you do, any thoughts on where I could plug in a test for the function introduced in this PR, given that there are no consumers in the Envoy code base? [The filter we are using in Istio will be using this feature.] |
|
@rshriram we do need to talk about this. This is related to #888 and some other work that @goaway is doing. I'm in an all day meeting tomorrow and will be busy most of the day Friday also but perhaps you and @goaway can chat offline/VC (please find each other on Gitter). @goaway I think this is a very reasonable change and a use case that I had not previously considered. It makes me somewhat rethink what you are working on. What if the span interface was changed so that you could create a child span from it (and the driver details were hidden)? If this were done, it would also work for what you are doing. Furthermore, if we passed the span inside the tracing context that is passed to gRPC AsyncClient calls, it could be fed into AsyncClient also fairly easily. @rshriram I don't want to hold you up, and I think this change is reasonable, but I do want to consider the implications of this interface change in the face of other requirements that we are working on in parallel, so let's get a firm plan in place. @goaway should be able to drive. |
|
To be clear, our current use case is to modify the span that was already
created, overwriting some metadata such as the calling service name
(@fabolive would be introducing this interface into the base class as part
of his second zipkin PR).
I agree with you in general that it makes sense to unify the plumbing
around creating child spans or modifying current span. I will sync with
@goaway and spec out the plan.
On Thu, May 4, 2017 at 12:07 AM Matt Klein ***@***.***> wrote:
@rshriram <https://github.com/rshriram> we do need to talk about this.
This is related to #888 <#888> and some
other work that @goaway <https://github.com/goaway> is doing. I'm in an
all day meeting tomorrow and will be busy most of the day Friday also but
perhaps you and @goaway <https://github.com/goaway> can chat offline/VC
(please find each other on Gitter).
@goaway <https://github.com/goaway> I think this is a very reasonable
change and a use case that I had not previously considered. It makes me
somewhat rethink what you are working on. What if the span interface was
changed so that you could create a child span from it (and the driver
details were hidden)? If this were done, it would also work for what you
are doing. Furthermore, if we passed the span inside the tracing context
that is passed to gRPC AsyncClient calls, it could be fed into AsyncClient
also fairly easily.
@rshriram <https://github.com/rshriram> I don't want to hold you up, and
I think this change is reasonable, but I do want to consider the
implications of this interface change in the face of other requirements
that we are working on in parallel, so let's get a firm plan in place.
@goaway <https://github.com/goaway> should be able to drive.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#894 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AH0qd8HLmvXo5EbP_mD1c6Opsy00HRshks5r2U8AgaJpZM4NQMLp>
.
--
~shriram
|
|
|
||
| // Tracing::Span | ||
| void setTag(const std::string&, const std::string&) override { NOT_IMPLEMENTED; } | ||
| void finishSpan() override { NOT_IMPLEMENTED; } |
There was a problem hiding this comment.
I'd suggest moving NullSpan over into the Tracing namespace, and making these no-ops, rather than PANICs.
That way, a NullTracer and/or NullDriver can return a NullSpan instead of a nullptr, and this becomes somewhat safer to use.
|
Overall I think this is a pretty clean approach, and likely something I can hook into to allow the generation of child Spans off of an existing span. This would obviate the need for me to plumb |
|
@goaway +1, I think we should review and merge this PR, and build from there. I will add a few review comments later. |
|
@rshriram this does need a test. I would probably just add to here: https://github.com/lyft/envoy/blob/master/test/common/http/conn_manager_impl_test.cc#L241 If you actually EXPECT_CALL on the mock filter callbacks, from within a callback, you could verify that the span you get is what you expect. See other examples towards the end of the file. |
| virtual AccessLog::RequestInfo& requestInfo() PURE; | ||
|
|
||
| /** | ||
| * @return span context used for tracing purposes. Individual filters may add or modify |
There was a problem hiding this comment.
nit formatting: Have the word "information" start at the same space as "context" Ex:
https://github.com/lyft/envoy/blob/master/include/envoy/http/conn_pool.h#L58
test/mocks/http/mocks.h
Outdated
| std::function<void()> reset_callback_; | ||
| Event::MockDispatcher dispatcher_; | ||
| testing::NiceMock<AccessLog::MockRequestInfo> request_info_; | ||
| std::shared_ptr<Tracing::MockSpan> active_span_; |
There was a problem hiding this comment.
nit: is this used in any of the tests?
mattklein123
left a comment
There was a problem hiding this comment.
LGTM modulo @ccaraman nits
|
addressed the nits. |
Patches need to be referenced using the workspace alias Signed-off-by: Alan Chiu <achiu@lyft.com> For an explanation of how to fill out the fields, please see the relevant section in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md) Description: bazel: fixup patches Risk Level: low Testing: ci Docs Changes: n/a Release Notes: n/a [Optional Fixes #Issue] [Optional Deprecated:] Signed-off-by: JP Simard <jp@jpsim.com>
Patches need to be referenced using the workspace alias Signed-off-by: Alan Chiu <achiu@lyft.com> For an explanation of how to fill out the fields, please see the relevant section in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md) Description: bazel: fixup patches Risk Level: low Testing: ci Docs Changes: n/a Release Notes: n/a [Optional Fixes #Issue] [Optional Deprecated:] Signed-off-by: JP Simard <jp@jpsim.com>
Like _free_base, _free_dbg is called by CRT internal functions or operator delete in Debug mode. This closes envoyproxy#719 and closes envoyproxy#894. [alkondratenko@gmail.com: trivial formatting fixes] [alkondratenko@gmail.com: build free_dbg even in release builds]
**Description** This PR adds clearroutecache to dataplane flow. clearroutecache is an important functionality that envoy ai gw relies on. Signed-off-by: bitliu <bitliu@tencent.com>
fixes #890
cc @goaway (I hope this doesn't conflict with what you are working on).
cc @fabolive @kyessenov