Now I encounter a problem when, after restarting Ingester, the data in /var/tempo/wal/search/ is reset. Is there anything I can do to change this behavior?
Hi, Tempo v1.2+ should preserve the search data. I think what you are noticing is expected behavior with WAL replay after an ingester restarts. Tempo writes traces to the write ahead logs in /var/tempo/wal/<uuid file>, and matching search data in /var/tempo/wal/search/<uuid file>. Every few minutes the WAL files are moved and resaved as backend blocks in /var/tempo/wal/blocks/<tenant>/<uuid> (timing is controlled by ingester max_block_duration and max_block_bytes config options). On restart, existing WAL files are immediately replayed and moved, instead of waiting. Therefore it will look like /search/ is reset, but the previous data was actually moved to /blocks/.
Are you seeing missing search results?
We can follow some steps to confirm the data is still present after a restart.
While ingester is running, list the contents of /var/tempo/wal/search/ and note a block’s uuid.
Restart the ingester and wait a few moments.
Verify the same uuid is now present in /var/tempo/wal/blocks/<tenant>/<uuid> and it contains search-related files.
Check ingester logs during restart for the following messages:
4.1 "beginning wal replay"
4.2 "beginning replay" file=<uuid>....
4.3 "replay complete" file=<uuid>...
4.4 "wal replay complete"
One trace managed to hit the tempo after the restart. Before that, there were about 20 of them in the search field.
The search is performed only on new blocks, which are located in /var/tempo/wal/search/
Everything in /var/tempo/wal/blocks/<tenant>/<uuid> is ignored by Tempo
Thanks for the info and screenshot. It looks like the issue is that the service drop down is not fully populated after a restart. That is true, Tempo 1.2.1 only populates the drop downs from data received since last restart. If your traffic volume is infrequent, then this can present a problem. We have a PR in progress to improve this, and it will populate from all data.
Despite the UI, the search API will work as expected. Try curling http://<tempo>:3200/api/search?service.name=<name>. It will find traces for the service even if it is not in the drop down. Tempo-query (jaeger-query) won’t allow search without a service, but Grafana will. A work around would be to use the experimental search UI in Grafana 8.2+ (8.3 recommended), and type service.name=<name> in the Tags field, leaving service drop down empty. Some instructions to enable this feature in Grafana are here.