Skip to content

Releases: kozhushman/prometheusrock

New init params - full customization of labels in default metrics

02 Apr 11:02
Compare
Choose a tag to compare

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 parametercustom_base_labels - if you want change default labels to yours - pass them here.
    REWRITES DEFAULT LABLES. Args remove_labels WILL BE IGNORED.
    example - ['path','method'] - and you have metric, that contains only path and method labels.
  • Init parameter custom_base_headers - if you want change default headers to yours - pass them here.
    REWRITES DEFAULT HEADERS. Args additional_headers WILL BE IGNORED.
    If you use custom_base_labels, don't forget to pass headers in it,
    otherwise custom_base_headers will 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/']

Access to request object

11 Dec 07:05
Compare
Choose a tag to compare

Now you can access request object in your custom function

Some updates and fixes

06 Nov 14:36
Compare
Choose a tag to compare

Change Log

[0.1.1] - 06.11.2020

Fixed

Added

  • Opportunity to disable default metrics
  • Updated README

Initial

13 Oct 10:50
a8a74ae
Compare
Choose a tag to compare

Initial release, first version