metrics: add a very basic ConnectionTracer

This commit is contained in:
Marten Seemann
2024-01-13 15:27:40 +07:00
parent a555a14ae3
commit 2968b93ea8
3 changed files with 131 additions and 0 deletions

View File

@@ -19,6 +19,18 @@ quic.Transport{
When using multiple `Transport`s, it is recommended to use the metrics tracer struct for all of them.
Set a metrics connection tracer on the `Config`:
```go
tracer := metrics.DefaultTracer()
quic.Config{
Tracer: tracer,
}
```
It is recommended to use the same connection tracer returned by `DefaultTracer` on the `Config`s for all connections.
Running:
```shell
docker-compose up