backend-meter.md 2.2 KB
Newer Older
W
Wing 已提交
1 2
# Meter receiver
The meter receiver accepts the metrics of [meter protocol](https://github.com/apache/skywalking-data-collect-protocol/blob/master/language-agent/Meter.proto) into the [meter system](./../../concepts-and-designs/meter.md).
3

W
Wing 已提交
4
## Module definition
5
```yaml
6 7 8 9
receiver-meter:
  selector: ${SW_RECEIVER_METER:default}
  default:

10 11
```

W
Wing 已提交
12
In Kafka Fetcher, follow these configurations to enable it.  
13 14 15 16 17 18 19 20
```yaml
kafka-fetcher:
  selector: ${SW_KAFKA_FETCHER:default}
  default:
    bootstrapServers: ${SW_KAFKA_FETCHER_SERVERS:localhost:9092}
    enableMeterSystem: ${SW_KAFKA_FETCHER_ENABLE_METER_SYSTEM:true}
```

21
## Configuration file
W
Wing 已提交
22
The meter receiver is configured via a configuration file. The configuration file defines everything related to receiving 
23 24
 from agents, as well as which rule files to load.
 
W
Wing 已提交
25
The OAP can load the configuration at bootstrap. If the new configuration is not well-formed, the OAP may fail to start up. The files
26
are located at `$CLASSPATH/meter-analyzer-config`.
27 28 29

The file is written in YAML format, defined by the scheme described below. Brackets indicate that a parameter is optional.

wu-sheng's avatar
wu-sheng 已提交
30
An example can be found [here](../../../../oap-server/server-bootstrap/src/main/resources/meter-analyzer-config/spring-sleuth.yaml).
W
Wing 已提交
31
If you're using Spring Sleuth, see [Spring Sleuth Setup](spring-sleuth-setup.md).
32

W
Wing 已提交
33
### Meters configuration
34 35

```yaml
36 37 38 39 40 41 42 43 44 45
# expSuffix is appended to all expression in this file.
expSuffix: <string>
# insert metricPrefix into metric name:  <metricPrefix>_<raw_metric_name>
metricPrefix: <string>
# Metrics rule allow you to recompute queries.
metricsRules:
  # The name of rule, which combinates with a prefix 'meter_' as the index/table name in storage.
  name: <string>
  # MAL expression.
  exp: <string>
46 47
```

W
Wing 已提交
48
For more information on MAL, please refer to [mal.md](../../concepts-and-designs/mal.md)
49

W
Wing 已提交
50
#### `rate`, `irate`, and `increase`
51

W
Wing 已提交
52 53 54
Although we support the `rate`, `irate`, `increase` functions in the backend, we still recommend users to consider using client-side APIs to run these functions. The reasons are as follows:
1. The OAP has to set up caches to calculate the values.
1. Once the agent reconnects to another OAP instance, the time windows of rate calculation break. This leads to inaccurate results.