Added Catalog Collator filter example

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
This commit is contained in:
Andre Wanlin
2025-02-27 12:27:29 -06:00
parent 26550b1097
commit ba63794eb2
+40
View File
@@ -35,6 +35,10 @@ backend.start();
### Configuring the Catalog Collator
The following sections outlines the available configurations for this collator.
#### Scheduling
The default schedule for the Catalog Collator is to run every 10 minutes, you can provide your own schedule by adding it to your config:
```yaml title="app-config.yaml
@@ -50,6 +54,42 @@ search:
timeout: { minutes: 3 }
```
#### Filtering
You may wish to collate specific subsets of entities in your Catalog, this can be accomplished using the `filter` configuration option. Here's a basic example:
```yaml title"app-config.yaml"
search:
collators:
catalog:
filter:
kind: ['component', 'api']
spec.lifecycle: production
```
The above example will only collate entities that are `kind` equal to `component` or `api` AND have a `spec.lifecycle` set to `production`
You can also apply a more advanced filter like this:
```yaml title"app-config.yaml"
search:
collators:
catalog:
filter:
- kind: ['API']
spec.type: openapi
- kind: ['Component']
spec.lifecycle: experimental
```
Now with this example it will collate all entities that are `kind` equal to `api` with a `spec.type` equal to `openapi` OR all entities that are `kind` equal to `component` AND have a `spec.lifecycle` set to `experimental`
:::tip
The filter configuration is implemented using the `EntityFilterQuery` syntax. The [reference documentation on `EntityFilterQuery`](https://backstage.io/docs/reference/catalog-client.entityfilterquery/) provides more details.
:::
## TechDocs
The TechDocs collator will index all the TechDocs in your Catalog. It is installed by default but if you need to add it manually here's how.