Commit 53da4ec3 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Compute Component:

- Added metrics port
- Added service monitor
parent 23832f29
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ spec:
        ports:
        - containerPort: 8080
        - containerPort: 9090
        - containerPort: 9192
        env:
        - name: LOG_LEVEL
          value: "INFO"
@@ -70,3 +71,7 @@ spec:
    protocol: TCP
    port: 9090
    targetPort: 9090
  - name: metrics
    protocol: TCP
    port: 9192
    targetPort: 9192
+29 −0
Original line number Diff line number Diff line
@@ -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