Loading manifests/computeservice.yaml +5 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ spec: ports: - containerPort: 8080 - containerPort: 9090 - containerPort: 9192 env: - name: LOG_LEVEL value: "INFO" Loading Loading @@ -70,3 +71,7 @@ spec: protocol: TCP port: 9090 targetPort: 9090 - name: metrics protocol: TCP port: 9192 targetPort: 9192 manifests/servicemonitors.yaml +29 −0 Original line number Diff line number Diff line Loading @@ -301,3 +301,32 @@ spec: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-computeservice-metric labels: app: computeservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: computeservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 5s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running Loading
manifests/computeservice.yaml +5 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ spec: ports: - containerPort: 8080 - containerPort: 9090 - containerPort: 9192 env: - name: LOG_LEVEL value: "INFO" Loading Loading @@ -70,3 +71,7 @@ spec: protocol: TCP port: 9090 targetPort: 9090 - name: metrics protocol: TCP port: 9192 targetPort: 9192
manifests/servicemonitors.yaml +29 −0 Original line number Diff line number Diff line Loading @@ -301,3 +301,32 @@ spec: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-computeservice-metric labels: app: computeservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: computeservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 5s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running