Add Trace Service Support.#345
Conversation
1d08b2a to
e5deb87
Compare
|
|
||
| // Configuration structure. | ||
| message TraceServiceConfig { | ||
| // The name of the upstream cluster that hosts the metrics service. The cluster must be |
e5deb87 to
0541f70
Compare
|
@bogdandrutu can you potentially give us some overview of what the plans are in this area? Is the plan to implement an Envoy trace driver that speaks this API (easy enough)? I'm mainly trying to understand how this interacts with the OT C++ API (envoyproxy/envoy#2017). In general, I'm a huge fan of the API driven approach so would love to see this move forward. |
|
@mattklein123 i believe @bogdandrutu just left for vacation and may be a bit slow to respond. I will try to offer my understanding in the meantime. The plan is to follow this PR with code that enables Envoy to speak this API. The OpenCensus c++ library was just recently released (https://github.com/census-instrumentation/opencensus-cpp). I imagine the Envoy work will involve that library. I'm less clear on the relationship between OT and OpenCensus, and on the details of how the OpenCensus support is anticipated to be added. |
|
@douglas-reid indeed I am on vacation and will respond a bit slower. PS: The API that @douglas-reid pointed is in process to become stable, the implementation needs re-work especially for performance point of view but we are committed to do that asap. |
|
OK in general this sounds great to me. Please get the PR passing tests. We can discuss implementation details in January. |
| message StreamTracesResponse { | ||
| } | ||
|
|
||
| message StreamTracesMessage { |
There was a problem hiding this comment.
s/StreamTracesMessage/StreamingTracesRequest?
| } | ||
| } | ||
|
|
||
| message StreamTracesResponse { |
There was a problem hiding this comment.
StreamingTracesResponse would be a proper noun phrase.
There was a problem hiding this comment.
The names are consistent with https://github.com/envoyproxy/data-plane-api/blob/master/api/metrics_service.proto
|
FYI envoyproxy/envoy#2017 was just merged. IMO it would be nice if the driver was actually an OT C++ driver so it can work in other places also where C++ code is used. We can figure it out in January. |
|
@bogdandrutu friendly ping. Can we push this forward? Otherwise I would like to close for now and we can reopen when you are ready? |
|
Bogdan is OOO until mid-January. |
|
@rakyll OK can leave it open until @bogdandrutu gets back. |
0541f70 to
517b88e
Compare
|
@mattklein123 working on this right now. |
|
@mattklein123 everything is ready. |
| message TraceServiceConfig { | ||
| // The name of the upstream cluster that hosts the trace service. The cluster | ||
| // must be configured in the cluster manager. | ||
| string cluster_name = 1; |
There was a problem hiding this comment.
This should switch to the new GrpcService message. (See other examples).
258cd61 to
db6b1e9
Compare
|
@mattklein123 @htuch @douglas-reid probably one of you has better experience with bazel/proto. I get this error sometimes on the ci:test and cannot reproduce locally. Do you have any idea why? |
|
@bogdandrutu this looks like a compiler issue rather than a Bazel one; it's not seeing the issue though. |
|
@htuch the failure is random (sometimes pass, sometimes not), that's why I think I am doing something wrong related to bazel/proto. |
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
db6b1e9 to
ba0a3f1
Compare
|
Everything looks good. |
mattklein123
left a comment
There was a problem hiding this comment.
LGTM. @htuch @wora any comments?
@kyessenov let's merge this and then you can move it around in your PR?
|
Sure, let's do that. |
| import "api/grpc_service.proto"; | ||
| import "trace.proto"; | ||
|
|
||
| import "google/api/annotations.proto"; |
| // not expect any response to be sent as nothing would be done in the case | ||
| // of failure. | ||
| rpc StreamTraces(stream StreamTracesMessage) returns (StreamTracesResponse) { | ||
| } |
|
|
||
| import "validate/validate.proto"; | ||
|
|
||
| // Service for streaming traces to server that consumes the trace data. It |
There was a problem hiding this comment.
This sentence can be simplified: An interface for streaming traces from a client to a server.
There is no need to mention "consumes the trace data". The server can just forward the data elsewhere. There is no need to speculate the usage.
| import "validate/validate.proto"; | ||
|
|
||
| // Service for streaming traces to server that consumes the trace data. It | ||
| // uses OpenCensus data model as a standard to represent trace information. |
There was a problem hiding this comment.
Remove "as a standard", since it doesn't provide much value.
Please add a link to OpenCensus
| // Service for streaming traces to server that consumes the trace data. It | ||
| // uses OpenCensus data model as a standard to represent trace information. | ||
| service TraceService { | ||
| // Envoy will connect and send StreamTracesMessage messages forever. It does |
There was a problem hiding this comment.
This interface can be used by different client, there is no need to mention Envoy. "forever" is also too strong. How about:
// The client will stream trace to the server continuously until either the client or the server terminates the stream.
| message StreamTracesMessage { | ||
| message Identifier { | ||
| // The node sending the access log messages over the stream. | ||
| Node node = 1 [(validate.rules).message.required = true]; |
There was a problem hiding this comment.
If you put the trace data into a data, the key should always be a string, the client should normalize the id into a string instead of asking server to do it.
|
|
||
| // Configuration structure. | ||
| message TraceServiceConfig { | ||
| // The upstream gRPC cluster that hosts the metrics service. |
There was a problem hiding this comment.
Why trace service has anything to do with metrics service? Do they share the schema?
|
Did we ever do anything with this? I see its presence in the repository but not any users. |
|
I asked a similar question on Gitter recently - https://gitter.im/census-instrumentation/Lobby?at=5b43d06b9b82c6701bafe6b2. In the responses it looks like the work is being done at the Istio Mixer level (which makes sense) and not at the Envoy level. It looks like https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/trace/v2/trace.proto#config-trace-v2-traceserviceconfig will emit OpenCensus stats to a gRPC endpoint but I'm not really sure. |
|
I looked at this again today after the Twitter debate re: OpenCensus & OpenTracing. I'm pretty sure that However it isn't defined as a well known name for either tracers source/extensions/tracers/well_known_names.h or stats_sinks stat_sinks/well_known_names.h After all this I don't know if the I was thinking that if the tracing service worked you could point it to the OpenCensus service and then be able to export traces to multiple backends. Would be great if @bogdandrutu or @rakyll could chime in. Also good to hear from Istio Policies & Telemetry leads @douglas-reid and @mandarjog |
|
Metrics Service and Tracing Service IMO are different. Metric Service implements gRPC stats sink so that envoy stats can be pushed to the configured end point. It does not deal with OpenCensus at all. where |
|
@ramaraochavali is correct. The metrics service and the tracing service are different. The original intent of this PR was solely to provide an API for Envoy to stream out trace spans to a backend. OpenCensus obviously supports stats/metrics and traces, but this was focused exclusively on trace data. I cannot speak with any authority on the OpenCensus' teams priorities around implementation. At the time of the original PR, I understood that work based on their recently released code would immediately follow, hooking up this API. Sometime soon after, priorities shifted I guess. As @moderation notes, there have been Istio Mixer PRs that have added support for generating trace spans from I don't know if the OpenCensus team wants to continue pursuing trace export via Envoy or not. I think it would be useful. The last I heard, the OpenCensus folks were working on adding support for stats export from Envoy however. It would be good to have confirmation of that effort. |
|
OpenCensus contributor here. We're looking into supporting this and will come back with a more concrete proposal soon. |
This is a trace service proposal based on the opencensus (opencensus.io) data model. OpenCensus is an vendor independent tracing (support for zipkin, stackdriver, and soon others) and stats library(prometheus, stackdirver, signalfx, and soon others), integrated in products like gRPC (grpc.io).
One of the usages will be in the Istio (istio.io) environment to push traces to the Mixer.
/cc @douglas-reid @louiscryan