diff --git a/execution/lag_analysis.py b/execution/lag_analysis.py index c05c0501b6dd922b4029425eae56a7e3f2b55bb8..59475620bafb2ae34df79760c75f64e20c001b86 100644 --- a/execution/lag_analysis.py +++ b/execution/lag_analysis.py @@ -26,13 +26,12 @@ start = now - timedelta(minutes=5) #print(start.isoformat().replace('+00:00', 'Z')) #print(end.isoformat().replace('+00:00', 'Z')) -#http://localhost:9090 response = requests.get('http://kube1.se.internal:32529/api/v1/query_range', params={ - 'query': "sum by(job,topic)(kafka_consumer_consumer_fetch_manager_metrics_records_lag)", + #'query': "sum by(job,topic)(kafka_consumer_consumer_fetch_manager_metrics_records_lag)", + 'query': "sum by(group, topic)(kafka_consumergroup_group_lag)", 'start': start.isoformat(), 'end': end.isoformat(), 'step': '5s'}) -# TODO Check if start=now()-5m and end=now() also works #response #print(response.request.path_url) diff --git a/execution/run_uc1-new.sh b/execution/run_uc1-new.sh index 1e41219bc4efff2dfbe27d81c16035519e2dd776..1029dee493694de4d9755b859270706f4219820a 100755 --- a/execution/run_uc1-new.sh +++ b/execution/run_uc1-new.sh @@ -61,3 +61,6 @@ done echo "Finish topic deletion, print topics:" #kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -r '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p' echo "Exiting script" + +KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}") +kubectl delete pod $KAFKA_LAG_EXPORTER_POD diff --git a/execution/run_uc2-new.sh b/execution/run_uc2-new.sh index d06002846461aa0006afdeb7d17b8073d6dc7176..8383e602e780eb64355d9f7a8c88e6817adefa27 100755 --- a/execution/run_uc2-new.sh +++ b/execution/run_uc2-new.sh @@ -58,3 +58,6 @@ done echo "Finish topic deletion, print topics:" #kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -r '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p' echo "Exiting script" + +KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}") +kubectl delete pod $KAFKA_LAG_EXPORTER_POD diff --git a/execution/run_uc3-new.sh b/execution/run_uc3-new.sh index d0ec923a1454456812f1b085d5fa3e07d647e74d..24353fdf24e75f73840503a78f82cd085ba93efd 100755 --- a/execution/run_uc3-new.sh +++ b/execution/run_uc3-new.sh @@ -59,3 +59,5 @@ echo "Finish topic deletion, print topics:" #kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -r '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p' echo "Exiting script" +KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}") +kubectl delete pod $KAFKA_LAG_EXPORTER_POD diff --git a/execution/run_uc4-new.sh b/execution/run_uc4-new.sh index b40d2a423626659c2bd3a7e0d48f557affef283a..c3774bb9e16b104b27b40a59b322af17b04c69f0 100755 --- a/execution/run_uc4-new.sh +++ b/execution/run_uc4-new.sh @@ -63,3 +63,6 @@ echo "Exiting script" #TODO maybe delete schemas #https://docs.confluent.io/current/schema-registry/schema-deletion-guidelines.html #curl -X DELETE http://localhost:8081/subjects/Kafka-value + +KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}") +kubectl delete pod $KAFKA_LAG_EXPORTER_POD