You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Need to generate telemetry for Expand, Resultify, ARAX_query #2923
At today's performances and testing call it was noted that there are still substantial gaps in the ARAX telemetry.
For example, xDTD is now instrumented and we get lots of telemetry for each one of its SQLite calls, but then when xDTD is done, there is silence for the rest of the processing, where presumably it is doing a lookup call to Retriever, then merging the results of xDTD and Retriever and then doing NGD lookups and then scoring, and then transmitting back to ARS. None of that seems to be intrumented and thus there is no visibility in Jaeger. Consensus is that it should be.
Thanks for bringing this to my attention. I'm also going to tentatively co-assign this to @chunyuma since it involves (in part) xDTD. I think @bazarkua can look into the non-xDTD telemetry parts of ARAX. Maybe it is turned off, globally? (For a while, we had it turned off by default in ARAX).
@edeutsch I have a clarifying question. The reports that you got from the Performance and Testing call, did they say which ARAX service/maturity was not transmitting OTel data? Was it ITRB CI? Or ITRB Test? Or ITRB Prod?
@saramsey These reports are related to the CI maturity (although I strongly suspect that they are equally applicable to TEST and PROD but not examined there)
Therefore fixes for this can go in as PRs against master
@saramsey I looked into this on CI. Telemetry is not turned off. ARAX is sending spans to Jaeger and they show up there. The gap is that ARAX itself creates almost no spans of its own. Everything we see in Jaeger comes from automatic instrumentation of libraries: every SQLite call, every incoming Flask request, and every outgoing HTTP call made with requests or aiohttp (for example to NodeNorm and Retriever). The only spans written into ARAX code by hand are the two Pathfinder ones added in #2919.
That is why xDTD looks well instrumented. It makes thousands of SQLite calls, and each one becomes a span automatically. The steps after xDTD (merging the xDTD and Retriever results, NGD lookups, scoring, building the response) have no spans of their own. Where a step reads SQLite, like the NGD lookups, we only see anonymous SELECT spans, and nothing says which step is running or how long it took. For example, in one xDTD query on CI the request took 21.9 s, and the last span ended at 20.6 s, so the final 1.3 s has nothing in it.
I also checked why Expand's call to Retriever was missing from those traces. I sent one lookup query to arax.ci.transltr.io with bypass_cache, so Expand had to call Retriever. Its trace has the aiohttp span for the POST to retriever.ci.transltr.io, and Retriever's and Gandalf's own spans are in the same trace. So the aiohttp instrumentation works. In the earlier traces the call was missing because no HTTP call was made, which is what happens when the answer comes from ARAX's KP cache. Right now a cache hit is invisible in Jaeger.
To get tracing for the rest of the processing, we can add a span around each ARAXi action in the main processing loop here (expand, overlay, resultify, rank_results, and so on), plus the result transformer and saving the response, and a span for each KP call in Expand with the KP name, cache hit or miss, and number of results. That should cover all the gaps listed above.
@chunyuma just to clarify, there is no problem in xDTD itself. xDTD looks the most detailed in Jaeger because the SQLite auto-instrumentation turns every SQLite query it runs into a span.
One optional idea for xDTD, only if you think it is useful: a single span around the xDTD call, for example with the number of predicted drugs and paths. Then in Jaeger it is easy to see where xDTD starts and ends, instead of only a long list of SELECT spans (about 9,500 in one query on CI). (just a suggestion)
Thank you so much for your suggestions @chunyuma. We have actually resolved the issue of thousands of SQLite calls in xDTD in #2894 (by using batch query, which reduces thousands of calls to only 3-4). However, it seems like this PR is still under tests by @hodgesf. So, I would like to get an idea from Frankie to see whether it is ready to be merged.
Activity
saramsey commentedon Oct 20, 2026
Thanks for bringing this to my attention. I'm also going to tentatively co-assign this to @chunyuma since it involves (in part) xDTD. I think @bazarkua can look into the non-xDTD telemetry parts of ARAX. Maybe it is turned off, globally? (For a while, we had it turned off by default in ARAX).
saramsey commentedon Oct 20, 2026
@edeutsch I have a clarifying question. The reports that you got from the Performance and Testing call, did they say which ARAX service/maturity was not transmitting OTel data? Was it ITRB CI? Or ITRB Test? Or ITRB Prod?
chunyuma commentedon Oct 20, 2026
@saramsey @bazarkua, please let me know what I can help with this issue.
edeutsch commentedon Oct 20, 2026
@saramsey These reports are related to the CI maturity (although I strongly suspect that they are equally applicable to TEST and PROD but not examined there)
Therefore fixes for this can go in as PRs against
masterbazarkua commentedon Oct 21, 2026
@saramsey I looked into this on CI. Telemetry is not turned off. ARAX is sending spans to Jaeger and they show up there. The gap is that ARAX itself creates almost no spans of its own. Everything we see in Jaeger comes from automatic instrumentation of libraries: every SQLite call, every incoming Flask request, and every outgoing HTTP call made with
requestsoraiohttp(for example to NodeNorm and Retriever). The only spans written into ARAX code by hand are the two Pathfinder ones added in #2919.That is why xDTD looks well instrumented. It makes thousands of SQLite calls, and each one becomes a span automatically. The steps after xDTD (merging the xDTD and Retriever results, NGD lookups, scoring, building the response) have no spans of their own. Where a step reads SQLite, like the NGD lookups, we only see anonymous
SELECTspans, and nothing says which step is running or how long it took. For example, in one xDTD query on CI the request took 21.9 s, and the last span ended at 20.6 s, so the final 1.3 s has nothing in it.I also checked why Expand's call to Retriever was missing from those traces. I sent one lookup query to
arax.ci.transltr.iowithbypass_cache, so Expand had to call Retriever. Its trace has theaiohttpspan for thePOSTtoretriever.ci.transltr.io, and Retriever's and Gandalf's own spans are in the same trace. So theaiohttpinstrumentation works. In the earlier traces the call was missing because no HTTP call was made, which is what happens when the answer comes from ARAX's KP cache. Right now a cache hit is invisible in Jaeger.Commands and output
Where ARAX spans come from on CI (last 48 h):
Spans written by hand in ARAX code:
The xDTD query example:
Lookup query with the cache bypassed, so Expand must call Retriever:
Its trace in Jaeger, spans by service and instrumentation:
To get tracing for the rest of the processing, we can add a span around each ARAXi action in the main processing loop here (
expand,overlay,resultify,rank_results, and so on), plus the result transformer and saving the response, and a span for each KP call in Expand with the KP name, cache hit or miss, and number of results. That should cover all the gaps listed above.RTX/code/ARAX/ARAXQuery/ARAX_query.py
Lines 757 to 762 in b2ce180
@edeutsch I'll open a PR with the fix against
master.bazarkua commentedon Oct 21, 2026
@chunyuma just to clarify, there is no problem in xDTD itself. xDTD looks the most detailed in Jaeger because the SQLite auto-instrumentation turns every SQLite query it runs into a span.
One optional idea for xDTD, only if you think it is useful: a single span around the xDTD call, for example with the number of predicted drugs and paths. Then in Jaeger it is easy to see where xDTD starts and ends, instead of only a long list of
SELECTspans (about 9,500 in one query on CI). (just a suggestion)chunyuma commentedon Oct 21, 2026
Thank you so much for your suggestions @chunyuma. We have actually resolved the issue of thousands of SQLite calls in xDTD in #2894 (by using batch query, which reduces thousands of calls to only 3-4). However, it seems like this PR is still under tests by @hodgesf. So, I would like to get an idea from Frankie to see whether it is ready to be merged.