hi, I want to use skywalking for business metrics monitoring. The
configuration is as follows: 1. agent-analyzer in application.yml:
agent-analyzer:
selector: ${SW_AGENT_ANALYZER:default}
meterAnalyzerActiveFiles:
${SW_METER_ANALYZER_ACTIVE_FILES:datasource,threadpool,satellite,spring-meter}
2. meter-analyzer-config/spring-meter.yaml
expSuffix: instance(['service'], ['instance'], Layer.GENERAL)
metricPrefix: meter_order
metricsRules:
- name: dzx_increase_count
exp: dzx_increase_count.increase("PT1M")
- name: new_increase_count
exp: new_increase_count.increase("PT1M")
- name: test_increase_count
exp: test_increase_count.increase("PT1M")
3.test interface
@GetMapping("meter")
public void meter() {
Counter counter = MeterFactory
.counter(new
MeterId("new_increase_count",MeterId.MeterType.COUNTER))
.tag("Order Count", "100")
.mode(Counter.Mode.INCREMENT).build();
counter.increment(Math.random()*10);
Counter counter1 = MeterFactory
.counter(new
MeterId("test_increase_count",MeterId.MeterType.COUNTER))
.tag("Test Count", "100")
.mode(Counter.Mode.INCREMENT).build();
counter1.increment(Math.random()*10);
log.info("{}:{}", counter1.getName(),counter.get());
}
There are the following questions 1. Is the configuration correct? 2.
Which indexes in elasticaserch the data is stored in? Ability to find relevant
data in sw_metrics-all. {"_index": "sw_metrics-all-20220921","_id":
"meter_order_test_increase_count_202209211103_YWlzcC1jbG91ZA==.1_NmMdddddddddmQzYWIwNGE0ZTU4ZTRAMTAuMTMuMTQuMTIw","_score":
7.472535,"_source": {"metric_table":
"meter_order_test_increase_count","service_id": "YWlzdddddG91ZA==.1","count":
1,"time_bucket": 202209211103,"entity_id":
"YWlzcC1jbG91ZA==.1_NmM0YjhhddddddddGE0ZTU4ZTRAMTAuMTMuMTQuMTIw","value":
0,"summation": 0}}3. Only executed the test interface three times. Why does the
data auto-increment?
4. No data can be found.
watch
org.apache.skywalking.oap.server.library.client.elasticsearch.ElasticSearchClient
ids "{params,returnObj}" -x 4
Through arthas investigation, it is found that the id of the query is
inconsistent with the id of the stored data.
id of the query:
"meter_order_test_increase_count_202209211103_YWlzcC1jbG91ZA==.1"
id of the stored:
"meter_order_test_increase_count_202209211103_YWlzcC1jbG91ZA==.1_NmMdddddddddmQzYWIwNGE0ZTU4ZTRAMTAuMTMuMTQuMTIw",