Skip to content
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

Shippingservice rust #179

Merged
merged 20 commits into from
Jul 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mark span as active to send event
  • Loading branch information
GaryPWhite committed Jul 11, 2022
commit 446d165ec9bb887a3a05126a26b2f181aa6a1919
6 changes: 4 additions & 2 deletions src/shippingservice/src/shipping_service.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use opentelemetry::trace::{Span, Tracer};
use opentelemetry::trace::{mark_span_as_active, Span, Tracer};
use opentelemetry::{global, propagation::Extractor, KeyValue};
use shop::shipping_service_server::ShippingService;
use shop::{GetQuoteRequest, GetQuoteResponse, Money, ShipOrderRequest, ShipOrderResponse};
Expand Down Expand Up @@ -60,7 +60,9 @@ impl ShippingService for ShippingServer {
// We may want to ask another service for product pricing / info
// (although now everything is assumed to be the same price)
// check out the create_quote_from_count method to see how we use the span created here
global::tracer("shippingservice/get-quote").start_with_context("get-quote", &parent_cx);
let tracer = global::tracer("shippingservice/get-quote");
let span = tracer.start_with_context("get-quote", &parent_cx);
let _guard = mark_span_as_active(span);
julianocosta89 marked this conversation as resolved.
Show resolved Hide resolved

let q = create_quote_from_count(itemct);
let reply = GetQuoteResponse {
Expand Down