Skip to content
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

tracing: Support dynamically loading tracing libraries. #386

Merged
merged 9 commits into from
Jan 23, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions api/trace.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ import "validate/validate.proto";
message Tracing {
message Http {
// The name of the HTTP trace driver to instantiate. The name must match a
// supported HTTP trace driver. *envoy.lightstep* and *envoy.zipkin* are
// built-in trace drivers.
// supported HTTP trace driver. *envoy.lightstep*, *envoy.zipkin*, and
// *envoy.dynamic* are built-in trace drivers.
Copy link
Member

Choose a reason for hiding this comment

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

envoy.dynamic.ot?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

string name = 1 [(validate.rules).string.min_bytes = 1];

// Trace driver specific configuration which depends on the driver being
// instantiated. See the :ref:`LightstepConfig
// <envoy_api_msg_LightstepConfig>` and :ref:`ZipkinConfig
// <envoy_api_msg_ZipkinConfig>` trace drivers for examples.
// <envoy_api_msg_LightstepConfig>`, :ref:`ZipkinConfig
// <envoy_api_msg_ZipkinConfig>`, and :ref:`DynamicConfig
// <envoy_api_msg_DynamicConfig>` trace drivers for examples.
google.protobuf.Struct config = 2;
}
// Provides configuration for the HTTP tracer.
Expand Down Expand Up @@ -52,3 +53,12 @@ message ZipkinConfig {
// /api/v1/spans, which is the default value.
string collector_endpoint = 2 [(validate.rules).string.min_bytes = 1];
}

message DynamicConfig {
Copy link
Member

Choose a reason for hiding this comment

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

Can we call this DynamicOtConfig? I think it's unlikely but it's possible we would eventually support loadable modules of some other type. Same for above perhaps envoy.dynamic.ot for the type?

// Dynamic library implementing the `OpenTracing API
// <https://github.com/opentracing/opentracing-cpp>`_.
string library = 1 [(validate.rules).string.min_bytes = 1];
Copy link
Member

Choose a reason for hiding this comment

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

Should this be library_path ? @wora ? Not sure what the standard is here.


// File containing the configuration for the tracing library.
string config_file = 2 [(validate.rules).string.min_bytes = 1];
Copy link
Member

Choose a reason for hiding this comment

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

Might this be more useful operationally if it was closer to DataSource (https://github.com/envoyproxy/data-plane-api/blob/master/api/sds.proto#L27), as it would avoid having to do filesystem management? Envoy could write files out to the filesystem if need be, i.e. if we can't load directly from memory into the trace driver.

Copy link
Member

Choose a reason for hiding this comment

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

+1 we should allow inline config. Can we just use Struct here and use JSON, etc. for this? Or is that too restrictive. At minimum agreed we should use Datasource to allow inline configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to use an inline configuration. (Looks like we'll be ok with having tracers use JSON for dynamic configurations.)

}
20 changes: 20 additions & 0 deletions docs/root/api-v1/tracing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,23 @@ collector_endpoint
*(optional, string)* The API endpoint of the Zipkin service where the
spans will be sent. When using a standard Zipkin installation, the
API endpoint is typically `/api/v1/spans`, which is the default value.

Dynamic driver
--------------

.. code-block:: json

{
"type": "dynamic",
Copy link
Member

Choose a reason for hiding this comment

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

Do we need v1 support? Unless there is a strong need for this at your end or by folks in the community, we're trying to feature freeze v1 and encourage new features to be v2 first.

Copy link
Member

Choose a reason for hiding this comment

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

+1 if possible can we drop this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the v1 support.

"config": {
"library": "...",
"config_file": "..."
}
}

library
*(required, string)* Dynamic library implementing the `OpenTracing API
<https://github.com/opentracing/opentracing-cpp>`_.

config_file
*(required, string)* File containing the configuration for the tracing library.