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/monitoring/service/MonitoringServiceServicerImpl.py +340 −514 File changed.Preview size limit exceeded, changes collapsed. Show changes src/monitoring/tests/test_unitary.py +0 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ from grpc._channel import _MultiThreadedRendezvous from common.Constants import ServiceNameEnum from common.Settings import ( ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) #from common.logger import getJSONLogger from common.proto.context_pb2 import DeviceOperationalStatusEnum, EventTypeEnum, DeviceEvent, Device, Empty from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server from common.proto.kpi_sample_types_pb2 import KpiSampleType Loading 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/monitoring/service/MonitoringServiceServicerImpl.py +340 −514 File changed.Preview size limit exceeded, changes collapsed. Show changes
src/monitoring/tests/test_unitary.py +0 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ from grpc._channel import _MultiThreadedRendezvous from common.Constants import ServiceNameEnum from common.Settings import ( ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) #from common.logger import getJSONLogger from common.proto.context_pb2 import DeviceOperationalStatusEnum, EventTypeEnum, DeviceEvent, Device, Empty from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server from common.proto.kpi_sample_types_pb2 import KpiSampleType Loading