You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2022/02/16 08:42:52 UTC
[skywalking] branch master updated: Allow updating non-metrics templates when structure changed (#8549)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new b33b786 Allow updating non-metrics templates when structure changed (#8549)
b33b786 is described below
commit b33b78637bb404da93abf3880d914aaaf91b16af
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Wed Feb 16 16:42:29 2022 +0800
Allow updating non-metrics templates when structure changed (#8549)
---
CHANGES.md | 1 +
.../storage/plugin/elasticsearch/base/StorageEsInstaller.java | 6 ++----
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index b4afded..e5efc99 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -59,6 +59,7 @@ Release Notes.
* [Break Change] Keep the endpoint avg resp time meter name the same with others scope. (This may break 3rd party integration and existing alarm rule settings)
* Add Python FastApi component ID(7014).
* Support all metrics from MAL engine in alarm core, including Prometheus, OC receiver, meter receiver.
+* Allow updating non-metrics templates when structure changed.
#### UI
diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
index 4bdfb01..478e5ea 100644
--- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
+++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
@@ -81,7 +81,7 @@ public class StorageEsInstaller extends ModelInstaller {
boolean exist = templateExists && lastIndexExists;
- if (exist && IndexController.INSTANCE.isMetricModel(model)) {
+ if (exist) {
structures.putStructure(
tableName, template.get().getMappings()
);
@@ -119,9 +119,7 @@ public class StorageEsInstaller extends ModelInstaller {
String indexName = TimeSeriesUtils.latestWriteIndexName(model);
try {
boolean shouldUpdateTemplate = !esClient.isExistsTemplate(tableName);
- if (IndexController.INSTANCE.isMetricModel(model)) {
- shouldUpdateTemplate = shouldUpdateTemplate || !structures.containsStructure(tableName, mapping);
- }
+ shouldUpdateTemplate = shouldUpdateTemplate || !structures.containsStructure(tableName, mapping);
if (shouldUpdateTemplate) {
structures.putStructure(tableName, mapping);
boolean isAcknowledged = esClient.createOrUpdateTemplate(