Skip to content

Commit

Permalink
Merge branch 'main' into RenameJaegerExporter
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Jul 21, 2021
2 parents 1314b89 + 2b3fe84 commit 3432d7a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
44 changes: 44 additions & 0 deletions exporters/zipkin/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package(default_visibility = ["//visibility:public"])

cc_library(
name = "zipkin_recordable",
srcs = [
"src/recordable.cc",
],
hdrs = [
"include/opentelemetry/exporters/zipkin/recordable.h",
],
strip_include_prefix = "include",
deps = [
"//sdk/src/resource",
"//sdk/src/trace",
"@github_nlohmann_json//:json",
],
)

cc_library(
name = "zipkin_exporter",
srcs = [
"src/zipkin_exporter.cc",
],
hdrs = [
"include/opentelemetry/exporters/zipkin/zipkin_exporter.h",
],
copts = [
"-DCURL_STATICLIB",
],
strip_include_prefix = "include",
deps = [
":zipkin_recordable",
"//ext/src/http/client/curl:http_client_curl",
],
)

cc_test(
name = "zipkin_recordable_test",
srcs = ["test/zipkin_recordable_test.cc"],
deps = [
":zipkin_recordable",
"@com_google_googletest//:gtest_main",
],
)
4 changes: 2 additions & 2 deletions exporters/zipkin/src/zipkin_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ sdk::common::ExportResult ZipkinExporter::Export(
auto body_s = json_spans.dump();
http_client::Body body_v(body_s.begin(), body_s.end());
auto result = http_client_->Post(url_parser_.url_, body_v);
if (result && result.GetResponse().GetStatusCode() == 200 ||
result.GetResponse().GetStatusCode() == 202)
if (result &&
(result.GetResponse().GetStatusCode() == 200 || result.GetResponse().GetStatusCode() == 202))
{
return sdk::common::ExportResult::kSuccess;
}
Expand Down
1 change: 0 additions & 1 deletion exporters/zipkin/test/zipkin_recordable_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ TEST(ZipkinSpanRecordable, AddEventDefault)
TEST(ZipkinSpanRecordable, AddEventWithAttributes)
{
opentelemetry::exporter::zipkin::Recordable rec;
nostd::string_view name = "Test Event";

std::chrono::system_clock::time_point event_time = std::chrono::system_clock::now();
opentelemetry::common::SystemTimestamp event_timestamp(event_time);
Expand Down

0 comments on commit 3432d7a

Please sign in to comment.