Project

Profile

Help

Support #5072

pass distributed tracing data through xslt transformer

Added by Alexey Oparin about 2 months ago. Updated about 2 months ago.

Status:
New
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.

History

#1 Updated by Michael Kay about 2 months 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.

#2 Updated by Alexey Oparin about 2 months 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.

Please register to edit this issue

Also available in: Atom PDF