Skip to main content

Datadog probe

Datadog probe allows you to query a Datadog Synthetic test and utilize its results through the fault's chaos duration to evaluate the probe outcome.

  • Both API tests and Browser tests are supported.

  • The probe may only be executed in the EOT mode, as the probe evaluation is based on the result of all the test iterations executed through the fault chaos duration.

note

If there are no iterations of the synthetics test through the chaos duration of the fault, the probe is marked as failed.

Providing secrets

Datadog secret keys need to be provided prior to using the probe, which are used to authenticate with the Datadog APIs. This includes an API key and an Application key.

For a Kubernetes chaos infrastructure, the secrets shall be provided using a Kubernetes secret of the following format:
apiVersion: v1
kind: Secret
metadata:
name: datadog-secret
type: Opaque
stringData:
DD_API_KEY: "xxxxxxxxxxxxxxxxxxxx"
DD_APP_KEY: "xxxxxxxxxxxxxxxxxxxx"

The secret name, that is, datadog-secret has to be provided while configuring the probe using the datadogCredentialsSecretName field.

Defining the probe

For a Kubernetes chaos infrastructure, the probe is defined at .spec.experiments[].spec.probe path in the chaos engine manifest:
kind: Workflow
apiVersion: argoproj.io/v1alpha1
spec:
templates:
- inputs:
artifacts:
- raw:
data: |
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
spec:
experiments:
- spec:
probe:
####################################
Probes are defined here
####################################

Schema

Listed below is the Datadog Probe schema with common properties shared across all probes and properties unique to Datadog probe.

FieldDescriptionTypeRangeNotes
nameFlag to hold the name of the probeMandatoryN/A type: stringThe name holds the name of the probe. It can be set based on the use-case
typeFlag to hold the type of the probeMandatoryhttpProbe, k8sProbe, cmdProbe, promProbe, and datadogProbeThe type supports four types of probes. It can one of the httpProbe, k8sProbe, cmdProbe, promProbe, and datadogProbe
modeFlag to hold the mode of the probeMandatorySOT, EOT, Edge, Continuous, OnChaosThe mode supports five modes of probes. It can one of the SOT, EOT, Edge, Continuous, and OnChaos. For Datadog probe only EOT mode is supported
datadogSiteSite for datadog probeMandatorydatadoghq.com, us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ddog-gov.com, and ap1.datadoghq.comThe datadogSite supports six values. Refer here for details
datadogCredentialsSecretNameName of the secret having datadog probe secret keysOptionalN/A type: stringName of the Kubernetes secret containing the Datadog secret keys. Only required for Kubernetes chaos infrastructure

Synthetics test

FieldDescriptionTypeRangeNotes
publicIdPublic ID of the synthetic testMandatoryN/A type: stringThe publicId holds the ID of the synthetic test.
testTypeType of the synthetic testMandatoryapi, browserThe testType holds the type of the synthetic test. It can one of api and browser

Run properties

FieldDescriptionTypeRangeNotes
probeTimeoutFlag to hold the timeout of the probeMandatoryN/A type: stringThe probeTimeout represents the time limit for the probe to execute the specified check and return the expected data
attemptFlag to hold the attempt of the probeMandatoryN/A type: integerThe attempt contains the number of times a check is run upon failure in the previous attempts before declaring the probe status as failed.
intervalFlag to hold the interval of the probeMandatoryN/A type: stringThe interval contains the interval for which probes waits between subsequent retries
probePollingIntervalFlag to hold the polling interval for the probes (applicable for all modes)OptionalN/A type: stringThe probePollingInterval contains the time interval for which continuous and onchaos probe should be sleep after each iteration
initialDelaySecondsFlag to hold the initial delay interval for the probesOptionalN/A type: integerThe initialDelaySeconds represents the initial waiting time interval for the probes.
stopOnFailureFlags to hold the stop or continue the experiment on probe failureOptionalN/A type: booleanThe stopOnFailure can be set to true/false to stop or continue the experiment execution after probe fails

Definition

probe:
- name: datadog-probe
type: "DatadogProbe"
mode: "EOT"
datadogProbe/inputs:
datadogSite: us5.datadoghq.com
syntheticsTest:
publicId: zgs-mq8-pgy
testType: api
datadogCredentialsSecretName: dd-secret
runProperties:
probeTimeout: 2s
attempt: 1
interval: 3s
stopOnFailure: false

API test

To trigger an API test, specify the syntheticsTest.testType as api.

Use the following example to tune this:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: litmus-admin
experiments:
- name: pod-delete
spec:
probe:
- name: "datadog-probe"
type: "datadogProbe"
datadogProbe/inputs:
datadogSite: us5.datadoghq.com
syntheticsTest:
publicId: zgs-mq8-pgy
testType: api
datadogCredentialsSecretName: dd-secret
mode: "EOT"
runProperties:
probeTimeout: 5s
interval: 2s
attempt: 1
stopOnFailure: false

Browser test

To trigger a browser test, specify the syntheticsTest.testType as browser.

Use the following example to tune this:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: litmus-admin
experiments:
- name: pod-delete
spec:
probe:
- name: "datadog-probe"
type: "datadogProbe"
datadogProbe/inputs:
datadogSite: us5.datadoghq.com
syntheticsTest:
publicId: zgs-mq8-pgy
testType: browser
datadogCredentialsSecretName: dd-secret
mode: "EOT"
runProperties:
probeTimeout: 5s
interval: 2s
attempt: 1
stopOnFailure: false