Instana tag filter expressions
With tag filter expression, you can specify conditions that Instana uses to selectively display or analyze data.
- What are tags?
- What is a tag filter expression?
- Structure of a tag filter expression in Instana
- Components of tag filter expressions (TFEs)
What is a tag filter expression?
Tag filter expression 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". Alternatively you can create a filter expression to monitor metrics specifically from hosts tagged with "AWS" and "us-east-1".
Tag filter expressions typically use logical operators (AND, OR) and comparison operators (equals, not equals) to combine tags and define the filtering rules effectively. Tag filter expressions are essential for focusing monitoring efforts on specific subsets of your infrastructure or applications, helping you efficiently 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.
Components of tag filter expressions (TFEs)
Using tag filter expressions you can filter your query with tags and logical operators such as AND
and OR
. You can also refine your data views by applying these expressions in the UI.
To work with TFEs, you can add the following information:
- tagFilterExpression: Use tags and operators to filter your query. Logical operators like
AND
andOR
can be used to combine multiple tag conditions. - name: The name of the tag as returned by the catalog (for example,
beacon.meta
orbeacon.http.path
). - value: The filter value of the tag such as:
- STRING: Alphanumeric values. Valid operators such as
EQUALS
,CONTAINS
,NOT_EQUAL
,NOT_CONTAIN
,NOT_EMPTY
,IS_EMPTY
. - NUMBER: Numerical values. Valid operators such as
EQUALS
,LESS_THAN
,GREATER_THAN
. - KEY_VALUE_PAIR: For meta tags like
beacon.meta
, you can filter by settingyourMetaTagName=foo
in the value field. Valid operators such asEQUALS
,CONTAINS
,NOT_EQUAL
,NOT_CONTAIN
,NOT_EMPTY
,IS_EMPTY
.
- STRING: Alphanumeric values. Valid operators such as
- operator: One of the valid operators for the type of the selected tag.
To get a list of all available tags, you can query the tag catalog.
Tag catalog references
To explore all available tags, you can query the following tag catalogs:
How to form a tag filter expression
-
Tag key and value:
- Tags are represented as key-value pairs.
- Example:
environment:production
, whereenvironment
is the tag key andproduction
is the tag value.
-
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.
- AND operator (
-
Comparison operators:
- Equals (
=
): Matches a specific tag value. - Not qquals (
!=
): Does not match a specific tag value. - Exists (
exists
): Checks if a tag exists for an entity.
- Equals (
Examples of tag filter expressions
-
Simple tag match:
- Filter for services tagged with
environment:production
. - Expression:
environment:production
- Filter for services tagged with
-
Multiple tags with AND operator:
- Filter for hosts that are tagged with both
environment:production
andservice:backend
. - Expression:
environment:production && service:backend
- Filter for hosts that are tagged with both
-
OR operator for alternative tags:
- Filter for services that are tagged with either
environment:production
orenvironment:staging
. - Expression:
environment:production || environment:staging
- Filter for services that are tagged with either
-
Combining AND and OR:
- Filter for services that are tagged with
environment:production
and eitherservice:frontend
orservice:backend
. - Expression:
environment:production && (service:frontend || service:backend)
- Filter for services that are tagged with
-
Negation with NOT operator:
- Filter for hosts not tagged with
environment:development
. - Expression:
!environment:development
- Filter for hosts not tagged with
-
Checking tag existence:
- Filter for services where the
version
tag exists. - Expression:
version:exists
- Filter for services where the
Notes
- Parentheses
()
can be used to group conditions for clarity and to specify the order of operations. - Instana's tag filter expressions allow for complex criteria to precisely define which monitored entities and metrics must be included or excluded from analysis or monitoring views. Adjustments can be made dynamically based on your monitoring needs and infrastructure setup.