Search code examples
dashboardmetricsdatadog

Suffix and Prefix Asterisk in combination with Wildcard in Datadog Metrics


It's quite simple: I have

  • a datadog-dashbaord
  • a template-variable named env, which can have following values ['prod', 'test']

enter image description here

And I want to display metrics based on the env:

  • from-resource for test is unified-importer-test-sqsimportdlq11419573-xl6dn7o5wqtj
  • from-resource for prod is unified-importer-prod-sqsimportdlq11419573-prmohksrvxxg

So naturally I'd use following syntax: unified-importer-$env.value-sqsimportdlq*

But this does not display anything, nor shows it any error.

This, however, works as expected: unified-importer-test-sqsimportdlq* (or unified-importer-prod-sqsimportdlq* respectively).

It looks like asterisk in combination with wildcards is not working.

Additionally, DD seems to dislike using two asterisks (as prefix and suffix): enter image description here

How can I leverage the template-var env easily in this situation?


Solution

  • Well, it turned out that following solution works:

    sum:aws.sqs.approximate_number_of_messages_visible{service:unified-importer AND env:$env.value AND queuename IN (unified-importer-test-sqsimportdlq86419573-al6dn7o5wqtj,unified-importer-prod-sqsimportdlq86419573-prmohksrvmxg)}