Soundcheck Tech Insights Integration
Spotify Plugins for Backstage: Soundcheck - Tech Insights Integration
Tech Insights integration plugin for Soundcheck. Exposes facts from Tech Insights to Soundcheck, allowing them to be used in Soundcheck checks.
Prerequisites
Add the TechInsightsHubFactCollector to Soundcheck
First add the package: yarn workspace backend add @spotify/backstage-plugin-soundcheck-backend-module-techinsights
Then in packages/backend/src/plugins/soundcheck.ts
, add the TechInsightsFactCollector
:
import { SoundcheckBuilder } from '@spotify/backstage-plugin-soundcheck-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
+ import { TechInsightsFactCollector } from '@spotify/backstage-plugin-soundcheck-backend-module-techinsights';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
return SoundcheckBuilder.create({ ...env })
+ .addFactCollectors(
+ TechInsightsFactCollector.create({
+ discovery: env.discovery,
+ tokenManager: env.tokenManager,
+ logger: env.logger,
+ }),
+ )
.build();
}
New Backend System
If you are using the New Backend System, instead of the above, you can just add
the following to your packages/backend/src/index.ts
file:
const backend = createBackend();
backend.add(import('@spotify/backstage-plugin-soundcheck-backend'));
+ backend.add(import('@spotify/backstage-plugin-soundcheck-backend-module-techinsights'));
// ...
backend.start();
See the the soundcheck-backend documentation for additional details on creating the Soundcheck backend.
Rate Limiting (Optional)
This fact collector can be rate limited in Soundcheck using the following configuration:
soundcheck:
job:
workers:
techinsights:
limiter:
max: 1000
duration: 60000
In this example the fact collector is limited to 1000 executions per minute.
This fact collector handles 429 rate limit errors from Tech Insights. Soundcheck will automatically wait and retry requests that are rate limited.
Using TechInsight facts in Soundcheck
Soundcheck fact references for this plugin follow the format techinsights:default/<id>
where <id>
is the fact retriever identifier from Tech Insights. For example, if there is a Tech Insights fact
retriever with ID entityOwnershipFactRetriever
, its Soundcheck fact reference would be
techinsights:default/entityOwnershipFactRetriever
.
This enables facts from Tech Insights to be used in Soundcheck check. For example:
id: has-owner
rule:
factRef: techinsights:default/entityOwnershipFactRetriever
path: $.hasOwner
operator: equal
value: true
When this check is executed it will pull the fact(s) with fact retriever identifier
entityOwnershipFactRetriever
from Tech Insights and perform the specified check logic on it.
Currently, the collection of facts from Tech Insights is not scheduled or cached, they are only collected on demand when a check using a Tech Insights fact is executed (which can be scheduled).