From 7d428ecc2d6409eab3d4060d7c8b2e18339db939 Mon Sep 17 00:00:00 2001 From: "silas.u" <41794887+sialais@users.noreply.github.com> Date: Thu, 2 Sep 2021 19:09:01 +0800 Subject: [PATCH] More document for meter configurations in backend-meter.md (#7637) --- CHANGES.md | 1 + docs/en/setup/backend/backend-meter.md | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 07f248c3c6..eb3fe2f714 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -64,6 +64,7 @@ Release Notes. * Add a section in `Log Collecting And Analysis` doc, introducing the new Python agent log reporter. * Add one missing step in `otel-receiver` doc about how to activate the default receiver. * Reorganize dynamic configuration doc. +* Add more description about meter configurations in `backend-meter` doc. All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/96?closed=1) diff --git a/docs/en/setup/backend/backend-meter.md b/docs/en/setup/backend/backend-meter.md index 178c043e6c..258ee1d396 100644 --- a/docs/en/setup/backend/backend-meter.md +++ b/docs/en/setup/backend/backend-meter.md @@ -2,6 +2,7 @@ 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). ## Module definition +Module definition is defined in `application.yml`, typically located at `$SKYWALKING_BASE_DIR/config/application.yml` by default. ```yaml receiver-meter: selector: ${SW_RECEIVER_METER:default} @@ -17,6 +18,13 @@ kafka-fetcher: bootstrapServers: ${SW_KAFKA_FETCHER_SERVERS:localhost:9092} ``` +## Meter collection + +Metrics named in OAL script could be used in MAL, as described in [Official OAL script](../../guides/backend-oal-scripts.md) + +Custom metrics may be collected by Manual Meter API. You may find correct APIs diving into [Server Agents](../service-agent/server-agents.md). +Custom metrics collected cannot be used directly, they should be configured in `meter-analyzer-config` configuration files, which is described in next part. + ## Configuration file The meter receiver is configured via a configuration file. The configuration file defines everything related to receiving from agents, as well as which rule files to load. @@ -24,7 +32,16 @@ The meter receiver is configured via a configuration file. The configuration fil 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 are located at `$CLASSPATH/meter-analyzer-config`. -The file is written in YAML format, defined by the scheme described below. Brackets indicate that a parameter is optional. +New meter-analyzer-config files is **NOT** enabled by default, you should make meter configuration take effect through section `agent-analyzer` in `application.yml` of skywalking backend. +```yaml + agent-analyzer: + selector: ${SW_AGENT_ANALYZER:default} + default: + # ... take care of other analyzers + meterAnalyzerActiveFiles: ${SW_METER_ANALYZER_ACTIVE_FILES:your-custom-meter-conf-without-ext-name} # The multiple files should be separated by "," +``` + +Meter-analyzer-config file is written in YAML format, defined by the scheme described below. Brackets indicate that a parameter is optional. An example can be found [here](../../../../oap-server/server-bootstrap/src/main/resources/meter-analyzer-config/spring-sleuth.yaml). If you're using Spring Sleuth, see [Spring Sleuth Setup](spring-sleuth-setup.md). @@ -42,9 +59,10 @@ expSuffix: metricPrefix: # 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. + # The name of rule, which combinates with a prefix '_' as the index/table name in storage. + # The name with prefix can also be quoted in UI (Dashboard/Template/Item/Metrics) name: - # MAL expression. + # MAL expression. Raw name of custom metrics collected can be used here exp: ```