I try to create a calculated service metric. It must capture request like: /projects/{projectId}/files/**
For example: projects/platform_features/files/help/
When I create a metric, I use the condition “request name contains regex /project\/.*\/files/.*[a-zA-Z0-9]” - this condition doesn’t work, because in metric there is “no data”, but I see these requests in MDA.
I tried to use another regex: /project/[a-zA-Z0-9]*/files/.*[a-zA-Z0-9] - but Dynatrace show me the message “Greedy or lazy character classes are not allowed, please use a possessive quantifier instead.”
And I tried the third variant: /project/[a-zA-Z0-9]/files/.*[a-zA-Z0-9] - Dynatrace doesn’t show me an error, but when I try check this regex in regex101.com - it’s an “invalid expression”.
1st You forgetting to escape special char “/” which should always be “\/” - even thou some engines accept unescaped “/” is highly recommended to do so. Every one You posted here have this issue in one or more places
2nd don’t use .*[set] as way out of greedy/lazy/possessive as it won’t work and will cause mess.
Hi @Fisher thank you for sharing what the solution happened to be! Even though it was a typo, it started a discussion that I think many people will find useful!