Skip to content

Commit

Permalink
[currency] - add span attributes (open-telemetry#265)
Browse files Browse the repository at this point in the history
* add conversion from/to attributes

* currency service attributes
  • Loading branch information
puckpuck committed Aug 5, 2022
1 parent 7dd5727 commit 128f78f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ significant modifications will be credited to OpenTelemetry Authors.
([#255](https://github.com/open-telemetry/opentelemetry-demo/pull/255))
* Added spanmetrics processor to otelcol
([#212](https://github.com/open-telemetry/opentelemetry-demo/pull/212))
* Added span attributes to currency service
([#265](https://github.com/open-telemetry/opentelemetry-demo/pull/265))
3 changes: 2 additions & 1 deletion docs/manual_span_attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ This document contains the list of manual Span Attributes used throughout the de

## CurrencyService

* None yet
* `app.currency.conversion.from`
* `app.currency.conversion.to`

## EmailService

Expand Down
3 changes: 3 additions & 0 deletions src/currencyservice/src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ class CurrencyService final : public hipstershop::CurrencyService::Service
getUnitsAndNanos(*response, final);
response->set_currency_code(to_code);

span->SetAttribute("app.currency.conversion.from", from_code);
span->SetAttribute("app.currency.conversion.to", to_code);

// End the span
span->AddEvent("Conversion successful, response sent back");
span->SetStatus(StatusCode::kOk);
Expand Down

0 comments on commit 128f78f

Please sign in to comment.