Question

I am creating metrics which have the following pattern:

MyApp.<environment>.<hostname>.DB.some_metric

The metric must start with "MyApp" and the third segment should be "DB". How do I specify a pattern with two wildcarded segments?

I've tried

MyApp\.*\.*\.DB\.

and

MyApp\.*\.DB\.

but neither are matching. The creates log is showing that new metrics are being matched to the default schema.

I have other applications with different retention policies that also have a "DB" segment so a pattern like \.DB\. would not be specific enough.

Was it helpful?

Solution

I was able to get this to work with the following pattern:

pattern = ^MyApp\..*\.DB\.

The extra period helped match any string between the two segments of known values.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top