Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions charts/temporal/templates/server-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,11 @@ data:
metrics:
tags:
type: {{ `{{ env "TEMPORAL_SERVICES" | quote }}` }}
{{- with $server.metrics.tags }}
{{- with $server.config.metrics.tags }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with $server.metrics.excludeTags }}
excludeTags:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with $server.metrics.prefix }}
prefix: "{{- . }}"
{{- end }}
{{- with $server.config.prometheus }}
prometheus:
{{- toYaml . | nindent 10 }}
{{- else }}
prometheus:
timerType: histogram
listenAddress: "0.0.0.0:9090"
{{- with (omit $server.config.metrics "tags") }}
{{- toYaml . | nindent 8 }}
{{- end }}

{{- with $server.config.tls }}
Expand Down
42 changes: 42 additions & 0 deletions charts/temporal/tests/server_configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,45 @@ tests:
- matchRegex:
path: data['config_template.yaml']
pattern: 'password: \{\{ env "TEMPORAL_VISIBILITY_STORE_PASSWORD" \| quote \}\}'

- it: handles metrics config
set:
server:
config:
persistence:
defaultStore: default
visibilityStore: visibility
datastores:
default:
sql:
password: "secret"
visibility:
sql:
password: "secret"
metrics:
prefix: "temporal_"
tags:
env: production
excludeTags:
ignored: ["tag1", "tag2"]
withoutUnitSuffix: false
template: templates/server-configmap.yaml
documentSelector:
path: metadata.name
value: RELEASE-NAME-temporal-config
asserts:
- matchRegex:
path: data['config_template.yaml']
pattern: 'prefix: temporal_'
- matchRegex:
path: data['config_template.yaml']
pattern: "excludeTags:\\s+ignored:"
- matchRegex:
path: data['config_template.yaml']
pattern: "env: production"
- matchRegex:
path: data['config_template.yaml']
pattern: "withoutUnitSuffix: false"
- matchRegex:
path: data['config_template.yaml']
pattern: "prometheus:\\s+listenAddress: 0.0.0.0:9090"
17 changes: 10 additions & 7 deletions charts/temporal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ server:
# prometheus.io/scrape
annotations:
enabled: true
# Additional tags to be added to Prometheus metrics
tags: {}
# Tags to be excluded in Prometheus metrics
excludeTags: {}
prefix:
# Enable Prometheus ServiceMonitor
# Use this if you installed the Prometheus Operator (https://github.com/coreos/prometheus-operator).
serviceMonitor:
Expand Down Expand Up @@ -66,8 +61,6 @@ server:
# sourceLabels:
# - __name__
# targetLabel: __name__
prometheus:
timerType: histogram
deploymentLabels: {}
deploymentAnnotations: {}
deploymentStrategy: {}
Expand Down Expand Up @@ -221,6 +214,16 @@ server:
# sql:
# pluginName: postgres12
# ...
metrics:
# Additional tags to be added to Prometheus metrics
tags: {}
# ... All other fields from https://github.com/temporalio/temporal/blob/main/common/metrics/config.go
# excludeTags: {}
# prefix: ""
# etc.
prometheus:
timerType: histogram
listenAddress: "0.0.0.0:9090"
namespaces:
# Enable this to create namespaces
create: false
Expand Down