MAL support four type operations to filter samples in a sample family:
MAL supports four type operations to filter samples in a sample family:
- tagEqual: Filter tags that are exactly equal to the provided string.
- tagNotEqual: Filter tags that are not equal to the provided string.
- tagMatch: Filter tags that regex-match the provided string.
- tagNotMatch: Filter labels that do not regex-match the provided string.
- tagEqual: Filter tags exactly equal to the string provided.
- tagNotEqual: Filter tags not equal to the string provided.
- tagMatch: Filter tags that regex-match the string provided.
- tagNotMatch: Filter labels that do not regex-match the string provided.
For example, this filters all instance_trace_count samples for us-west and asia-north region and az-1 az:
...
...
@@ -43,14 +43,14 @@ instance_trace_count.tagMatch("region", "us-west|asia-north").tagEqual("az", "az
```
### Value filter
MAL support six type operations to filter samples in a sample family by value:
MAL supports six type operations to filter samples in a sample family by value:
- valueEqual: Filter values that are exactly equal to the provided value.
- valueNotEqual: Filter values that are not equal to the provided value.
- valueGreater: Filter values that greater than the provided value.
- valueGreaterEqual: Filter values that greater or equal the provided value.
- valueLess: Filter values that less than the provided value.
- valueLessEqual: Filter values that less or equal the provided value.
- valueEqual: Filter values exactly equal to the value provided.
- valueNotEqual: Filter values equal to the value provided.
- valueGreater: Filter values greater than the value provided.
- valueGreaterEqual: Filter values greater than or equal to the value provided.
- valueLess: Filter values less than the value provided.
- valueLessEqual: Filter values less than or equal to the value provided.
For example, this filters all instance_trace_count samples for values >= 33:
...
...
@@ -58,17 +58,17 @@ For example, this filters all instance_trace_count samples for values >= 33:
instance_trace_count.valueGreaterEqual(33)
```
### Tag manipulator
MAL provides tag manipulators to change(add/delete/update) tags and their values.
MAL allows tag manipulators to change (i.e. add/delete/update) tags and their values.
#### K8s
MAL supports using the metadata of k8s to manipulate the tags and their values.
This feature requires OAP Server to have the authority to access the K8s's `API Server`.
MAL supports using the metadata of K8s to manipulate the tags and their values.
This feature requires authorizing the OAP Server to access K8s's `API Server`.
##### retagByK8sMeta
`retagByK8sMeta(newLabelName, K8sRetagType, existingLabelName, namespaceLabelName)`. Add a new tag to the sample family based on an existing label's value. Provide several internal converting types, including
`retagByK8sMeta(newLabelName, K8sRetagType, existingLabelName, namespaceLabelName)`. Add a new tag to the sample family based on the value of an existing label. Provide several internal converting types, including
- K8sRetagType.Pod2Service
Add a tag to the sample by using `service` as the key, `$serviceName.$namespace` as the value, by the given value of the tag key, which represents the name of a pod.
Add a tag to the sample using `service` as the key, `$serviceName.$namespace` as the value, and according to the given value of the tag key, which represents the name of a pod.
For example:
```
...
...
@@ -94,7 +94,7 @@ The following binary arithmetic operators are available in MAL:
Binary operators are defined between scalar/scalar, sampleFamily/scalar and sampleFamily/sampleFamily value pairs.
Between two scalars: they evaluate to another scalar that is the result of the operator applied to both scalar operands:
Between two scalars: they evaluate to another scalar that is the result of the operator being applied to both scalar operands:
Metric has three level, service, instance and endpoint. They extract level relevant labels from metric labels, then
hints meter-system which level this metrics should be.
There are three levels in metric: service, instance and endpoint. They extract level relevant labels from metric labels, then informs the meter-system the level to which this metric belongs.
-`servcie([svc_label1, svc_label2...])` extracts service level labels from the array argument.
-`instance([svc_label1, svc_label2...], [ins_label1, ins_label2...])` extracts service level labels from the first array argument,