I want to filter metrics on tag value with a regex. I can do it in Prometheus but I could not find an equivalent way in Datadog.
For example, to select the following metric whose status
tag value starts with 2
, I can use the query http.server.requests.count{status=~"^2..$"}
I have the same metric with the same tags in Datadog too, but couldn't find a way to have the same query.
By adding tags to your metrics you can observe and alert on metrics from different hardware profiles, software versions, availability zones, services, roles—or any other level you may require.
Short answer: Unfortunately, no.
Sending custom metrics to Datadog allows you to monitor important data specific to your business and applications, such as latency, dollars per customer, items bought, or trips taken.
Creating log-based metrics in Datadog You can create a log-based metric from your log analytics queries by selecting the Generate new Metric option from your graph. Alternatively, navigate to the Generate Metrics tab of the logs configuration section in the Datadog app to create a new query.
Metrics queries now support wildcards.
Example 1: Getting all the requests with a status tag starting with 2
:
http.server.requests.count{status:2*}
Example 1: Getting all the requests with a service tag ending with mongo
:
http.server.requests.count{service:*mongo}
Example 3 (advanced): Getting all the requests with a service tag starting with blob
and ending with postgres
:
http.server.requests.count{service:blob*,service:*postgres}
(this will match service:blob-foo-postgres
and service:blob_bar_postgres
but not service:my_name_postgres
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With