probePrometheus

query

Run an instant query against a Prometheus server and returns its result as-is

Activity as code

Below are the details and signature of the activity Python module.

Typeprobe
Modulechaosprometheus.probes
Namequery
Returnmapping

Usage

JSON

{
  "name": "query",
  "type": "probe",
  "provider": {
    "type": "python",
    "module": "chaosprometheus.probes",
    "func": "query",
    "arguments": {
      "query": ""
    }
  }
}

YAML

name: query
provider:
  arguments:
    query: ""
  func: query
  module: chaosprometheus.probes
  type: python
type: probe

Arguments

NameTypeDefaultRequiredTitleDescription
querystringYesQueryInstant query to run
whenstringnullNoPeriod StartWhen to start the query from. Passed as RFC 3339 or relative such as “5 minutes ago”
timeoutnumbernullNoTimeoutHow long to wait to fetch the results for the query

Signature

def query(query: str,
          when: str = None,
          timeout: float = None,
          configuration: Dict[str, Dict[str, str]] = None,
          secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass