Instana Tag Filter Expressions

What are tags?

Tags in Instana can include metadata such as environment (for example, production, staging), location, application version, or any custom attributes you define.

What is a tag filter expression?

With tag filter expression, you can specify conditions that Instana uses to selectively display or analyze data. For example, you can create a filter expression to show data that is only related to services tagged with "production" and "backend", or to monitor metrics specifically from hosts tagged with "AWS" and "us-east-1".

These expressions typically use logical operators (AND, OR) and comparison operators (equals, not equals) to combine tags and define the filtering rules effectively. They're essential for focusing monitoring efforts on specific subsets of your infrastructure or applications, making it easier to manage and troubleshoot performance issues.

Structure of a tag filter expression in Instana

In Instana, the data model for a tag filter expression follows a structured format to define conditions based on tags that are associated with monitored entities.

Structure overview

  1. Tag Key and Value:

    • Tags are represented as key-value pairs.
    • Example: environment:production, where environment is the tag key and production is the tag value.
  2. Logical Operators:

    • AND Operator (&&): Combines multiple conditions where all must be true.
    • OR Operator (||): Combines multiple conditions where at least one must be true.
    • NOT Operator (!): Negates a condition.
  3. Comparison Operators:

    • Equals (=): Matches a specific tag value.
    • Not Equals (!=): Does not match a specific tag value.
    • Exists (exists): Checks if a tag exists for an entity.

Examples of tag filter expressions

  1. Simple Tag Match:

    • Filter for services tagged with environment:production.
    • Expression: environment:production
  2. Multiple Tags with AND Operator:

    • Filter for hosts that are tagged with both environment:production and service:backend.
    • Expression: environment:production && service:backend
  3. OR Operator for Alternative Tags:

    • Filter for services that are tagged with either environment:production or environment:staging.
    • Expression: environment:production || environment:staging
  4. Combining AND and OR:

    • Filter for services that are tagged with environment:production and either service:frontend or service:backend.
    • Expression: environment:production && (service:frontend || service:backend)
  5. Negation with NOT Operator:

    • Filter for hosts not tagged with environment:development.
    • Expression: !environment:development
  6. Checking Tag Existence:

    • Filter for services where the version tag exists.
    • Expression: version:exists

Notes

  • Parentheses () can be used to group conditions for clarity and to specify the order of operations.
  • Instana's tag filter expressions are versatile and allow for complex criteria to precisely define which monitored entities and metrics should be included or excluded from analysis or monitoring views. Adjustments can be made dynamically based on your monitoring needs and infrastructure setup.