Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions canary-checker/docs/comparisons/blackbox-exporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ sidebar_custom_props:
icon: prometheus
---

# Canary-Checker vs Prometheus blackbox exporter
# Canary Checker vs Prometheus Blackbox Exporter

[Prometheus Blackbox Exporter](https://github.com/prometheus/blackbox_exporter) is a prometheus exporter for probing HTTP, HTTPS, DNS, TCP, ICMP, and gRPC.
[Prometheus Blackbox Exporter](https://github.com/prometheus/blackbox_exporter) is a Prometheus exporter for probing HTTP, HTTPS, DNS, TCP, ICMP, and gRPC.

| | Blackbox Exporter | Canary Checker |
| ------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| Prometheus Exporter | Yes | Yes |
| Internal DB | No | Runs with an embedded postgres database, making it possible to monitor prometheus itself |
| Check types | HTTP, ICMP, DNS, TCP, gRPC | 30+ |
| Custom Metrics | No | Create custom metrics from HTTP / SQL / Elasticsearch / etc queries |
| Exports | Metrics and labels only | Metrics, labels and error messages |
| Run in CI/CD | No | Run as a CLI for rapid feedback loops and export JUnit results in CI pipelines |
| Cron | No | Stop running checks when environments are shut down, or after hours |
| Scripting | No | Evaluate the health of a response using CEL, Javascript, Go Templates |
| **Kubernetes** | | |
| CRDs | Via [Probe](https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.Probe) | Yes |
| Conditions | No | Status conditions enable canaries to be used as health checks in Helm, Flux, and Argo |
| Events | No | Kubernetes events are fired on failure |
| Secrets | Via [Probe](https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.Probe) | |
| **Check Types** | | |
| Synthetic | No | Builtin check types for any test exporting JUnit test results e.g. (k6, playwright, robot, postman, etc) |
| Infrastructure | No | Verify the ability to launch new pods, create new EC2 instances or push and pull from docker / helm / git repositories |
| Backup | No | Check backups via Restic, S3, SMB, SFTP, GCS |
| Compliance | No | AWS Config Rules, Flanksource Config DB |
| Alert Aggregation | No | Alert Manager, AWS Cloudwatch, Dynatrace |
| | Blackbox Exporter | Canary Checker |
| ------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Prometheus Exporter | Yes | Yes |
| Internal DB | No | Runs with an embedded Postgres database, making it possible to monitor Prometheus itself |
| Check types | HTTP, ICMP, DNS, TCP, gRPC | 30+ |
| Custom Metrics | No | Create custom metrics from HTTP, SQL, Elasticsearch, and other query results |
| Exports | Metrics and labels only | Metrics, labels and error messages |
| Run in CI/CD | No | Run as a CLI for rapid feedback loops and export JUnit results in CI pipelines |
| Cron | No | Stop running checks when environments are shut down, or after hours |
| Scripting | No | Evaluate the health of a response using CEL, JavaScript, and Go templates |
| **Kubernetes** | | |
| CRDs | Via [Probe](https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.Probe) | Yes |
| Conditions | No | Status conditions enable canaries to be used as health checks in Helm, Flux, and Argo |
| Events | No | Kubernetes events are fired on failure |
| Secrets | Via [Probe](https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.Probe) | |
| **Check Types** | | |
| Synthetic | No | Built-in check types for tests that export JUnit test results, such as k6, Playwright, Robot Framework, and Postman |
| Infrastructure | No | Verify Kubernetes resources, object storage, databases, and cloud APIs |
| Backup | No | Check backups via Restic, S3, SMB, SFTP, GCS |
| Compliance | No | AWS Config Rules, Flanksource Config DB |
| Alert Aggregation | No | Alertmanager, AWS CloudWatch, and Dynatrace |
60 changes: 6 additions & 54 deletions canary-checker/docs/concepts/_connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,8 @@ Whenever a field uses the `EnvVar` object type you have the option of specifying

Using a HTTP health check as an example for static values:

```yaml title="http-basic-auth-static.yaml"
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: http-basic-auth
spec:
http:
- endpoint: https://httpbin.org/basic-auth/hello/world
responseCodes: [200]
authentication:
username:
value: hello
password:
value: world
```yaml title="http-basic-auth-static.yaml" file=<rootDir>/modules/canary-checker/fixtures/minimal/http_auth_static_pass.yaml

```

### Kubernetes Configmaps
Expand All @@ -38,26 +26,8 @@ Create a configmap:
kubectl create configmap basic-auth --from-literal=user=hello --from-literal=pass=world -n default
```

```yaml title="http-basic-auth-configmap.yaml"
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: http-basic-auth-configmap
spec:
http:
- endpoint: https://httpbin.org/basic-auth/hello/world
responseCodes: [200]
authentication:
username:
valueFrom:
configMapKeyRef:
name: basic-auth
key: user
password:
valueFrom:
configMapKeyRef:
name: basic-auth
key: pass
```yaml title="http-basic-auth-configmap.yaml" file=<rootDir>/modules/canary-checker/fixtures/minimal/http_auth_from_config_map.yaml

```

### Kubernetes Secrets
Expand All @@ -68,24 +38,6 @@ Create secret:
kubectl create secret generic basic-auth --from-literal=user=hello --from-literal=pass=world -n default
```

```yaml title="http-basic-auth-secret.yaml"
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: http-basic-auth-configmap
spec:
http:
- endpoint: https://httpbin.org/basic-auth/hello/world
responseCodes: [200]
authentication:
username:
valueFrom:
secretKeyRef:
name: basic-auth
key: user
password:
valueFrom:
secretKeyRef:
name: basic-auth
key: pass
```yaml title="http-basic-auth-secret.yaml" file=<rootDir>/modules/canary-checker/fixtures/minimal/http_auth_from_secret.yaml

```
14 changes: 7 additions & 7 deletions canary-checker/docs/concepts/expressions/health-evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
title: Health Evaluation
---

All checks expose a health stats of passing (Green) or failing (Red).
For example the HTTP check fails if the status is `200 >= code < 299`
these default behaviors can be changed using the `test` field:
All checks expose a health status of passing or failing.
HTTP checks pass for `200 <= code < 300` by default, and fail otherwise.
You can change default behavior using the `test` field:

In the example below the http check fails if the HTTP response header contains an 'Authorization' field.
In the following example, the HTTP check fails if the HTTP response header contains an `Authorization` field.

```yaml title=http-check-expr.yaml file=<rootDir>/modules/canary-checker/fixtures/minimal/http_no_auth_pass.yaml

Expand All @@ -16,10 +16,10 @@ In the example below the http check fails if the HTTP response header contains a
`test` expressions must return a bool or boolean type string (`'true'` or `'false`')
:::

See <CommonLink to="cel">Cel Expressions</CommonLink> for a function reference
See <CommonLink to="cel">CEL expressions</CommonLink> for a function reference.

:::note Javascript and Go Templating
While `test` fields do support Javascript and Go Templates, they are not recommended for health evaluations due to their verbosity and performance.
:::note JavaScript and Go templates
While `test` fields support JavaScript and Go templates, they are not recommended for health evaluations because of their verbosity and performance.
:::

## Variables
Expand Down
5 changes: 2 additions & 3 deletions canary-checker/docs/concepts/expressions/transforms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import TransformFields from './_transform_fields.mdx'

The `transform` can be used to convert one check into multiple checks programmatically.

```yaml title="alertmanager-check.yaml" file=<rootDir>/modules/canary-checker/fixtures/datasources/alertmanager.yaml
```yaml title="alertmanager-check.yaml" file=<rootDir>/modules/canary-checker/fixtures/datasources/alertmanager_mix.yaml
```

In the above example, the check returns multiple alerts from alertmanager. By default, all those alerts are grouped in a single check.
In the above example, the check returns multiple alerts from Alertmanager. By default, all those alerts are grouped in a single check.

But if we want to display each alert as its own check in the UI, we can use the `transform` function for this. The transform function takes a `Template` as input and the output from the template expected are the checks in JSON format.

Expand All @@ -30,4 +30,3 @@ To create a new check, return a JSON string of `[]TransformResult` containing th




Loading
Loading