Skip to content

Commit

Permalink
fix otel fail to start when otel_resource_attrubute contain empty val…
Browse files Browse the repository at this point in the history
…ue (#121)

* fix otel fail to start when otel_resource_attrubute contain empty value

* fix ci
  • Loading branch information
Frapschen authored May 23, 2023
1 parent 87f34ba commit 72eded8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
1 change: 0 additions & 1 deletion .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ runs:
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add redis https://ot-container-kit.github.io/helm-charts
helm dep up charts/openinsight
helm dep up charts/opentelemetry-demo
helm dep up charts/opentelemetry-demo-lite
2 changes: 1 addition & 1 deletion charts/opentelemetry-demo-lite/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: opentelemetry-demo-lite
type: application
version: 1.1.0
version: 1.1.1
icon: https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png
description: A helm chart for openTelemetry community demo application integration with other component(lite version).
sources:
Expand Down
8 changes: 7 additions & 1 deletion charts/opentelemetry-demo-lite/templates/adservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,18 @@ spec:
{{- with .Values.extensions.adservice.env }}
{{- . | toYaml | nindent 12 }}
{{- end }}
- name: NACOS_NAMESPACE_ID
value: {{ .Values.global.microservices.nacos.registryNamespace }}
- name: NACOS_GROUP_NAME
value: {{ .Values.global.microservices.nacos.registryServiceGroup }}
- name: SKOALA_REGISTRY
value: {{ .Values.global.microservices.nacos.registryName }}
- name: JAVA_OPTS
value: '{{ include "java.adservice.opt" . }}'
- name: DATA_SERVICE_ADDR
value: '{{ include "otel-demo.name" . }}-dataservice:8080'
- name: OTEL_RESOURCE_ATTRIBUTES
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={{ .Values.global.microservices.nacos.registryName }},nacos.namespaceid={{ .Values.global.microservices.nacos.registryNamespace }},nacos.groupname={{ .Values.global.microservices.nacos.registryServiceGroup }}
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){{- if .Values.global.microservices.nacos.enabled }},skoala.registry=$(SKOALA_REGISTRY),nacos.namespaceid=$(NACOS_NAMESPACE_ID),nacos.groupname=$(NACOS_GROUP_NAME){{ end }}
resources:
requests:
cpu: "0.2"
Expand Down
8 changes: 4 additions & 4 deletions charts/opentelemetry-demo-lite/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@
"registryName": {
"type": "string",
"title": "Registry name",
"default": ""
"default": "nacos"
},
"registryAddr": {
"type": "string",
"title": "Registry address",
"default": ""
"title": "Registry endpoint",
"default": "nacos:8848"
},
"registryNamespace": {
"type": "string",
"title": "Registry mamespace",
"title": "Registry namespace",
"default": "public"
},
"registryServiceGroup": {
Expand Down
16 changes: 5 additions & 11 deletions charts/opentelemetry-demo-lite/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ global:
microservices:
nacos:
enabled: false
registryName: $(SKOALA_REGISTRY)
registryAddr: ""
registryNamespace: $(NACOS_NAMESPACE_ID)
registryServiceGroup: $(NACOS_GROUP_NAME)
registryInstanceGroup: DEFAULT
registryName: "nacos"
registryAddr: "nacos:8848"
registryNamespace: "public"
registryServiceGroup: "DEFAULT_GROUP"
registryInstanceGroup: "DEFAULT"
kubeMetadataClusterName: ""
username: ""
password: ""
Expand Down Expand Up @@ -178,12 +178,6 @@ extensions:
fieldPath: metadata.uid
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: 'http://insight-agent-opentelemetry-collector.insight-system.svc.cluster.local:4317'
- name: NACOS_NAMESPACE_ID
value: public
- name: NACOS_GROUP_NAME
value: DEFAULT_GROUP
- name: SKOALA_REGISTRY
value: nacos-test
- name: AD_SERVICE_PORT
value: "8080"
podAnnotations:
Expand Down

0 comments on commit 72eded8

Please sign in to comment.