MeiliSearch/milli/src
meili-bors[bot] 023c2d755f
Merge #4391
4391: Tracing r=dureuill a=irevoire

# Pull Request

- [ ] Hide the parameters of the process batch
- [x] Make actix-web trace every call on every route
- [x] Remove all `env_logger`/`logs` dependencies
- [x] Be able to enable or disable the memory measurement using the `/logs` route parameters

See the following product discussion: https://github.com/orgs/meilisearch/discussions/721

Supersedes https://github.com/meilisearch/meilisearch/pull/4338

## Related issue
Fixes https://github.com/meilisearch/meilisearch/issues/4317

## What does this PR do?

Update the format of the logs from:
```
[2024-02-06T14:54:11Z INFO  actix_server::builder] starting 10 workers
```

to

```
2024-02-06T13:58:14.710803Z  INFO actix_server::builder: 200: starting 10 workers
```

First, run meilisearch with the route enabled via the feature flag:
- `cargo run --experimental-enable-logs-route`
- Or at runtime by sending the following payload:
```
curl \
  -X PATCH 'http://localhost:7700/experimental-features/' \
  -H 'Content-Type: application/json'  \
--data-binary '{
    "logsRoute": true
  }'
```

Then gather data from meilisearch by calling for example:
```
curl \
	-X POST http://localhost:7700/logs \
	-H 'Content-Type: application/json' \
	--data-binary '{
	    "mode": "fmt",
            "target": "milli=trace"
    }'
```

Once your operation is over, tell meilisearch to stop the route:
```
curl \
	-X DELETE http://localhost:7700/logs
```

----

In the case you’re profiling code, you will be interested by the next command that converts the output of the route to a format that the firefox profiler can understand.

```bash
cargo run --release --bin trace-to-firefox -- 2024-01-17_17:07:55-indexing-trace.json
```

Then go to https://profiler.firefox.com and load it.
Note that we can also share the profiles using the https://share.firefox.dev website.


Co-authored-by: Louis Dureuil <louis@meilisearch.com>
Co-authored-by: Clément Renault <clement@meilisearch.com>
Co-authored-by: Tamo <tamo@meilisearch.com>
2024-02-08 14:16:56 +00:00
..
documents Add tracing to milli 2024-02-08 15:03:31 +01:00
facet update milli with the new parser_filter 2021-11-04 15:02:36 +01:00
heed_codec Clarify an unreachable unwrap 2023-11-28 14:26:31 +01:00
prompt Remove prompt strategy and fallback 2023-12-14 16:08:41 +01:00
search get rids of log in milli and add logs for the bucket sort 2024-02-08 15:04:05 +01:00
snapshots/index.rs Fix tests 2023-06-14 13:30:52 +02:00
update Merge #4391 2024-02-08 14:16:56 +00:00
vector get rids of log in milli and add logs for the bucket sort 2024-02-08 15:04:05 +01:00
asc_desc.rs fmt 2023-03-30 23:37:26 +02:00
criterion.rs update the syntax of the geoboundingbox filter to uses brackets instead of parens around lat and lng 2023-02-06 16:50:27 +01:00
error.rs Don't accept dimensions of 0 (ever) or dimensions greater than the default dimensions of the model 2024-02-07 11:52:09 +01:00
external_documents_ids.rs Make clippy happy 2023-11-23 14:11:38 +01:00
fields_ids_map.rs Rename trait 2023-11-13 13:38:36 +01:00
index.rs Various changes 2023-12-14 16:08:41 +01:00
lib.rs hybrid search uses semantic ratio, error handling 2023-12-14 16:08:42 +01:00
proximity.rs Change the naming of attributeScale and wordScale into byAttribute and byWord 2023-12-14 16:31:00 +01:00
score_details.rs Small commit to add hybrid search and autoembedding 2023-12-14 16:07:48 +01:00
snapshot_tests.rs Update tests 2023-11-13 13:36:39 +01:00