From 296aea34da1a1b7dfe336b22dac9698f99e843b3 Mon Sep 17 00:00:00 2001 From: Mengnan Gong Date: Wed, 12 Oct 2022 20:22:08 +0800 Subject: [PATCH] Update the README doc for tech-insights-backend The Tech Insights plugin supports running fact retrievers across multiple instances. Update the README to remove the stale instructions. Signed-off-by: Mengnan Gong --- .changeset/loud-wombats-taste.md | 5 +++++ plugins/tech-insights-backend/README.md | 17 +---------------- 2 files changed, 6 insertions(+), 16 deletions(-) create mode 100644 .changeset/loud-wombats-taste.md diff --git a/.changeset/loud-wombats-taste.md b/.changeset/loud-wombats-taste.md new file mode 100644 index 0000000000..a1558aa517 --- /dev/null +++ b/.changeset/loud-wombats-taste.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-tech-insights-backend': patch +--- + +The Tech Insights plugin supports running fact retrievers across multiple instances. Update the README to remove the stale instructions. diff --git a/plugins/tech-insights-backend/README.md b/plugins/tech-insights-backend/README.md index c5c6e66270..26dac78db5 100644 --- a/plugins/tech-insights-backend/README.md +++ b/plugins/tech-insights-backend/README.md @@ -114,22 +114,7 @@ const builder = buildTechInsightsContext({ #### Running fact retrievers in a multi-instance installation -Current logic on running scheduled fact retrievers is intended to be executed in a single instance. Running on multi-instane environment there might be some additional data accumulation when multiple fact retrievers would retrieve and persist their facts. To mitigate this it is recommended to mark a single instance to be a specific fact retriever instance. One way to do this is by using environment variables to indicate if the retrievers should be registered. This can be done for example like the code snippet below - -```diff -const builder = buildTechInsightsContext({ - logger: env.logger, - config: env.config, - database: env.database, - discovery: env.discovery, - tokenManager: env.tokenManager, - scheduler: env.scheduler, -- factRetrievers: [], -+ factRetrievers: process.env.MAIN_FACT_RETRIEVER_INSTANCE ? [myFactRetrieverRegistration] : [], -}); -``` - -Where the instance dedicated to handling retrieval of facts would have environment variable `MAIN_FACT_RETRIEVER_INSTANCE` set to true. +The Tech Insights plugin utilizes the `PluginTaskScheduler` for scheduling tasks and coordinating the task invocation across instances. See [the PluginTaskScheduler documentation](https://backstage.io/docs/reference/backend-tasks.plugintaskscheduler) for more information. ### Creating Fact Retrievers