From 9d796eb2063d4379d7ccff9e3db84638c7b61f3d Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Mon, 28 Nov 2022 19:48:03 +0800 Subject: [PATCH 1/7] add service monitor --- .../webstore-demo-otel-collector-sm.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 charts/opentelemetry-demo/webstore-demo-otel-collector-sm.yaml diff --git a/charts/opentelemetry-demo/webstore-demo-otel-collector-sm.yaml b/charts/opentelemetry-demo/webstore-demo-otel-collector-sm.yaml new file mode 100644 index 0000000..4660227 --- /dev/null +++ b/charts/opentelemetry-demo/webstore-demo-otel-collector-sm.yaml @@ -0,0 +1,17 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + operator.insight.io/managed-by: insight + name: otel-collector-monitor + namespace: webstore-demo +spec: + endpoints: + - honorLabels: true + port: prometheus + namespaceSelector: + matchNames: + - webstore-demo + selector: + matchLabels: + app.kubernetes.io/name: otelcol \ No newline at end of file From ca016c2e5d3426951235a46403f43ced27d95a14 Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Mon, 28 Nov 2022 19:48:10 +0800 Subject: [PATCH 2/7] add service monitor --- charts/opentelemetry-demo/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/opentelemetry-demo/values.yaml b/charts/opentelemetry-demo/values.yaml index 7a6907a..d3df631 100644 --- a/charts/opentelemetry-demo/values.yaml +++ b/charts/opentelemetry-demo/values.yaml @@ -71,7 +71,7 @@ opentelemetry-demo: value: 8999 - name: metrics value: 12345 - - name: grpc-metrics + - name: http-metrics value: 8888 env: - name: OTEL_EXPORTER_OTLP_ENDPOINT From 2bc20636e7019d4a48bbc203e1b78850ede5b13c Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Mon, 28 Nov 2022 20:01:07 +0800 Subject: [PATCH 3/7] version bump up --- charts/opentelemetry-demo/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/opentelemetry-demo/Chart.yaml b/charts/opentelemetry-demo/Chart.yaml index dfebfe6..156eccb 100644 --- a/charts/opentelemetry-demo/Chart.yaml +++ b/charts/opentelemetry-demo/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: opentelemetry-demo type: application -version: 0.4.8 +version: 0.4.9 description: A helm chart for openTelemetry community demo application integration with other component. sources: - https://github.com/openinsight-proj/openinsight-helm-charts From 05916d3ff79562705b837b0d55996ce0ccc2df82 Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Mon, 28 Nov 2022 21:47:09 +0800 Subject: [PATCH 4/7] update --- charts/opentelemetry-demo/Chart.yaml | 2 +- .../templates/service-monitor.yaml | 36 +++++++++++++++++++ charts/opentelemetry-demo/values.yaml | 2 +- .../webstore-demo-otel-collector-sm.yaml | 17 --------- 4 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 charts/opentelemetry-demo/templates/service-monitor.yaml delete mode 100644 charts/opentelemetry-demo/webstore-demo-otel-collector-sm.yaml diff --git a/charts/opentelemetry-demo/Chart.yaml b/charts/opentelemetry-demo/Chart.yaml index 156eccb..c2ab12f 100644 --- a/charts/opentelemetry-demo/Chart.yaml +++ b/charts/opentelemetry-demo/Chart.yaml @@ -8,7 +8,7 @@ sources: maintainers: - name: JaredTan95 - name: Frapschen -appVersion: "0.4.5" +appVersion: "0.4.6" dependencies: - name: opentelemetry-demo version: 0.12.2 diff --git a/charts/opentelemetry-demo/templates/service-monitor.yaml b/charts/opentelemetry-demo/templates/service-monitor.yaml new file mode 100644 index 0000000..776ac51 --- /dev/null +++ b/charts/opentelemetry-demo/templates/service-monitor.yaml @@ -0,0 +1,36 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + operator.insight.io/managed-by: insight + name: otel-collector-monitor + namespace: webstore-demo +spec: + endpoints: + - honorLabels: true + port: prometheus + namespaceSelector: + matchNames: + - webstore-demo + selector: + matchLabels: + app.kubernetes.io/name: otelcol +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + operator.insight.io/managed-by: insight + name: adservice-monitor + namespace: webstore-demo +spec: + endpoints: + - honorLabels: true + port: http-metrics + namespaceSelector: + matchNames: + - webstore-demo + selector: + matchLabels: + { { - include "otel-demo.selectorLabels" . | nindent 4 } } + app.kubernetes.io/component: adservice \ No newline at end of file diff --git a/charts/opentelemetry-demo/values.yaml b/charts/opentelemetry-demo/values.yaml index d3df631..dd3c10b 100644 --- a/charts/opentelemetry-demo/values.yaml +++ b/charts/opentelemetry-demo/values.yaml @@ -93,7 +93,7 @@ opentelemetry-demo: value: >- k8s.namespace.name=$(K8S_NAMESPACE),k8s.node.name=$(OTEL_RESOURCE_ATTRIBUTES_NODE_NAME),k8s.pod.name=$(OTEL_RESOURCE_ATTRIBUTES_POD_NAME),k8s.pod.uid=$(OTEL_RESOURCE_ATTRIBUTES_POD_UID),skoala.registry=$(SKOALA_REGISTRY),nacos.namespaceid=$(NACSO_NAMESPACE_ID),nacos.groupname=$(NACSO_GROUP_NAME) - name: JAVA_OPTS - value: -javaagent:./jmx_prometheus_javaagent-0.17.0.jar=12345:./prometheus-jmx-config.yaml -Dspring.cloud.nacos.discovery.enabled=false -Dspring.cloud.nacos.config.enabled=false -Dspring.cloud.sentinel.enabled=false -Dspring.cloud.nacos.config.server-addr=nacos-test.skoala-test:8848 -Dspring.application.name=adservice-springcloud -Dspring.cloud.nacos.discovery.server-addr=nacos-test.skoala-test:8848 -Dspring.cloud.nacos.discovery.metadata.k8s_cluster_id=xxx -Dspring.cloud.nacos.discovery.metadata.k8s_cluster_name=skoala-dev -Dspring.cloud.nacos.discovery.metadata.k8s_namespace_name=skoala-test -Dspring.cloud.nacos.discovery.metadata.k8s_workload_type=deployment -Dspring.cloud.nacos.discovery.metadata.k8s_workload_name=adservice-springcloud -Dspring.cloud.nacos.discovery.metadata.k8s_service_name=adservice-springcloud -Dspring.cloud.nacos.discovery.metadata.k8s_pod_name=${HOSTNAME} -Dspring.cloud.sentinel.enabled=false -Dspring.cloud.sentinel.transport.dashboard=nacos-test-sentinel.skoala-test:8080 + value: -javaagent:./jmx_prometheus_javaagent-0.17.0.jar=12345:./prometheus-jmx-config.yaml -Dspring.extraAdLabel=Daocloud -Dspring.randomError=true -Dspring.matrixRow=200 -Dmeter.port=8080 -Dspring.cloud.nacos.discovery.enabled=false -Dspring.cloud.nacos.config.enabled=false -Dspring.cloud.sentinel.enabled=false -Dspring.cloud.nacos.config.server-addr=nacos-test.skoala-test:8848 -Dspring.application.name=adservice-springcloud -Dspring.cloud.nacos.discovery.server-addr=nacos-test.skoala-test:8848 -Dspring.cloud.nacos.discovery.metadata.k8s_cluster_id=xxx -Dspring.cloud.nacos.discovery.metadata.k8s_cluster_name=skoala-dev -Dspring.cloud.nacos.discovery.metadata.k8s_namespace_name=skoala-test -Dspring.cloud.nacos.discovery.metadata.k8s_workload_type=deployment -Dspring.cloud.nacos.discovery.metadata.k8s_workload_name=adservice-springcloud -Dspring.cloud.nacos.discovery.metadata.k8s_service_name=adservice-springcloud -Dspring.cloud.nacos.discovery.metadata.k8s_pod_name=${HOSTNAME} -Dspring.cloud.sentinel.enabled=false -Dspring.cloud.sentinel.transport.dashboard=nacos-test-sentinel.skoala-test:8080 podAnnotations: instrumentation.opentelemetry.io/inject-sdk: 'true' diff --git a/charts/opentelemetry-demo/webstore-demo-otel-collector-sm.yaml b/charts/opentelemetry-demo/webstore-demo-otel-collector-sm.yaml deleted file mode 100644 index 4660227..0000000 --- a/charts/opentelemetry-demo/webstore-demo-otel-collector-sm.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - operator.insight.io/managed-by: insight - name: otel-collector-monitor - namespace: webstore-demo -spec: - endpoints: - - honorLabels: true - port: prometheus - namespaceSelector: - matchNames: - - webstore-demo - selector: - matchLabels: - app.kubernetes.io/name: otelcol \ No newline at end of file From 0964867991637b0ab9e96394e6a7a70adb77fab6 Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Mon, 28 Nov 2022 21:58:39 +0800 Subject: [PATCH 5/7] fix lint --- charts/opentelemetry-demo/templates/service-monitor.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/opentelemetry-demo/templates/service-monitor.yaml b/charts/opentelemetry-demo/templates/service-monitor.yaml index 776ac51..d31613e 100644 --- a/charts/opentelemetry-demo/templates/service-monitor.yaml +++ b/charts/opentelemetry-demo/templates/service-monitor.yaml @@ -1,3 +1,4 @@ +--- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: @@ -32,5 +33,4 @@ spec: - webstore-demo selector: matchLabels: - { { - include "otel-demo.selectorLabels" . | nindent 4 } } - app.kubernetes.io/component: adservice \ No newline at end of file + app.kubernetes.io/component: adservice From 090ee8481fa280e25c2dec0914a0669a977488d1 Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Mon, 28 Nov 2022 21:59:19 +0800 Subject: [PATCH 6/7] update --- charts/opentelemetry-demo/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/opentelemetry-demo/values.yaml b/charts/opentelemetry-demo/values.yaml index dd3c10b..8a2adb6 100644 --- a/charts/opentelemetry-demo/values.yaml +++ b/charts/opentelemetry-demo/values.yaml @@ -63,7 +63,7 @@ opentelemetry-demo: env: false imageOverride: repository: ghcr.io/openinsight-proj/adservice - tag: "v0.4.3" + tag: "v0.4.6" ports: - name: http value: 8081 From 94ecad9b5d0e84971cf5a27bb5a91b498f629458 Mon Sep 17 00:00:00 2001 From: "minquan.chen" Date: Mon, 28 Nov 2022 22:04:19 +0800 Subject: [PATCH 7/7] update --- charts/opentelemetry-demo/templates/service-monitor.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/charts/opentelemetry-demo/templates/service-monitor.yaml b/charts/opentelemetry-demo/templates/service-monitor.yaml index d31613e..4845e0e 100644 --- a/charts/opentelemetry-demo/templates/service-monitor.yaml +++ b/charts/opentelemetry-demo/templates/service-monitor.yaml @@ -5,14 +5,13 @@ metadata: labels: operator.insight.io/managed-by: insight name: otel-collector-monitor - namespace: webstore-demo spec: endpoints: - honorLabels: true port: prometheus namespaceSelector: matchNames: - - webstore-demo + - {{ .Release.Namespace }} selector: matchLabels: app.kubernetes.io/name: otelcol @@ -23,14 +22,13 @@ metadata: labels: operator.insight.io/managed-by: insight name: adservice-monitor - namespace: webstore-demo spec: endpoints: - honorLabels: true port: http-metrics namespaceSelector: matchNames: - - webstore-demo + - {{ .Release.Namespace }} selector: matchLabels: app.kubernetes.io/component: adservice