-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ilya Amelevich <ilya.amelevich@gmail.com>
- Loading branch information
1 parent
01134f9
commit 6ccaade
Showing
3 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
docs/fastify-metrics.iroutelabelsoverrides.getroutelabel.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [fastify-metrics](./fastify-metrics.md) > [IRouteLabelsOverrides](./fastify-metrics.iroutelabelsoverrides.md) > [getRouteLabel](./fastify-metrics.iroutelabelsoverrides.getroutelabel.md) | ||
|
||
## IRouteLabelsOverrides.getRouteLabel property | ||
|
||
Function that will return route value for metrics label. By default will use: `request.routeConfig.statsId ?? request.routerPath` | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
getRouteLabel?: (request: FastifyRequest) => string; | ||
``` | ||
|
||
## Example | ||
|
||
To use route full url as label: | ||
|
||
```ts | ||
getRouteLabel: (request) => request.raw.url; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters