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 src/automation/src/main/resources/application.yml +10 −5 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ quarkus: group: tfs name: controller/automation registry: labs.etsi.org:5050 tag: 0.2.0 kubernetes: name: automationservice Loading @@ -51,12 +52,16 @@ quarkus: period: 10s ports: http: host-port: 8080 host-port: 9192 container-port: 8080 grpc: host-port: 5050 container-port: 5050 env: vars: context-service-host: "contextservice" device-service-host: "deviceservice" resources: requests: cpu: 50m memory: 512Mi limits: cpu: 500m memory: 2048Mi src/automation/target/kubernetes/kubernetes.yml +30 −36 Original line number Diff line number Diff line Loading @@ -11,26 +11,29 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. --- apiVersion: v1 kind: Service metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 app.quarkus.io/commit-id: 23832f2975e3c8967e9685f7e3a5f5458d04527a app.quarkus.io/build-timestamp: 2023-04-04 - 11:47:48 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" prometheus.io/scheme: http labels: app.kubernetes.io/name: automationservice app: automationservice name: automationservice spec: ports: - name: grpc port: 5050 targetPort: 5050 - name: metrics protocol: TCP - name: http port: 9192 targetPort: 8080 - name: grpc-server port: 5050 targetPort: 5050 selector: app.kubernetes.io/name: automationservice type: ClusterIP Loading @@ -39,7 +42,12 @@ apiVersion: apps/v1 kind: Deployment metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 app.quarkus.io/commit-id: 23832f2975e3c8967e9685f7e3a5f5458d04527a app.quarkus.io/build-timestamp: 2023-04-04 - 11:47:48 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" prometheus.io/scheme: http labels: app: automationservice app.kubernetes.io/name: automationservice Loading @@ -52,7 +60,12 @@ spec: template: metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 app.quarkus.io/commit-id: 23832f2975e3c8967e9685f7e3a5f5458d04527a app.quarkus.io/build-timestamp: 2023-04-04 - 11:47:48 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" prometheus.io/scheme: http labels: app: automationservice app.kubernetes.io/name: automationservice Loading Loading @@ -81,11 +94,11 @@ spec: timeoutSeconds: 10 name: automationservice ports: - containerPort: 5050 name: grpc protocol: TCP - containerPort: 8080 name: metrics name: http protocol: TCP - containerPort: 5050 name: grpc-server protocol: TCP readinessProbe: failureThreshold: 3 Loading @@ -98,28 +111,9 @@ spec: successThreshold: 1 timeoutSeconds: 10 resources: requests: cpu: 50m memory: 512Mi limits: cpu: 500m memory: 2048Mi --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: automationservice-hpa spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: automationservice minReplicas: 1 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 80 requests: cpu: 50m memory: 512Mi src/monitoring/service/MonitoringServiceServicerImpl.py +340 −514 File changed.Preview size limit exceeded, changes collapsed. Show changes 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
src/automation/src/main/resources/application.yml +10 −5 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ quarkus: group: tfs name: controller/automation registry: labs.etsi.org:5050 tag: 0.2.0 kubernetes: name: automationservice Loading @@ -51,12 +52,16 @@ quarkus: period: 10s ports: http: host-port: 8080 host-port: 9192 container-port: 8080 grpc: host-port: 5050 container-port: 5050 env: vars: context-service-host: "contextservice" device-service-host: "deviceservice" resources: requests: cpu: 50m memory: 512Mi limits: cpu: 500m memory: 2048Mi
src/automation/target/kubernetes/kubernetes.yml +30 −36 Original line number Diff line number Diff line Loading @@ -11,26 +11,29 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. --- apiVersion: v1 kind: Service metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 app.quarkus.io/commit-id: 23832f2975e3c8967e9685f7e3a5f5458d04527a app.quarkus.io/build-timestamp: 2023-04-04 - 11:47:48 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" prometheus.io/scheme: http labels: app.kubernetes.io/name: automationservice app: automationservice name: automationservice spec: ports: - name: grpc port: 5050 targetPort: 5050 - name: metrics protocol: TCP - name: http port: 9192 targetPort: 8080 - name: grpc-server port: 5050 targetPort: 5050 selector: app.kubernetes.io/name: automationservice type: ClusterIP Loading @@ -39,7 +42,12 @@ apiVersion: apps/v1 kind: Deployment metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 app.quarkus.io/commit-id: 23832f2975e3c8967e9685f7e3a5f5458d04527a app.quarkus.io/build-timestamp: 2023-04-04 - 11:47:48 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" prometheus.io/scheme: http labels: app: automationservice app.kubernetes.io/name: automationservice Loading @@ -52,7 +60,12 @@ spec: template: metadata: annotations: app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000 app.quarkus.io/commit-id: 23832f2975e3c8967e9685f7e3a5f5458d04527a app.quarkus.io/build-timestamp: 2023-04-04 - 11:47:48 +0000 prometheus.io/scrape: "true" prometheus.io/path: /q/metrics prometheus.io/port: "8080" prometheus.io/scheme: http labels: app: automationservice app.kubernetes.io/name: automationservice Loading Loading @@ -81,11 +94,11 @@ spec: timeoutSeconds: 10 name: automationservice ports: - containerPort: 5050 name: grpc protocol: TCP - containerPort: 8080 name: metrics name: http protocol: TCP - containerPort: 5050 name: grpc-server protocol: TCP readinessProbe: failureThreshold: 3 Loading @@ -98,28 +111,9 @@ spec: successThreshold: 1 timeoutSeconds: 10 resources: requests: cpu: 50m memory: 512Mi limits: cpu: 500m memory: 2048Mi --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: automationservice-hpa spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: automationservice minReplicas: 1 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 80 requests: cpu: 50m memory: 512Mi
src/monitoring/service/MonitoringServiceServicerImpl.py +340 −514 File changed.Preview size limit exceeded, changes collapsed. Show changes