This is an automated email from the ASF dual-hosted git repository.
wankai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-showcase.git
The following commit(s) were added to refs/heads/main by this push:
new dd9864d Implement self-monitoring for BanyanDB via OAP Server and UI.
(#211)
dd9864d is described below
commit dd9864d3d19c6939954b7780dd576b64671bcd3c
Author: Ricky Xiang <[email protected]>
AuthorDate: Tue Oct 28 07:58:46 2025 +0000
Implement self-monitoring for BanyanDB via OAP Server and UI. (#211)
---
deploy/platform/docker/Makefile.in | 2 +-
.../config/otel-collector-config-banyandb.yaml | 48 ++++++++++++++++++++++
...ile.in => docker-compose.banyandb-monitor.yaml} | 20 ++++++++-
.../docker/docker-compose.single-node.yaml | 13 ++++--
deploy/platform/kubernetes/Makefile | 5 +++
deploy/platform/kubernetes/Makefile.in | 2 +-
.../opentelemetry-config.yaml | 36 ++++++++++++++++
.../templates/otel-collector-config.yaml | 1 +
deploy/platform/kubernetes/values.yaml | 5 ++-
docs/readme.md | 4 +-
10 files changed, 126 insertions(+), 10 deletions(-)
diff --git a/deploy/platform/docker/Makefile.in
b/deploy/platform/docker/Makefile.in
index 4e726b2..ab1f5bc 100644
--- a/deploy/platform/docker/Makefile.in
+++ b/deploy/platform/docker/Makefile.in
@@ -17,4 +17,4 @@
#
.EXPORT_ALL_VARIABLES:
-FEATURE_FLAGS ?=
agent,cluster,so11y,vm-monitor,event,mysql-monitor,nginx-monitor,apisix-monitor,grafana,elasticsearch-monitor,pulsar-monitor,activemq-monitor
+FEATURE_FLAGS ?=
agent,cluster,so11y,vm-monitor,event,mysql-monitor,nginx-monitor,apisix-monitor,grafana,elasticsearch-monitor,pulsar-monitor,activemq-monitor,banyandb-monitor
diff --git a/deploy/platform/docker/config/otel-collector-config-banyandb.yaml
b/deploy/platform/docker/config/otel-collector-config-banyandb.yaml
new file mode 100644
index 0000000..cdd57c8
--- /dev/null
+++ b/deploy/platform/docker/config/otel-collector-config-banyandb.yaml
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+receivers:
+ prometheus:
+ config:
+ scrape_configs:
+ - job_name: "banyandb-monitoring"
+ scrape_interval: 10s
+ static_configs:
+ - targets: ["banyandb:2121"]
+ labels:
+ host_name: root[root]
+
+processors:
+ batch:
+
+exporters:
+ otlp:
+ endpoint: "oap:11800"
+ tls:
+ insecure: true
+ debug:
+ verbosity: detailed
+
+service:
+ pipelines:
+ metrics:
+ receivers:
+ - prometheus
+ processors:
+ - batch
+ exporters:
+ - otlp
+
+
diff --git a/deploy/platform/docker/Makefile.in
b/deploy/platform/docker/docker-compose.banyandb-monitor.yaml
similarity index 66%
copy from deploy/platform/docker/Makefile.in
copy to deploy/platform/docker/docker-compose.banyandb-monitor.yaml
index 4e726b2..f938d99 100644
--- a/deploy/platform/docker/Makefile.in
+++ b/deploy/platform/docker/docker-compose.banyandb-monitor.yaml
@@ -16,5 +16,21 @@
# under the License.
#
-.EXPORT_ALL_VARIABLES:
-FEATURE_FLAGS ?=
agent,cluster,so11y,vm-monitor,event,mysql-monitor,nginx-monitor,apisix-monitor,grafana,elasticsearch-monitor,pulsar-monitor,activemq-monitor
+version: '2.1'
+
+services:
+ otel-collector:
+ image: ${OTEL_COLLECTOR_IMAGE}:${OTEL_COLLECTOR_IMAGE_TAG}
+ networks:
+ - sw
+ command: [ "--config=/etc/otel-collector-config.yaml" ]
+ volumes:
+ -
./config/otel-collector-config-banyandb.yaml:/etc/otel-collector-config.yaml
+ expose:
+ - 55678
+ depends_on:
+ oap:
+ condition: service_healthy
+networks:
+ sw:
+
diff --git a/deploy/platform/docker/docker-compose.single-node.yaml
b/deploy/platform/docker/docker-compose.single-node.yaml
index ae36e7e..9e4b1a3 100644
--- a/deploy/platform/docker/docker-compose.single-node.yaml
+++ b/deploy/platform/docker/docker-compose.single-node.yaml
@@ -23,9 +23,11 @@ services:
networks: [ sw ]
expose:
- 17912
+ - 2121
ports:
- "17913:17913"
- command: standalone --observability-modes=native
+ - "2121:2121"
+ command: standalone
healthcheck:
test: ["CMD", "nc", "-z", "127.0.0.1", "17913"]
interval: 30s
@@ -35,10 +37,15 @@ services:
oap:
image: ${SW_OAP_IMAGE}:${SW_OAP_IMAGE_TAG}
networks: [ sw ]
+ expose:
+ - 11800
+ ports:
+ - "11800:11800"
+ - "12800:12800"
environment:
SW_HEALTH_CHECKER: default # @feature: health-check;
SW_OTEL_RECEIVER: default # @feature: vm; enable the OC receiver that
receives the VM metrics
- SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:
vm,mysql/*,postgresql/*,elasticsearch/*,rabbitmq/*,mongodb/*,rocketmq/*,pulsar/*,activemq/*,flink/*
# @feature: vm,mysql,postgresql,elasticsearch; enable the OC rules that
analyse the metrics
+ SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:
banyandb,vm,mysql/*,postgresql/*,elasticsearch/*,rabbitmq/*,mongodb/*,rocketmq/*,pulsar/*,activemq/*,flink/*
# @feature: vm,mysql,postgresql,elasticsearch; enable the OC rules that
analyse the metrics
SW_STORAGE: banyandb
SW_STORAGE_BANYANDB_TARGETS: banyandb:17912
SW_TELEMETRY: prometheus # @feature: so11y; expose the metrics of self
o11y through prometheus
@@ -55,7 +62,7 @@ services:
condition: service_healthy
ui:
- image: ${SW_UI_IMAGE}
+ image: ${SW_UI_IMAGE}:${SW_UI_IMAGE_TAG}
networks: [ sw ]
ports:
- "9999:8080"
diff --git a/deploy/platform/kubernetes/Makefile
b/deploy/platform/kubernetes/Makefile
index e4d58e9..fc20eb3 100644
--- a/deploy/platform/kubernetes/Makefile
+++ b/deploy/platform/kubernetes/Makefile
@@ -148,6 +148,11 @@ feature-mysql-monitor:
$(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
features.mysqlMonitor.enabled=true)
$(eval HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry.enabled=true)
+.PHONY: feature-banyandb-monitor
+feature-banyandb-monitor:
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
features.banyandbMonitor.enabled=true)
+ $(eval HELM_OPTIONS := $(HELM_OPTIONS) --set opentelemetry.enabled=true)
+
.PHONY: feature-postgresql-monitor
feature-postgresql-monitor:
$(eval HELM_OPTIONS := $(HELM_OPTIONS) --set
features.postgresqlMonitor.enabled=true)
diff --git a/deploy/platform/kubernetes/Makefile.in
b/deploy/platform/kubernetes/Makefile.in
index 0f8b85f..3085ed3 100644
--- a/deploy/platform/kubernetes/Makefile.in
+++ b/deploy/platform/kubernetes/Makefile.in
@@ -25,4 +25,4 @@ RELEASE ?= demo
AGENTLESS ?= false
SCALLER_ENABLE ?= false
-FEATURE_FLAGS ?=
java-agent-injector,cluster,banyandb,kubernetes-monitor,so11y,vm-monitor,als,event,istiod-monitor,satellite,rover,trace-profiling,mysql-monitor,postgresql-monitor,nginx-monitor,apisix-monitor,grafana,rabbitmq-monitor,mongodb-monitor,r3,rocketmq-monitor,pulsar-monitor,activemq-monitor,flink-monitor
+FEATURE_FLAGS ?=
banyandb-monitor,java-agent-injector,cluster,banyandb,kubernetes-monitor,so11y,vm-monitor,als,event,istiod-monitor,satellite,rover,trace-profiling,mysql-monitor,postgresql-monitor,nginx-monitor,apisix-monitor,grafana,rabbitmq-monitor,mongodb-monitor,r3,rocketmq-monitor,pulsar-monitor,activemq-monitor,flink-monitor
diff --git
a/deploy/platform/kubernetes/templates/feature-banyandb-monitor/opentelemetry-config.yaml
b/deploy/platform/kubernetes/templates/feature-banyandb-monitor/opentelemetry-config.yaml
new file mode 100644
index 0000000..c3a873a
--- /dev/null
+++
b/deploy/platform/kubernetes/templates/feature-banyandb-monitor/opentelemetry-config.yaml
@@ -0,0 +1,36 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- define "opentelemetry-config-banyandb-monitor" }}
+{{- if .Values.features.banyandbMonitor.enabled }}
+
+# @feature: banyandb-monitor; set OpenTelemetry config to scrape the banyandb
metrics
+- job_name: 'banyandb-monitoring'
+ metrics_path: '/metrics'
+ kubernetes_sd_configs:
+ - role: pod
+ relabel_configs:
+ - source_labels: [ __meta_kubernetes_pod_name,
__meta_kubernetes_pod_container_port_name ]
+ action: keep
+ regex: .+banyandb.+;observability
+ - source_labels: [ ]
+ target_label: host_name
+ replacement: banyandb.{{ .Release.Namespace }}
+ - source_labels: [ __meta_kubernetes_pod_name ]
+ target_label: service_instance_id
+ regex: (.+)
+ replacement: $$1
+{{- end }}
+{{- end }}
diff --git a/deploy/platform/kubernetes/templates/otel-collector-config.yaml
b/deploy/platform/kubernetes/templates/otel-collector-config.yaml
index 0e1e6d4..46b40f3 100644
--- a/deploy/platform/kubernetes/templates/otel-collector-config.yaml
+++ b/deploy/platform/kubernetes/templates/otel-collector-config.yaml
@@ -32,6 +32,7 @@
"opentelemetry-config-pulsar-monitor"
"opentelemetry-config-activemq-monitor"
"opentelemetry-config-flink-monitor"
+ "opentelemetry-config-banyandb-monitor"
}}
---
apiVersion: v1
diff --git a/deploy/platform/kubernetes/values.yaml
b/deploy/platform/kubernetes/values.yaml
index 8e6a5c5..4098f56 100644
--- a/deploy/platform/kubernetes/values.yaml
+++ b/deploy/platform/kubernetes/values.yaml
@@ -40,7 +40,7 @@ skywalking:
# @feature: istiod-monitor; enable rules to analyze Istio control plane
metrics
# @feature: mysql; enable mysql rules to analyze MySQL metrics
# @feature: apisix-monitor; enable APISIX rules to analyze APISIX metrics
- SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:
vm,oap,k8s/*,istio-controlplane,mysql/*,postgresql/*,apisix,elasticsearch/*,rabbitmq/*,mongodb/*,nginx/*,rocketmq/*,pulsar/*,activemq/*,flink/*
+ SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:
vm,oap,k8s/*,istio-controlplane,mysql/*,postgresql/*,apisix,elasticsearch/*,rabbitmq/*,mongodb/*,nginx/*,rocketmq/*,pulsar/*,activemq/*,flink/*,banyandb/*
SW_TELEMETRY: prometheus # @feature: so11y; expose the metrics of self
o11y through prometheus
SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS: "mx-mesh,persistence" # @feature:
als; enable mesh analyzer (mx-mesh) to analyze ALS logs
K8S_SERVICE_NAME_RULE:
"mesh-svr::${service.metadata.name}.${service.metadata.namespace}"
@@ -626,3 +626,6 @@ features:
flinkMonitor:
enabled: false
+
+ banyandbMonitor:
+ enabled: false
\ No newline at end of file
diff --git a/docs/readme.md b/docs/readme.md
index 7221e0b..4ae9022 100644
--- a/docs/readme.md
+++ b/docs/readme.md
@@ -117,8 +117,8 @@ Currently, the features supported are:
| `activemq-monitor` | Deploy OpenTelemetry and export [ActiveMQ
classic](https://activemq.apache.org/components/classic/) monitoring metrics to
SkyWalking for analysis and display on UI. |
|
| `cilium` | Deploy Cilium and showcase services in a separate
namespace, SkyWalking fetch Cilium Services Traffic to analysis and display on
UI. | Only support deployment
in the Kubernetes environment, docker is not supported.
|
| `baseline` | Deploy
[SkyPredictor](https://github.com/SkyAPM/SkyPredictor) as baseline calculator
to predict metrics.
| Only support deployment in the Kubernetes environment,
docker is not supported. |
-| `flink-monitor` | Deploy OpenTelemetry and export Flink monitoring
metrics to SkyWalking for analysis and display on UI.
-
+| `flink-monitor` | Deploy OpenTelemetry and export Flink monitoring
metrics to SkyWalking for analysis and display on UI.
+| `banyandb-monitor` | Deploy OpenTelemetry and export BanyanDB
monitoring metrics to SkyWalking for analysis and display on UI.
|
|
### Kubernetes
To deploy the example application in Kubernetes, please make sure that you
have `kubectl` command available, and it can