Project

Profile

Help

Support #5072

closed

pass distributed tracing data through xslt transformer

Added by Alexey Oparin over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
s9api API
Sprint/Milestone:
-
Start date:
2021-08-30
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Hello,

We have a service written in java which do xslt transformations with saxonica. On xslt stylesheets we call other services with fn:doc() or fn:document() functions suppling them HTTP URL. Now we are implementing distributed tracing of our services and faced with need to pass additional tracing headers in HTTP requests which lay under the fn:doc/fn:document calls. How can we achieve it? I guess that I need to supply something to XsltTransformer object but I can't understand what exactly it should be, unfortunately. Help please.

Alexey.

Actions #1

Updated by Michael Kay over 2 years ago

Set a URIResolver on the XSLT Transformer; this will be passed details of URI's supplied to the doc() or document() functions. In your URIResolver, perform the HTTP access using low-level Java HTTP library calls (setting the headers as required), and returning a stream. Wrap this InputStream in a StreamSource, along with the requested (or resolved) URI, and return this from your URIResolver.

Actions #2

Updated by Alexey Oparin over 2 years ago

Thank you, Michael. I did this way and it worked. Ironically, after that we tried opentelemetry java instrumentation and it worked without custom URIResolver.

Actions #3

Updated by Michael Kay over 2 years ago

  • Status changed from New to Closed

Please register to edit this issue

Also available in: Atom PDF