-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add initial OpenCensus tracing support. #5387
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
e517ebf
Add initial OpenCensus tracing support.
g-easy de6b334
tools/check_repositories.sh: make regexes look for word start.
g-easy 0c17e0a
Fix clang_tidy error.
g-easy 461d9b0
Merge remote-tracking branch 'origin/master' into oc
g-easy 0bcaf23
Merge remote-tracking branch 'origin/master' into oc
g-easy ec0f25d
Fix mismerge.
g-easy 2f0d285
Remove debugging printfs.
g-easy d96f105
Add explicit break.
g-easy 0e28684
Format fix.
g-easy e54cadb
Add opencensus:config_test.
g-easy 1081de3
Don't apply empty TraceConfig.
g-easy 471dc28
Add opencensus:tracer_test.
g-easy e5d3b9a
clang_tidy fixes.
g-easy c5d46f4
Merge remote-tracking branch 'origin/master' into oc
g-easy 7e444e3
Mark config proto experimental.
g-easy 0902d7d
Use OpenCensus propagation helpers for traceparent, grpc-trace-bin.
g-easy 710a6a4
Don't use glob() in curl.BUILD.
g-easy 886bccb
Merge remote-tracking branch 'origin/master' into oc
g-easy 06e0d1e
Merge remote-tracking branch 'origin/master' into oc
g-easy bd901c5
Bump date.
g-easy 024611d
Caps.
g-easy 8f0a4ff
Use camelCase, add comments about interplay with exporter thread.
g-easy 916b860
Merge remote-tracking branch 'origin/master' into oc
g-easy a984a60
Use ENVOY_LOG_MISC for debug string.
g-easy 38a19c6
Variable names.
g-easy 78d3320
Make samplers non-static.
g-easy 16a3e3d
Remove underscore.
g-easy 16d9939
Delete commented out leftover.
g-easy cdc9b3c
Comment.
g-easy 7bbdce8
Merge remote-tracking branch 'origin/master' into oc
g-easy b19efcb
Upgrade opencensus-cpp dep.
g-easy 9a1c637
Better example of trace_config.
g-easy cd0486b
Reset TraceParams back to default.
g-easy 85d4e77
format
g-easy 93846d4
Merge remote-tracking branch 'origin/master' into oc
g-easy a9e19df
Add log()
g-easy 40f4308
Update opencensus-proto to catch trace_config.proto change.
g-easy ec14fd5
Update ConstantSampler handling.
g-easy d65ebb0
Use envoy_cmake_external for curl.
g-easy e17a406
Update config and tracer test.
g-easy f7a90b3
Fix compile_time_options: set CMAKE_BUILD_TYPE for curl.
g-easy 8eea063
Optionally accept and propagate an incoming trace context.
g-easy 26853eb
Fix config test.
g-easy 0afc3eb
Fix envoy.api.
g-easy e5c743e
Merge remote-tracking branch 'origin/master' into oc
g-easy 9efab49
Upgrade and correctly name opencensus_proto.
g-easy fd739ca
clang-tidy fixup.
g-easy 19dbc58
Fix build:go_build_test
g-easy 1c56a62
Merge remote-tracking branch 'origin/master' into oc
g-easy c06ae5f
Merge remote-tracking branch 'origin/master' into oc
g-easy a7f53f2
Test constant_sampler and more of the config.
g-easy 5b78b82
format
g-easy 6a3e7db
Test spawnChild().
g-easy 0b0f6df
Test injectContext().
g-easy 8ab8440
format
g-easy db9f80f
Merge remote-tracking branch 'origin/master' into oc
g-easy 199a060
Merge remote-tracking branch 'origin/master' into oc
g-easy f2ca81e
Upgrade OpenCensus C++ to work around bazel build error.
g-easy 6ccab02
Need to also upgrade absl to get new flag name.
g-easy 1fb1b9c
Catch up to new API.
g-easy 142a386
Fix libcurl linkage.
g-easy ee4d4d0
Merge remote-tracking branch 'origin/master' into oc
g-easy 41f7dff
Change of direction: don't upgrade absl.
g-easy bbaca7f
Patch opencensus to work with current absl.
g-easy 7d07e53
Adapt to commit 8d1ad35aa7
g-easy a4e7038
Avoid ODR by not using lightstep_vendored_googleapis.
g-easy 4719582
Switch custom googleapis build to the native cc_proto_library rule.
g-easy 154b58c
Add @googleapis//:tracing_proto for stackdriver trace.
g-easy 88e6a19
curl without libssh2, trying to fix macos build.
g-easy f587ee8
Review comments.
g-easy b87a8e1
grpc-trace-bin needs to be base64 encoded/decoded without padding.
g-easy 9ca882f
Finish todo: tests for grpc-trace-bin.
g-easy c8fc2c9
Spellcheck doesn't like the comment.
g-easy 03df4ad
Add decode_without_padding().
g-easy 2d9e96b
Use decode_without_padding().
g-easy 9d89449
decodeWithoutPadding rename + take string_view
g-easy 4e3245c
Make ALWAYS_ON fallthrough.
g-easy 4122637
Current span context is always valid.
g-easy 3b9ced4
Factor out SamplerTestHelper and increase coverage.
g-easy 7385873
speling
g-easy 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| load("@io_opencensus_cpp//opencensus:curl.bzl", "CURL_COPTS") | ||
|
|
||
| package(features = ["no_copts_tokenization"]) | ||
|
|
||
| config_setting( | ||
| name = "windows", | ||
| values = {"cpu": "x64_windows"}, | ||
| visibility = ["//visibility:private"], | ||
| ) | ||
|
|
||
| config_setting( | ||
| name = "osx", | ||
| values = {"cpu": "darwin"}, | ||
| visibility = ["//visibility:private"], | ||
| ) | ||
|
g-easy marked this conversation as resolved.
Outdated
|
||
|
|
||
| cc_library( | ||
|
g-easy marked this conversation as resolved.
Outdated
|
||
| name = "curl", | ||
| srcs = glob([ | ||
| "lib/**/*.c", | ||
| ]), | ||
| hdrs = glob([ | ||
| "include/curl/*.h", | ||
| "lib/**/*.h", | ||
| ]), | ||
| copts = CURL_COPTS + [ | ||
| "-DOS=\"os\"", | ||
| "-DCURL_EXTERN_SYMBOL=__attribute__((__visibility__(\"default\")))", | ||
| ], | ||
| includes = [ | ||
| "include/", | ||
| "lib/", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
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,39 @@ | ||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| # Trace driver for OpenCensus: https://opencensus.io/ | ||
|
|
||
| load( | ||
| "//bazel:envoy_build_system.bzl", | ||
| "envoy_cc_library", | ||
| "envoy_package", | ||
| ) | ||
|
|
||
| envoy_package() | ||
|
|
||
| envoy_cc_library( | ||
| name = "config", | ||
| srcs = ["config.cc"], | ||
| hdrs = ["config.h"], | ||
| deps = [ | ||
| ":opencensus_tracer_impl", | ||
| "//source/extensions/tracers:well_known_names", | ||
| "//source/extensions/tracers/common:factory_base_lib", | ||
| ], | ||
| ) | ||
|
|
||
| envoy_cc_library( | ||
| name = "opencensus_tracer_impl", | ||
| srcs = ["opencensus_tracer_impl.cc"], | ||
| hdrs = ["opencensus_tracer_impl.h"], | ||
| external_deps = [ | ||
| "opencensus_trace", | ||
| "opencensus_trace_cloud_trace_context", | ||
| "opencensus_exporter_stdout", | ||
| "opencensus_exporter_stackdriver", | ||
| "opencensus_exporter_zipkin", | ||
| ], | ||
| deps = [ | ||
| "//source/common/config:utility_lib", | ||
| "//source/common/tracing:http_tracer_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,37 @@ | ||
| #include "extensions/tracers/opencensus/config.h" | ||
|
|
||
| #include <iostream> | ||
|
|
||
| #include "envoy/registry/registry.h" | ||
|
|
||
| #include "common/tracing/http_tracer_impl.h" | ||
|
|
||
| #include "extensions/tracers/opencensus/opencensus_tracer_impl.h" | ||
| #include "extensions/tracers/well_known_names.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Extensions { | ||
| namespace Tracers { | ||
| namespace OpenCensus { | ||
|
|
||
| OpenCensusTracerFactory::OpenCensusTracerFactory() : FactoryBase(TracerNames::get().OpenCensus) { | ||
| std::cerr << "OpenCensusTracerFactory()\n"; | ||
|
g-easy marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| Tracing::HttpTracerPtr OpenCensusTracerFactory::createHttpTracerTyped( | ||
| const envoy::config::trace::v2::OpenCensusConfig& proto_config, Server::Instance& server) { | ||
| std::cerr << "OpenCensusTracerFactory::createHttpTracerTyped()\n"; | ||
| Tracing::DriverPtr driver = std::make_unique<Driver>(proto_config); | ||
| return std::make_unique<Tracing::HttpTracerImpl>(std::move(driver), server.localInfo()); | ||
| } | ||
|
|
||
| /** | ||
| * Static registration for the OpenCensus tracer. @see RegisterFactory. | ||
| */ | ||
| static Registry::RegisterFactory<OpenCensusTracerFactory, Server::Configuration::TracerFactory> | ||
|
g-easy marked this conversation as resolved.
Outdated
|
||
| register_; | ||
|
|
||
| } // namespace OpenCensus | ||
| } // 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,32 @@ | ||
| #pragma once | ||
|
|
||
| #include <string> | ||
|
|
||
| #include "envoy/config/trace/v2/trace.pb.validate.h" | ||
|
|
||
| #include "extensions/tracers/common/factory_base.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Extensions { | ||
| namespace Tracers { | ||
| namespace OpenCensus { | ||
|
|
||
| /** | ||
| * Config registration for the OpenCensus tracer. @see TracerFactory. | ||
| */ | ||
| class OpenCensusTracerFactory | ||
| : public Common::FactoryBase<envoy::config::trace::v2::OpenCensusConfig> { | ||
| public: | ||
| OpenCensusTracerFactory(); | ||
|
|
||
| private: | ||
| // FactoryBase | ||
| Tracing::HttpTracerPtr | ||
| createHttpTracerTyped(const envoy::config::trace::v2::OpenCensusConfig& proto_config, | ||
| Server::Instance& server) override; | ||
| }; | ||
|
|
||
| } // namespace OpenCensus | ||
| } // 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.
Uh oh!
There was an error while loading. Please reload this page.