Primary **SCOPE**s are `All`, `Service`, `ServiceInstance`, `Endpoint`, `ServiceRelation`, `ServiceInstanceRelation`, `EndpointRelation`.
Also there are some secondary scopes, which belongs to one primary scope.
Primary **SCOPE**s are `All`, `Service`, `ServiceInstance`, `Endpoint`, `ServiceRelation`, `ServiceInstanceRelation`, and `EndpointRelation`.
There are also some secondary scopes which belong to a primary scope.
Read [Scope Definitions](scope-definitions.md), you can find all existing Scopes and Fields.
See [Scope Definitions](scope-definitions.md), where you can find all existing Scopes and Fields.
## Filter
Use filter to build the conditions for the value of fields, by using field name and expression.
Use filter to build conditions for the value of fields by using field name and expression.
The expressions support to link by `and`, `or` and `(...)`.
The OPs support `==`, `!=`, `>`, `<`, `>=`, `<=`, `in [...]` ,`like %...`, `like ...%` , `like %...%` , `contain` and `not contain`, with type detection based of field type. Trigger compile
or code generation error if incompatible.
The expressions support linking by `and`, `or` and `(...)`.
The OPs support `==`, `!=`, `>`, `<`, `>=`, `<=`, `in [...]` ,`like %...`, `like ...%` , `like %...%` , `contain` and `not contain`, with type detection based on field type. In the event of incompatibility, compile or code generation errors may be triggered.
## Aggregation Function
The default functions are provided by SkyWalking OAP core, and could implement more.
The default functions are provided by the SkyWalking OAP core, and it is possible to implement additional functions.
Provided functions
Functions provided
-`longAvg`. The avg of all input per scope entity. The input field must be a long.
In this case, all input are requests of each browser app traffic,`numerator` condition is `trafficCategory == BrowserAppTrafficCategory.FIRST_ERROR` and `denominator` condition is `trafficCategory == BrowserAppTrafficCategory.NORMAL`.
The parameter (1) is the `numerator` condition.
The parameter (2) is the `denominator` condition.
-`sum`. The sum calls per scope entity.
In this case, all input represents requests of each browser app traffic, the`numerator` condition is `trafficCategory == BrowserAppTrafficCategory.FIRST_ERROR` and `denominator` condition is `trafficCategory == BrowserAppTrafficCategory.NORMAL`.
Parameter (1) is the `numerator` condition.
Parameter (2) is the `denominator` condition.
-`sum`. The sum of calls per scope entity.
> service_calls_sum = from(Service.*).sum();
In this case, calls of each service.
In this case, the number of calls of each service.
-`histogram`. Read [Heatmap in WIKI](https://en.wikipedia.org/wiki/Heat_map)
-`histogram`. See [Heatmap in WIKI](https://en.wikipedia.org/wiki/Heat_map).
In this case, thermodynamic heatmap of all incoming requests.
The parameter (1) is the precision of latency calculation, such as in above case, 113ms and 193ms are considered same in the 101-200ms group.
The parameter (2) is the group amount. In above case, 21(param value + 1) groups are 0-100ms, 101-200ms, ... 1901-2000ms, 2000+ms
In this case, the thermodynamic heatmap of all incoming requests.
Parameter (1) is the precision of latency calculation, such as in the above case, where 113ms and 193ms are considered the same in the 101-200ms group.
Parameter (2) is the group amount. In the above case, 21(param value + 1) groups are 0-100ms, 101-200ms, ... 1901-2000ms, 2000+ms
-`apdex`. Read [Apdex in WIKI](https://en.wikipedia.org/wiki/Apdex)
-`apdex`. See [Apdex in WIKI](https://en.wikipedia.org/wiki/Apdex).
**percentile** is the first multiple value metrics, introduced since 7.0.0. As having multiple values, it could be query through`getMultipleLinearIntValues` GraphQL query.
In this case, `p99`, `p95`, `p90`, `p75`, `p50` of all incoming request. The parameter is the precision of p99 latency calculation, such as in above case, 120ms and 124 are considered same.
Before 7.0.0, use `p99`, `p95`, `p90`, `p75`, `p50` func(s) to calculate metrics separately. Still supported in 7.x, but don't be recommended, and don't be included in official OAL script.
**percentile** is the first multiple-value metric, which has been introduced since 7.0.0. As a metric with multiple values, it could be queried through the`getMultipleLinearIntValues` GraphQL query.
In this case, see `p99`, `p95`, `p90`, `p75`, and `p50` of all incoming requests. The parameter is precise to a latency at p99, such as in the above case, and 120ms and 124ms are considered to produce the same response time.
Before 7.0.0, `p99`, `p95`, `p90`, `p75`, `p50` func(s) are used to calculate metrics separately. They are still supported in 7.x, but they are no longer recommended and are not included in the current official OAL script.
> all_p99 = from(All.latency).p99(10);
In this case, p99 value of all incoming requests. The parameter is the precision of p99 latency calculation, such as in above case, 120ms and 124 are considered same.
In this case, the p99 value of all incoming requests. The parameter is precise to a latency at p99, such as in the above case, and 120ms and 124ms are considered to produce the same response time.
## Metrics name
The metrics name for storage implementor, alarm and query modules. The type inference supported by core.
The metrics name for storage implementor, alarm and query modules. The type inference is supported by core.
## Group
All metrics data will be grouped by Scope.ID and min-level TimeBucket.
- In `Endpoint` scope, the Scope.ID = Endpoint id (the unique id based on service and its Endpoint)
- In the `Endpoint` scope, the Scope.ID is same as the Endpoint ID (i.e. the unique ID based on service and its endpoint).
## Disable
`Disable` is an advanced statement in OAL, which is only used in certain case.
Some of the aggregation and metrics are defined through core hard codes,
this `disable` statement is designed for make them de-active,
such as `segment`, `top_n_database_statement`.
In default, no one is being disable.
`Disable` is an advanced statement in OAL, which is only used in certain cases.
Some of the aggregation and metrics are defined through core hard codes. Examples include `segment` and `top_n_database_statement`.
This `disable` statement is designed to render them inactive.