Skip to main content

Retention

After scraping we can choose to retain results on the basis of name, age, count and more.

The retention rules are applied for each unique catalog item. If changes is specified with type X and count 20, last 20 changes of X type would be kept for each catalog item

FieldDescriptionSchemeRequired
changesSpecify retention rules for changes[]ChangeRetention
typesSpecify retention rules for config items[]ConfigRetention
staleItemAgeconfigs that were last updated before the age will be deletedstring

Config Retention

kubernetes-scraper.yaml
apiVersion: configs.flanksource.com/v1
kind: ScrapeConfig
metadata:
name: kubernetes-scraper
spec:
retention:
types:
- name: Kubernetes::Pod
createdAge: 7d
kubernetes:
clusterName: local
FieldDescriptionSchemeRequired
nameSpecify retention rules for changesstring
createdAgeSpecify retention rules for config itemsstring
updatedAgeSpecify retention rules for config itemsstring
deletedAgeSpecify retention rules for config itemsstring

Cleaning up stale configs

When config items are deleted on the source, config-db doesn't know about it because it only saves what it sees at present. Items that were scraped before and no longer seen are considered stale. You can delete these stale items by configuring the staleItemAge field in the retention section.

kubernetes-scraper.yaml
apiVersion: configs.flanksource.com/v1
kind: ScrapeConfig
metadata:
name: kubernetes-scraper
spec:
retention:
staleItemAge: 30m
kubernetes:
clusterName: local