I’ve currently got Tyk Pump set up with the Prometheus backend, tracking all paths and have it configured for some custom metrics (just to make the labels more relevant).
An example metric being emitted for scraping is as follows:
The path information above is valuable, but I’m not interested in the nitty gritty of the specific wildcard resource IDs that are in the URL so I was wondering if there was a way I could remove the concrete ids in favour of producing something like this:
Just to circle back to this, Olu’s suggestion did indeed work
.
In our case, we use XIDs and prefixed XIDs so we leveraged the custom_patterns part of the config.
One gotcha I found that took a moment to work out is when setting the custom patterns via environment variable (TYK_GW_ANALYTICSCONFIG_NORMALISEURLS_CUSTOM), you have to use a comma separated list string rather than a stringified array.
In our case, this meant that the working config was to set the following env vars: