Skip to content

Commit

Permalink
extend zipkin exporter with ability to provide headers
Browse files Browse the repository at this point in the history
  • Loading branch information
andriy-fd committed Aug 13, 2021
1 parent 91215cd commit dc33a3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct ZipkinExporterOptions
std::string service_name = "default-service";
std::string ipv4;
std::string ipv6;
ext::http::client::Headers headers = {{"content-type", "application/json"}};
};

namespace trace_sdk = opentelemetry::sdk::trace;
Expand Down
2 changes: 1 addition & 1 deletion exporters/zipkin/src/zipkin_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ 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);
auto result = http_client_->Post(url_parser_.url_, body_v, options_.headers);
if (result &&
(result.GetResponse().GetStatusCode() == 200 || result.GetResponse().GetStatusCode() == 202))
{
Expand Down

0 comments on commit dc33a3f

Please sign in to comment.