forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 1
WIP datadog tracing for envoy #1
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2b5c3e6
tracing: add datadog extension
cgilmour 4337516
ssl: temporariliy fix utility test (#4701)
lizan 1a68417
docs: fix dead link (#4700)
zyfjeff 811ee0d
rbac: add support for SNI based permissions (#4662)
venilnoronha ae6a4e7
http: update comment about absolute urls (#4702)
snowp 5bc8aa8
Merge branch 'master' into cgilmour/datadog-tracer
cgilmour 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -82,6 +82,14 @@ REPOSITORY_LOCATIONS = dict( | |
| commit = "d6f78d948c53f3b400bb46996eb3084359914f9b", | ||
| remote = "https://github.com/google/googleapis", | ||
| ), | ||
| com_github_datadog_dd_opentracing_cpp = dict( | ||
|
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. It'd be nice if they let us use tags, but I understand completely why they don't. |
||
| commit = "92d7ee11f61361ca23e00b48d328fb4e494534c4", # v0.3.1 | ||
| remote = "https://github.com/DataDog/dd-opentracing-cpp", | ||
| ), | ||
| com_github_msgpack_msgpack_c = dict( | ||
| commit = "83a82e3eb512b18d4149cabb7eb43c7e8bc081af", | ||
| remote = "https://github.com/msgpack/msgpack-c", # v3.1.1 | ||
| ), | ||
| com_github_google_jwt_verify = dict( | ||
| commit = "66792a057ec54e4b75c6a2eeda4e98220bd12a9a", # 2018-08-17 | ||
| remote = "https://github.com/google/jwt_verify_lib", | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,37 @@ | ||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| # Trace driver for Datadog (https://datadoghq.com/) | ||
|
|
||
| load( | ||
| "//bazel:envoy_build_system.bzl", | ||
| "envoy_cc_library", | ||
| "envoy_package", | ||
| ) | ||
|
|
||
| envoy_package() | ||
|
|
||
| envoy_cc_library( | ||
| name = "datadog_tracer_lib", | ||
| srcs = [ | ||
| "datadog_tracer_impl.cc", | ||
| ], | ||
| hdrs = [ | ||
| "datadog_tracer_impl.h", | ||
| ], | ||
| external_deps = ["dd_opentracing_cpp"], | ||
| deps = [ | ||
| "//source/common/tracing:http_tracer_lib", | ||
| "//source/extensions/tracers/common/ot:opentracing_driver_lib", | ||
| ], | ||
| ) | ||
|
|
||
| envoy_cc_library( | ||
| name = "config", | ||
| srcs = ["config.cc"], | ||
| hdrs = ["config.h"], | ||
| deps = [ | ||
| ":datadog_tracer_lib", | ||
| "//source/extensions/tracers:well_known_names", | ||
| "//source/server:configuration_lib", | ||
| ], | ||
| ) |
This file contains hidden or 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,48 @@ | ||
| #include "extensions/tracers/datadog/config.h" | ||
|
|
||
| #include "envoy/registry/registry.h" | ||
|
|
||
| #include "common/common/utility.h" | ||
| #include "common/tracing/http_tracer_impl.h" | ||
|
|
||
| #include "extensions/tracers/datadog/datadog_tracer_impl.h" | ||
| #include "extensions/tracers/well_known_names.h" | ||
|
|
||
| #include "datadog/opentracing.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Extensions { | ||
| namespace Tracers { | ||
| namespace Datadog { | ||
|
|
||
| Tracing::HttpTracerPtr | ||
| DatadogTracerFactory::createHttpTracer(const envoy::config::trace::v2::Tracing& configuration, | ||
| Server::Instance& server) { | ||
|
|
||
| ProtobufTypes::MessagePtr config_ptr = createEmptyConfigProto(); | ||
|
|
||
| if (configuration.http().has_config()) { | ||
| MessageUtil::jsonConvert(configuration.http().config(), *config_ptr); | ||
| } | ||
|
|
||
| const auto& datadog_config = | ||
| dynamic_cast<const envoy::config::trace::v2::DatadogConfig&>(*config_ptr); | ||
|
|
||
| Tracing::DriverPtr datadog_driver{new Driver{datadog_config, server.clusterManager(), | ||
| server.stats(), server.threadLocal(), | ||
| server.runtime()}}; | ||
| return std::make_unique<Tracing::HttpTracerImpl>(std::move(datadog_driver), server.localInfo()); | ||
| } | ||
|
|
||
| std::string DatadogTracerFactory::name() { return TracerNames::get().Datadog; } | ||
|
|
||
| /** | ||
| * Static registration for the Datadog tracer. @see RegisterFactory. | ||
| */ | ||
| static Registry::RegisterFactory<DatadogTracerFactory, Server::Configuration::TracerFactory> | ||
| register_; | ||
|
|
||
| } // namespace Datadog | ||
| } // namespace Tracers | ||
| } // namespace Extensions | ||
| } // namespace Envoy |
This file contains hidden or 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,33 @@ | ||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "envoy/server/instance.h" | ||
|
|
||
| #include "server/configuration_impl.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Extensions { | ||
| namespace Tracers { | ||
| namespace Datadog { | ||
|
|
||
| /** | ||
| * Config registration for the Datadog tracer. @see TracerFactory. | ||
| */ | ||
| class DatadogTracerFactory : public Server::Configuration::TracerFactory { | ||
| public: | ||
| // TracerFactory | ||
| Tracing::HttpTracerPtr createHttpTracer(const envoy::config::trace::v2::Tracing& configuration, | ||
| Server::Instance& server) override; | ||
|
|
||
| ProtobufTypes::MessagePtr createEmptyConfigProto() override { | ||
| return std::make_unique<envoy::config::trace::v2::DatadogConfig>(); | ||
| } | ||
|
|
||
| std::string name() override; | ||
| }; | ||
|
|
||
| } // namespace Datadog | ||
| } // namespace Tracers | ||
| } // namespace Extensions | ||
| } // namespace Envoy |
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.
Move before DynamicOtConfig so it's with the other specific-tracer-configs.