Skip to main content

Artifacts

Artifacts allow you to archive files generated by some checks to a file store of your choice.

Filestores

  • AWS S3
  • Google Cloud Storage
  • SFTP
  • SMB
  • Local Filesystem

Setting up artifact store

One of the above filestores can be used as the global artifact store. To setup an artifact store, pass the connection name of the store using the artifact-connection flag. If the artifact connection isn't setup, the artifacts are simply ignored.

Example:

canary-checker --artifact-connection='connection://sftp/artifacts'

Archiving artifacts

The following checks support archiving artifacts

The only configuration required is to provide the path(s) of the artifacts generated by the check.

Archiving /tmp/results/ directory

For the following script in an exec check

mkdir -p /tmp/results
curl -sL 'https://example.com' > /tmp/results/example.com
curl -sL 'https://flanksource.com' > /tmp/results/flanksource.com

one can provide the artifact paths as follows

archive-websites.yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: exec-artifact
spec:
interval: 30
exec:
- name: Download example.com and flanksource.com
script: |
mkdir -p /tmp/results
curl -sL 'https://example.com' > /tmp/results/example.com
curl -sL 'https://flanksource.com' > /tmp/results/flanksource.com
artifacts:
- path: /tmp/results/example.com
- path: /tmp/results/flanksource.com

or, use a glob as

artifacts
- path: '/tmp/results/*.com'

Ex2. Archiving artifacts from stdout/stderr

The path field accepts two special paths

  • /dev/stdout
  • /dev/stderr
archive-website.yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: exec-artifact
spec:
interval: 30
exec:
- name: Archive response of example.com
script: |
curl -sL 'https://example.com'
artifacts:
- path: /dev/stdout
- path: /dev/stderr