Recently I came across some log-overflow problems, and they must be fixed,
so I decided to make some changes in this middleware.
I will not delete some old args,
despite some overlapping (remove_labels can be replaced with new custom_base_labels for example), -
don't want to break API and functionality with this update.
- Init parameter
custom_base_labels- if you want change default labels to yours - pass them here.
REWRITES DEFAULT LABLES. Argsremove_labelsWILL BE IGNORED.
example -['path','method']- and you have metric, that contains onlypathandmethodlabels. - Init parameter
custom_base_headers- if you want change default headers to yours - pass them here.
REWRITES DEFAULT HEADERS. Argsadditional_headersWILL BE IGNORED.
If you usecustom_base_labels, don't forget to passheadersin it,
otherwisecustom_base_headerswill have no effect.
example -['content-type','x-api-client']- and now you write only these two headers. - Init parameter
aggregate_paths- if you have endpoints like/item/{id}, then, by default,
your logs will quickly overflow, showing you huge amount of numbers, when, in fact,
there is only one endpoint. So pass here list of endpoints path to aggregate by.
example -['/item/']