Add custom attribute for payment address in checkout service#3203
Add custom attribute for payment address in checkout service#3203bpschmitt wants to merge 2 commits intoopen-telemetry:mainfrom
Conversation
There was a problem hiding this comment.
Why would we add a custom attribute to the checkout service's oteldemo.CheckoutService/PlaceOrder span for the payment service hostname? That information is already available on the RPC client span oteldemo.PaymentService/Charge via the server.address attribute (trace screenshot below).
In practice, invocation details such as server.address or status_code are captured on RPC/HTTP/DB client spans.
That said, it could be worth verifying whether we’re making proper use of the Feature Flags attributes (semconv). We should also consider whether relying on them might make troubleshooting too straightforward, which could undermine one of the goals of the OTel Demo: providing a realistic environment to evaluate observability troubleshooting workflows.
|
@cyrille-leclerc the |
|
Here is below the error RPC client span, as you highlight, it lacks the Should we discuss with the instrumentation library @julianocosta89 what do you think of this next step to engage with the I think that the code relates to:
|
I believe this is gold! Yes! We should definitely engage with |
|
Given this is a bug upstream in grpc go, should we create an issue our side to track and close this PR? |

Changes
Summary
Adds an OpenTelemetry span attribute
app.payment.service.addressto the chargeCard function in the checkout service to improve observability of payment service routing.Changes in src/checkout/main.go:
app.payment.service.addressspan attribute to every call through chargeCard, recording which gRPC endpoint was targeted for the payment charge requestPAYMENT_ADDR)paymentUnreachablefeature flag is enabled, the attribute reflects the injected bad address (badAddress:50051), making fault injection clearly visible in tracesAttribute naming follows OpenTelemetry semantic conventions, using the
app.payment.*namespace consistent with other checkout service span attributes (e.g.,app.payment.transaction.id).Motivation
Previously, the paymentUnreachable feature flag would silently redirect traffic to a bad address with no trace-level indication of which endpoint was called. This change makes payment service routing observable in every request, which is especially valuable when diagnosing failures caused by fault injection.
Merge Requirements
For new features contributions, please make sure you have completed the following
essential items:
CHANGELOG.mdupdated to document new feature additions