Skip to content

Commit 2b93e6f

Browse files
committed
service is labeled and service monitor for application metrics is added
1 parent 8a20f5b commit 2b93e6f

File tree

2 files changed

+68
-11
lines changed

2 files changed

+68
-11
lines changed

templates/telemetry.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,43 @@ apiVersion: v1
111111
kind: Service
112112
metadata:
113113
name: {{ .Values.telemetry.host }}
114+
labels:
115+
app: telemetry
116+
app.kubernetes.io/name: telemetry
114117
spec:
115118
selector:
116119
app: telemetry
117120
type: NodePort
118121
ports:
119-
- protocol: TCP
122+
- name: http
123+
protocol: TCP
120124
{{- if .Values.deployment.telemetry.nodeport }}
121125
nodePort: {{ .Values.deployment.telemetry.nodeport }}
122126
{{- end }}
123127
targetPort: {{ .Values.telemetry.port }}
124128
port: {{ .Values.telemetry.port }}
129+
---
125130

131+
apiVersion: monitoring.coreos.com/v1
132+
kind: ServiceMonitor
133+
metadata:
134+
name: telemetry
135+
spec:
136+
selector:
137+
matchLabels:
138+
app: telemetry
139+
namespaceSelector:
140+
matchNames:
141+
- {{ .Release.Namespace }}
142+
endpoints:
143+
- port: http
144+
scheme: http
145+
path: /telemetry/v1/application-metrics
146+
interval: "30s"
147+
scrapeTimeout: "20s"
148+
honorLabels: true
149+
relabelings:
150+
- action: replace
151+
targetLabel: job
152+
replacement: "telemetry-app"
126153
{{- end }}

values.yaml

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -380,23 +380,53 @@ telemetry:
380380
host: telemetry
381381
port: 32012
382382
bind_to: 0.0.0.0
383-
obfuscate_apikeys: True # obfuscate api keys in the endpoints
383+
obfuscate_apikeys: true # obfuscate api keys in the endpoints
384384
usage:
385-
enabled: True
386-
cache_expiry_seconds: 30 # set a value similar to prometheus scrape interval, default is 30 seconds
387-
timeframes: # in s/h/d format, it controls the timeframes for which the usage is calculated in /usage endpoint
385+
enabled: true
386+
timeframes:
388387
- 12h
389388
- 1d
390389
- 3d
391390
- 7d
392391
- 30d
392+
- 365d
393393
basic_auth:
394-
enabled: false
395-
log_suppression_ttl: 3600 # in seconds
396-
users:
397-
- attributes: {}
398-
password: # deployment specific
399-
uid: # deployment specific
394+
enabled: true
395+
log_suppression_ttl: 3600
396+
397+
metrics:
398+
prefix: polytope
399+
product_labels:
400+
- class
401+
- type
402+
canonical_label_order:
403+
- status
404+
- collection
405+
- realm
406+
- class
407+
- type
408+
request_duration_buckets:
409+
- 0.5
410+
- 1
411+
- 2
412+
- 5
413+
- 10
414+
- 20
415+
- 30
416+
- 60
417+
- 120
418+
- 300
419+
processing_duration_buckets:
420+
- 0.5
421+
- 1
422+
- 2
423+
- 5
424+
- 10
425+
- 20
426+
- 30
427+
- 60
428+
- 120
429+
- 300
400430

401431

402432
metric_store:

0 commit comments

Comments
 (0)