Skip to content

Commit 1a05a9e

Browse files
committed
feat: collecting metrics from controller
1 parent bbd1835 commit 1a05a9e

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

charts/tensor-fusion/templates/controller-deployment.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ spec:
3131
containers:
3232
- name: controller
3333
image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag | default .Chart.AppVersion }}"
34+
command:
35+
- /manager
36+
- -metrics-bind-address
37+
- :9000
3438
livenessProbe:
3539
{{- toYaml .Values.controller.livenessProbe | nindent 12 }}
3640
readinessProbe:
@@ -43,6 +47,23 @@ spec:
4347
mountPath: /tmp/k8s-webhook-server/serving-certs
4448
- name: config
4549
mountPath: /etc/tensor-fusion
50+
- name: vector
51+
image: docker.io/timberio/vector:nightly-2025-01-07-debian
52+
env:
53+
- name: NODE_NAME
54+
valueFrom:
55+
fieldRef:
56+
apiVersion: v1
57+
fieldPath: spec.nodeName
58+
resources:
59+
requests:
60+
cpu: 50m
61+
memory: 64Mi
62+
volumeMounts:
63+
- name: logs
64+
mountPath: /logs
65+
- name: vector-config
66+
mountPath: /etc/vector
4667
volumes:
4768
- name: cert
4869
secret:
@@ -57,6 +78,12 @@ spec:
5778
configMap:
5879
name: {{ include "tensor-fusion.fullname" . }}-config
5980
defaultMode: 420
81+
- name: vector-config
82+
configMap:
83+
name: {{ include "tensor-fusion.fullname" . }}-vector-config
84+
defaultMode: 420
85+
- name: logs
86+
emptyDir: {}
6087
{{- with .Values.controller.affinity }}
6188
affinity:
6289
{{- toYaml . | nindent 8 }}

charts/tensor-fusion/templates/hypervisor-daemonset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ spec:
5454
- name: vector
5555
image: docker.io/timberio/vector:nightly-2025-01-07-debian
5656
env:
57-
- name: NODE_IP
57+
- name: NODE_NAME
5858
valueFrom:
5959
fieldRef:
6060
apiVersion: v1
61-
fieldPath: status.hostIP
61+
fieldPath: spec.nodeName
6262
resources:
6363
requests:
6464
cpu: 50m

charts/tensor-fusion/templates/hypervisor-vector.yaml renamed to charts/tensor-fusion/templates/vector.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ data:
1111
data_dir: /logs
1212
include:
1313
- /logs/metrics.log
14-
in:
15-
type: host_metrics
14+
15+
controller_metrics:
16+
type: prometheus_scrape
17+
endpoints:
18+
- http://localhost:9000/metrics
1619
1720
transforms:
1821
parse_influx:
@@ -28,7 +31,7 @@ data:
2831
- parse_influx
2932
source: |
3033
.namespace = "tf"
31-
.tags.nodeip = "${NODE_IP}"
34+
.tags.nodeName = "${NODE_NAME}"
3235
3336
log_to_metric:
3437
type: log_to_metric
@@ -37,10 +40,15 @@ data:
3740
all_metrics: true
3841
metrics: []
3942
sinks:
40-
41-
sink_greptimedb_metrics:
43+
sink_greptimedb_hypervisor_metrics:
4244
type: greptimedb_metrics
4345
inputs:
4446
- log_to_metric
4547
new_naming: false
4648
endpoint: {{ .Values.hypervisor.greptimedbEendpoint }}
49+
50+
sink_greptimedb_controller_metrics:
51+
type: prometheus_remote_write
52+
inputs:
53+
- controller_metrics
54+
endpoint: http://{{ .Values.hypervisor.greptimedbEendpoint }}/v1/prometheus/write?db=public

0 commit comments

Comments
 (0)