Module Tezt_cloud.Cloud

type t
val register : ?proxy_files:string list -> ?proxy_args:string list -> ?vms:Agent.Configuration.t list Lwt.t -> __FILE__:string -> title:string -> tags:string list -> ?seed:Tezt.Test.seed -> ?alerts:Alert.t list -> ?tasks:Chronos.task list -> (t -> unit Lwt.t) -> unit

A wrapper around Test.register that can be used to register new tests using VMs provided as a map indexed by name. Each VM is abstracted via the Agent module.

proxy_files should contains file that are needed by the scenario to run (only used for proxy mode).

proxy_args should contains CLI arguments necessary for the proxy mode. This can be used for example when an argument is provided via an environment variable instead of a command-line argument.

tasks represent Chronos tasks that will be registered in a Chronos.t process. If tasks is empty, no Chronos process will be started.

val push_metric : t -> ?help:string -> ?typ:[ `Counter | `Gauge ] -> ?labels:(string * string) list -> name:string -> float -> unit

push_metric t ?help ?typ ?labels ~name v pushes the value v for metric on Prometheus. labels can be used to categorise the metric (each set of label define a single curve). typ can be used to provide the type of the metric. help can be used to provide some naive documentation about the metrics.

val agents : t -> Agent.t list

agents t returns the list of agents deployed.

type target = {
  1. agent : Agent.t;
  2. port : int;
  3. app_name : string;
}
val add_prometheus_source : t -> ?metrics_path:string -> name:string -> target list -> unit Lwt.t

add_prometheus_source t ?metrics_path ~name targets allows to add a new source of metrics that Prometheus can scrap. By default metric_path is /metrics. job_name is just the name to give for the job that will scrap the metrics. It must be unique. A target enables to define a list of points to scrap. Each point can have a name defined by app_name.

val add_service : t -> name:string -> url:string -> unit Lwt.t
val open_telemetry_endpoint : t -> string option
val add_alert : t -> alert:Alert.t -> unit Lwt.t
val register_binary : t -> ?agents:Agent.t list -> ?group:string -> name:string -> unit -> unit Lwt.t

register_binary t ?agents ?group name register a binary for individual process monitoring via prometheus process exporter. group will allow to put process in process groups, is currently not used. defaults to "tezt-cloud" if not specified name is the filename of the executable to monitor. agents when specified, is the list of agents on which to enable monitoring when not specified, all container agents will run a prometheus process exporter

val service_register : name:string -> executable:string -> ?on_alive_callback:(alive:bool -> unit) -> Agent.t -> unit

service_register: name executable on_alive_callback agent register a service, ie, a long running background process, that we want to monitor for launch and crash. name is a unique name to identify the service. on_alive_callback is a callback whose argument is a boolean which represent the service started if true, or the service was shutdown if false. This callback is called regularly, and expects to be update some metrics. TODO: change arguments executable and pid to a abstraction for tezt Daemon.t and merge register_binary functionality into register_service

val notify_service_start : name:string -> pid:int -> unit

notify_service_start: name notify the start of a service

val notify_service_stop : name:string -> unit

notify_service_stop: name notify the normal termination of a service

val register_chronos_task : t -> Chronos.task -> unit

Register a chronos task

val notifier : t -> Types.notifier

Returns the Types.notifier