telemetry.ocp.krkn_telemetry_openshift module
- class telemetry.ocp.krkn_telemetry_openshift.KrknTelemetryOpenshift(safe_logger: SafeLogger, lib_openshift: KrknOpenshift, telemetry_request_id: str = '', krkn_telemetry_config: dict[str, any] | None = None)
Bases:
KrknTelemetryKubernetes
- __init__(safe_logger: SafeLogger, lib_openshift: KrknOpenshift, telemetry_request_id: str = '', krkn_telemetry_config: dict[str, any] | None = None)
- collect_cluster_metadata(chaos_telemetry: ChaosRunTelemetry)
Collects useful cluster metadata: - cloud infrastructure - network plugins - number of objects deployed - node system infos to enrich the ChaosRunTelemetry object that will be sent to the telemetry service:
- Parameters:
chaos_telemetry – the chaos telemetry to be enriched by the cluster metadata
- get_lib_ocp() KrknOpenshift
Returns the instance of KrknOpenshift
- Returns:
a KrknOpenshift instance
- get_ocp_prometheus_data(telemetry_config: dict, request_id: str) list[int, str]
Downloads the Openshift prometheus metrics
- Parameters:
telemetry_config – krkn telemetry conf section will be stored
request_id – uuid of the session that will represent the temporary archive files
- Returns:
the list of the archive number and filenames downloaded
- get_vm_number() int
- put_ocp_logs(request_id: str, telemetry_config: dict, start_timestamp: int, end_timestamp: int, namespace: str | None = None)
Collects, filters, archive and put on the telemetry S3 Buckets Openshift logs. Built on top of the oc adm must-gather command and custom filtering.
- Parameters:
request_id – uuid of the session that will represent the S3 folder on which the filtered log files archive will be stored
telemetry_config – telemetry section of kraken config.yaml
start_timestamp – timestamp of the first relevant entry, if None will start filter starting from the earliest
end_timestamp – timestamp of the last relevant entry, if None will end filtering until the latest
namespace – if set the logs will be collected only for the provided namespace