From bcb4e11e18321cd53b88cb73decb68c996ded038 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Mon, 17 Oct 2022 20:55:26 -0400 Subject: [PATCH] remove baggage processing --- src/currencyservice/src/server.cpp | 47 ------------------------------ 1 file changed, 47 deletions(-) diff --git a/src/currencyservice/src/server.cpp b/src/currencyservice/src/server.cpp index 38420e45b4..2d663c76c7 100644 --- a/src/currencyservice/src/server.cpp +++ b/src/currencyservice/src/server.cpp @@ -93,20 +93,6 @@ class CurrencyService final : public hipstershop::CurrencyService::Service const Empty* request, GetSupportedCurrenciesResponse* response) override { - // Read baggage from client context - auto clientContext = context->client_metadata(); - auto range = clientContext.equal_range("baggage"); - std::vector baggageLists; - for (auto i = range.first; i != range.second; ++i) - { - baggageLists.emplace_back(std::string(i->second.data())); - } - std::vector> baggages(baggageLists.size()); - for (int i = 0; i < baggageLists.size(); i++) { - auto baggage = Baggage::FromHeader(baggageLists[i]); - baggages[i] = baggage; - } - StartSpanOptions options; options.kind = SpanKind::kServer; GrpcServerCarrier carrier(context); @@ -126,16 +112,6 @@ class CurrencyService final : public hipstershop::CurrencyService::Service options); auto scope = get_tracer("currencyservice")->WithActiveSpan(span); - for (auto& baggage : baggages) { - // Set the key value pairs from baggage to Span Attributes - baggage->GetAllEntries([&span](opentelemetry::nostd::string_view key, - opentelemetry::nostd::string_view value) { - span->SetAttribute(key, value); - return true; - }); - } - - // Fetch and parse whatever HTTP headers we can from the gRPC request. span->AddEvent("Processing supported currencies request"); for (auto &code : currency_conversion) { @@ -177,20 +153,6 @@ class CurrencyService final : public hipstershop::CurrencyService::Service const CurrencyConversionRequest* request, Money* response) override { - // Read baggage from client context - auto clientContext = context->client_metadata(); - auto range = clientContext.equal_range("baggage"); - std::vector baggageLists; - for (auto i = range.first; i != range.second; ++i) - { - baggageLists.emplace_back(std::string(i->second.data())); - } - std::vector> baggages(baggageLists.size()); - for (int i = 0; i < baggageLists.size(); i++) { - auto baggage = Baggage::FromHeader(baggageLists[i]); - baggages[i] = baggage; - } - StartSpanOptions options; options.kind = SpanKind::kServer; GrpcServerCarrier carrier(context); @@ -210,15 +172,6 @@ class CurrencyService final : public hipstershop::CurrencyService::Service options); auto scope = get_tracer("currencyservice")->WithActiveSpan(span); - for (auto& baggage : baggages) { - // Set the key value pairs from baggage to Span Attributes - baggage->GetAllEntries([&span](opentelemetry::nostd::string_view key, - opentelemetry::nostd::string_view value) { - span->SetAttribute(key, value); - return true; - }); - } - // Fetch and parse whatever HTTP headers we can from the gRPC request. span->AddEvent("Processing currency conversion request"); try {