-
Notifications
You must be signed in to change notification settings - Fork 443
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
Legacy gRPC e2e C++11 CI #1787
Closed
Closed
Legacy gRPC e2e C++11 CI #1787
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8c0a25c
legacy gRPC e2e CI
esigo ac91703
CI
esigo 0cc089d
Merge branch 'main' into legacy-gRPC
esigo 37f3f74
Merge branch 'main' into legacy-gRPC
esigo 529bd91
clean
esigo cd7f0f7
clean
esigo bd4b698
Merge branch 'main' into legacy-gRPC
esigo 56799fa
Merge branch 'main' into legacy-gRPC
esigo dffbcf4
Merge branch 'main' into legacy-gRPC
esigo 1fcec17
Merge branch 'main' into legacy-gRPC
esigo 070251e
Merge branch 'main' into legacy-gRPC
esigo 2d17dec
Merge branch 'main' into legacy-gRPC
esigo 15f18a1
Merge branch 'main' into legacy-gRPC
esigo 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 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
third_party | ||
tools | ||
out | ||
examples/e2e |
This file contains 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 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 |
---|---|---|
|
@@ -51,3 +51,5 @@ | |
|
||
tags | ||
.cache/clangd/* | ||
|
||
e2e/bazel-* |
This file contains 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,5 @@ | ||
# bazelrc file | ||
|
||
build --cxxopt='-std=c++11' | ||
build --action_env=GRPC_BAZEL_RUNTIME=1 | ||
build --define=use_fast_cpp_protos=true |
This file contains 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,12 @@ | ||
cc_binary( | ||
name = "e2e_example_otlp_grpc", | ||
srcs = [ | ||
"grpc_main.cc", | ||
], | ||
deps = [ | ||
"@io_opentelemetry_cpp//api", | ||
"@io_opentelemetry_cpp//examples/common/foo_library:common_foo_library", | ||
"@io_opentelemetry_cpp//exporters/otlp:otlp_grpc_exporter", | ||
"@io_opentelemetry_cpp//sdk/src/trace", | ||
], | ||
) |
This file contains 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,36 @@ | ||
workspace(name = "otel_e2e") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") | ||
|
||
http_archive( | ||
name = "io_opentelemetry_cpp", | ||
repo_mapping = { | ||
"@com_github_grpc_grpc": "@com_github_grpc_grpc_latest11", | ||
}, | ||
strip_prefix = "opentelemetry-cpp-grpc_e2e", | ||
urls = [ | ||
"https://github.com/esigo/opentelemetry-cpp/archive/grpc_e2e.zip", | ||
], | ||
) | ||
|
||
# Load OpenTelemetry dependencies after load. | ||
load("@io_opentelemetry_cpp//bazel:repository.bzl", "opentelemetry_cpp_deps") | ||
|
||
opentelemetry_cpp_deps() | ||
|
||
# Load gRPC dependencies after load. | ||
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") | ||
|
||
grpc_deps() | ||
|
||
# Load extra gRPC dependencies due to https://github.com/grpc/grpc/issues/20511 | ||
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") | ||
|
||
grpc_extra_deps() | ||
|
||
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") | ||
load("@upb//bazel:workspace_deps.bzl", "upb_deps") | ||
|
||
upb_deps() |
This file contains 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,50 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h" | ||
#include "opentelemetry/sdk/trace/simple_processor_factory.h" | ||
#include "opentelemetry/sdk/trace/tracer_provider_factory.h" | ||
#include "opentelemetry/trace/provider.h" | ||
|
||
#ifdef BAZEL_BUILD | ||
# include "examples/common/foo_library/foo_library.h" | ||
#else | ||
# include "foo_library/foo_library.h" | ||
#endif | ||
|
||
namespace trace = opentelemetry::trace; | ||
namespace nostd = opentelemetry::nostd; | ||
namespace trace_sdk = opentelemetry::sdk::trace; | ||
namespace otlp = opentelemetry::exporter::otlp; | ||
|
||
namespace | ||
{ | ||
opentelemetry::exporter::otlp::OtlpGrpcExporterOptions opts; | ||
void InitTracer() | ||
{ | ||
// Create OTLP exporter instance | ||
auto exporter = otlp::OtlpGrpcExporterFactory::Create(opts); | ||
auto processor = trace_sdk::SimpleSpanProcessorFactory::Create(std::move(exporter)); | ||
std::shared_ptr<opentelemetry::trace::TracerProvider> provider = | ||
trace_sdk::TracerProviderFactory::Create(std::move(processor)); | ||
// Set the global trace provider | ||
trace::Provider::SetTracerProvider(provider); | ||
} | ||
} // namespace | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
if (argc > 1) | ||
{ | ||
opts.endpoint = argv[1]; | ||
if (argc > 2) | ||
{ | ||
opts.use_ssl_credentials = true; | ||
opts.ssl_credentials_cacert_path = argv[2]; | ||
} | ||
} | ||
// Removing this line will leave the default noop TracerProvider in place. | ||
InitTracer(); | ||
|
||
foo_library(); | ||
} |
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.
Is this needed?
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.
thanks, cleaned.