mirror of https://github.com/istio/istio.io.git
parent
fddb179a56
commit
879132e36e
|
|
@ -57,7 +57,7 @@ def getForwardHeaders(request):
|
||||||
|
|
||||||
# ...
|
# ...
|
||||||
|
|
||||||
incoming_headers = ['x-request-id']
|
incoming_headers = ['x-request-id', 'x-datadog-trace-id', 'x-datadog-parent-id', 'x-datadog-sampled']
|
||||||
|
|
||||||
# ...
|
# ...
|
||||||
|
|
||||||
|
|
@ -69,23 +69,17 @@ def getForwardHeaders(request):
|
||||||
return headers
|
return headers
|
||||||
{{< /text >}}
|
{{< /text >}}
|
||||||
|
|
||||||
The reviews application (Java) does something similar:
|
The reviews application (Java) does something similar using `requestHeaders`:
|
||||||
|
|
||||||
{{< text java >}}
|
{{< text java >}}
|
||||||
@GET
|
@GET
|
||||||
@Path("/reviews/{productId}")
|
@Path("/reviews/{productId}")
|
||||||
public Response bookReviewsById(@PathParam("productId") int productId,
|
public Response bookReviewsById(@PathParam("productId") int productId, @Context HttpHeaders requestHeaders) {
|
||||||
@HeaderParam("end-user") String user,
|
|
||||||
@HeaderParam("x-request-id") String xreq,
|
// ...
|
||||||
@HeaderParam("x-b3-traceid") String xtraceid,
|
|
||||||
@HeaderParam("x-b3-spanid") String xspanid,
|
|
||||||
@HeaderParam("x-b3-parentspanid") String xparentspanid,
|
|
||||||
@HeaderParam("x-b3-sampled") String xsampled,
|
|
||||||
@HeaderParam("x-b3-flags") String xflags,
|
|
||||||
@HeaderParam("x-ot-span-context") String xotspan) {
|
|
||||||
|
|
||||||
if (ratings_enabled) {
|
if (ratings_enabled) {
|
||||||
JsonObject ratingsResponse = getRatings(Integer.toString(productId), user, xreq, xtraceid, xspanid, xparentspanid, xsampled, xflags, xotspan);
|
JsonObject ratingsResponse = getRatings(Integer.toString(productId), requestHeaders);
|
||||||
{{< /text >}}
|
{{< /text >}}
|
||||||
|
|
||||||
When you make downstream calls in your applications, make sure to include these headers.
|
When you make downstream calls in your applications, make sure to include these headers.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue