Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: add tracing #4338

Closed
wants to merge 17 commits into from
Closed

Draft: add tracing #4338

wants to merge 17 commits into from

Conversation

dureuill
Copy link
Contributor

@dureuill dureuill commented Jan 17, 2024

TBD

TODO at the very end:

  • Review the API-key rights required to use the route

Right now, a profile will be generated for any indexing operation.

You can convert your trace into a Firefox profile using the following command. Go to https://profiler.firefox.com and load it. Note that we can also share the profiles using the https://share.firefox.dev website.

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

@irevoire irevoire mentioned this pull request Feb 6, 2024
4 tasks
@Kerollmops
Copy link
Member

Superseeded by #4391.

@Kerollmops Kerollmops closed this Feb 6, 2024
@Kerollmops Kerollmops deleted the tracing branch February 6, 2024 16:08
meili-bors bot added a commit that referenced this pull request Feb 8, 2024
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 #4338

## Related issue
Fixes #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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants