Skip to content

Commit

Permalink
Merge branch 'master' into logs-api-update
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSeufert authored Dec 18, 2020
2 parents 84076e5 + c8054c5 commit 78fc630
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
8 changes: 6 additions & 2 deletions bazel/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ def opentelemetry_cpp_deps():

# OTLP Protocol definition
maybe(
native.new_local_repository,
http_archive,
name = "com_github_opentelemetry_proto",
build_file = "//bazel:opentelemetry_proto.BUILD",
path = "third_party/opentelemetry-proto",
sha256 = "08f090570e0a112bfae276ba37e9c45bf724b64d902a7a001db33123b840ebd6",
strip_prefix = "opentelemetry-proto-0.6.0",
urls = [
"https://github.com/open-telemetry/opentelemetry-proto/archive/v0.6.0.tar.gz",
],
)

# JSON library
Expand Down
12 changes: 3 additions & 9 deletions examples/otlp/foo_library/foo_library.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,23 @@ nostd::shared_ptr<trace::Tracer> get_tracer()
return provider->GetTracer("foo_library");
}

// TODO: Remove all calls to span->End() once context memory issue is fixed
// (https://github.com/open-telemetry/opentelemetry-cpp/issues/287)

void f1()
{
auto span = get_tracer()->StartSpan("f1");
span->End();
auto scoped_span = trace::Scope(get_tracer()->StartSpan("f1"));
}

void f2()
{
auto span = get_tracer()->StartSpan("f2");
auto scoped_span = trace::Scope(get_tracer()->StartSpan("f2"));

f1();
f1();
span->End();
}
} // namespace

void foo_library()
{
auto span = get_tracer()->StartSpan("library");
auto scoped_span = trace::Scope(get_tracer()->StartSpan("library"));

f2();
span->End();
}
2 changes: 1 addition & 1 deletion third_party/opentelemetry-proto

0 comments on commit 78fc630

Please sign in to comment.