Skip to content

Commit

Permalink
prints telemetry json after sending it to the service
Browse files Browse the repository at this point in the history
deserialized base64 parameters
  • Loading branch information
tsebastiani committed Aug 25, 2023
1 parent 06a8ed2 commit 53dcf6e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ prometheus_api_client
ibm_cloud_sdk_core
ibm_vpc
pytest
krkn-lib >= 1.0.0
krkn-lib >= 1.1.1
16 changes: 10 additions & 6 deletions run_kraken.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python

import json
import os
import sys
import yaml
Expand Down Expand Up @@ -387,11 +387,15 @@ def main(cfg):
logging.info(f"telemetry data will be stored on s3 bucket folder: {telemetry_request_id}")
logging.info(f"telemetry upload log: {safe_logger.log_file_name}")
try:
telemetry.send_telemetry(config["telemetry"], telemetry_request_id, chaos_telemetry)
safe_logger.info("archives download started:")
prometheus_archive_files = telemetry.get_ocp_prometheus_data(config["telemetry"], telemetry_request_id)
safe_logger.info("archives upload started:")
telemetry.put_ocp_prometheus_data(config["telemetry"], prometheus_archive_files, telemetry_request_id)
telemetry_json = telemetry.send_telemetry(config["telemetry"], telemetry_request_id, chaos_telemetry)
if telemetry_json:
telemetry_obj = ChaosRunTelemetry(json.loads(telemetry_json))
logging.info(f"Telemetry data:\n{telemetry_obj.to_json()}")
if config["telemetry"]["prometheus_backup"]:
safe_logger.info("archives download started:")
prometheus_archive_files = telemetry.get_ocp_prometheus_data(config["telemetry"], telemetry_request_id)
safe_logger.info("archives upload started:")
telemetry.put_ocp_prometheus_data(config["telemetry"], prometheus_archive_files, telemetry_request_id)
except Exception as e:
logging.error(f"failed to send telemetry data: {str(e)}")
else:
Expand Down

0 comments on commit 53dcf6e

Please sign in to comment.