# @spotify/backstage-plugin-insights-backend

## 0.8.1

### Patch Changes

- Updated dependency `backstage` to `1.55.0`.
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.21
  - @spotify/backstage-plugin-core-node@0.11.19
  - @spotify/backstage-plugin-insights-common@0.5.1
  - @spotify/backstage-plugin-insights-node@0.1.5

## 0.8.0

### Minor Changes

- Added a permanently dismissable option for feedback surveys. When enabled, closing a survey pop-up permanently hides it for the respondent. The option is editable while a survey is live and defaults to enabled for all surveys.

### Patch Changes

- Updated dependency `backstage` to `1.54.0`.
- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.5.0
  - @spotify/backstage-plugin-core-common@0.6.20
  - @spotify/backstage-plugin-core-node@0.11.18
  - @spotify/backstage-plugin-insights-node@0.1.4

## 0.7.14

### Patch Changes

- Updated dependency `backstage` to `1.53.0`.
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.19
  - @spotify/backstage-plugin-insights-node@0.1.3
  - @spotify/backstage-plugin-core-node@0.11.17
  - @spotify/backstage-plugin-insights-common@0.4.21

## 0.7.13

### Patch Changes

- Fixed a bug that prevented some values specified in `backstageInsights.capture*` config from being captured.
- Updated dependency `backstage` to `1.52.0`.
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.18
  - @spotify/backstage-plugin-core-node@0.11.16
  - @spotify/backstage-plugin-insights-common@0.4.20
  - @spotify/backstage-plugin-insights-node@0.1.2

## 0.7.12

### Patch Changes

- Updated dependency `backstage` to `1.51.0`.
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.17
  - @spotify/backstage-plugin-core-node@0.11.15
  - @spotify/backstage-plugin-insights-common@0.4.19
  - @spotify/backstage-plugin-insights-node@0.1.1

## 0.7.11

### Patch Changes

- Changes supporting experimental features
- Changes supporting experimental features.
- Updated dependencies
- Updated dependencies
- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.4.18
  - @spotify/backstage-plugin-insights-node@0.1.0

## 0.7.10

### Patch Changes

- Update licensing check to utilize CacheService
- Updated dependency `backstage` to `1.50.0`.
- Updated dependencies
- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.11.14
  - @spotify/backstage-plugin-core-common@0.6.16
  - @spotify/backstage-plugin-insights-common@0.4.17

## 0.7.9

### Patch Changes

- Adding support for experimental features.
- Updated dependency `backstage` to `1.49.0`.
- Updated package to be compatible with zod versions 3 and 4.
- Updated dependencies
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.15
  - @spotify/backstage-plugin-core-node@0.11.13
  - @spotify/backstage-plugin-insights-common@0.4.16

## 0.7.8

### Patch Changes

- Updated dependency `backstage` to `1.48.0`.
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.14
  - @spotify/backstage-plugin-core-node@0.11.12
  - @spotify/backstage-plugin-insights-common@0.4.15

## 0.7.7

### Patch Changes

- Updated dependency `backstage` to `1.47.0`.
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.13
  - @spotify/backstage-plugin-core-node@0.11.11
  - @spotify/backstage-plugin-insights-common@0.4.14

## 0.7.6

### Patch Changes

- Updated dependency `backstage` to `1.46.0`.
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.12
  - @spotify/backstage-plugin-core-node@0.11.10
  - @spotify/backstage-plugin-insights-common@0.4.13

## 0.7.5

### Patch Changes

- Updated dependency `backstage` to `1.45.0`.
- Dropped support for PostgreSQL 13, as this version is no longer under active support by the PostgreSQL group. The minimum PostgreSQL version is now 14.
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.11
  - @spotify/backstage-plugin-core-node@0.11.9
  - @spotify/backstage-plugin-insights-common@0.4.12

## 0.7.4

### Patch Changes

- Updated dependency `backstage` to `1.44.1`.
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.10
  - @spotify/backstage-plugin-core-node@0.11.8
  - @spotify/backstage-plugin-insights-common@0.4.11

## 0.7.3

### Patch Changes

- Minor fixes and improvements.
- If you've annotated your Scaffolder Templates with the [`backstage.io/time-saved`](https://backstage.io/docs/features/software-catalog/descriptor-format/#metadataannotationsbackstageiotime-saved-optional) annotation, the Backstage Insights plugin will aggregate and display time savings metrics in the Headlines and Usage tabs.
- Updated dependency `backstage` to `1.42.0`.
- Updated dependencies
- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.4.10
  - @spotify/backstage-plugin-core-common@0.6.9
  - @spotify/backstage-plugin-core-node@0.11.7

## 0.7.2

### Patch Changes

- Updated dependency `backstage` to `1.41.1`.
- Updated dependencies
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.8
  - @spotify/backstage-plugin-core-node@0.11.6
  - @spotify/backstage-plugin-insights-common@0.4.9

## 0.7.1

### Patch Changes

- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.11.5

## 0.7.0

### Minor Changes

- The ability to export raw data in CSV form is now in beta.

### Patch Changes

- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.4.8

## 0.6.0

### Minor Changes

- Fix issue with fetching catalog metadata for entities in trend tables

### Patch Changes

- Fixed a bug that prevented the `hostFilter` from working under some circumstances.
- Fixed a bug that could cause an event to be associated with the wrong group(s).
- Update to Backstage `v1.37.0`
- Permissions and resources are now exposed via the `permissionsRegistry`.
- Updated dependencies
- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.11.4
  - @spotify/backstage-plugin-core-common@0.6.7
  - @spotify/backstage-plugin-insights-common@0.4.7

## 0.5.4

### Patch Changes

- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.11.3

## 0.5.3

### Patch Changes

- Fixes an issue where the 'Content-Length' header was being set incorrectly when sending events.

## 0.5.2

### Patch Changes

- Update to Backstage `v1.36.0`
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.6
  - @spotify/backstage-plugin-core-node@0.11.2
  - @spotify/backstage-plugin-insights-common@0.4.6

## 0.5.1

### Patch Changes

- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.11.1

## 0.5.0

### Minor Changes

- Remove support for the legacy backend system.

### Patch Changes

- Package metadata cleanup.
- Dropped support for PostgreSQL 12, as this version is no longer under active support by the PostgreSQL group. The minimum PostgreSQL version is now 13.
- Added documentation to config schema properties
- Update to Backstage `v1.35.0`
- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.11.0
  - @spotify/backstage-plugin-insights-common@0.4.5
  - @spotify/backstage-plugin-core-common@0.6.5

## 0.4.5

### Patch Changes

- Update to Backstage `v1.34.0`
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.4
  - @spotify/backstage-plugin-core-node@0.10.5
  - @spotify/backstage-plugin-insights-common@0.4.4

## 0.4.4

### Patch Changes

- Update to Backstage `v1.33.3`
- Support for Backstage's Legacy Backend System (particularly the `createRouter` function) is deprecated and will be removed in January. Please be sure to have migrated your Backstage backend to the New Backend System by then, leveraging the `default` export from this plugin instead.
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.3
  - @spotify/backstage-plugin-core-node@0.10.4
  - @spotify/backstage-plugin-insights-common@0.4.3

## 0.4.3

### Patch Changes

- Update to Backstage v1.32.0
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.2
  - @spotify/backstage-plugin-core-node@0.10.3
  - @spotify/backstage-plugin-insights-common@0.4.2

## 0.4.2

### Patch Changes

- Minor fixes and improvements
- Update to Backstage v1.31.1
- Updated dependencies
  - @spotify/backstage-plugin-core-common@0.6.1
  - @spotify/backstage-plugin-core-node@0.10.2
  - @spotify/backstage-plugin-insights-common@0.4.1

## 0.4.1

### Patch Changes

- Upgraded Backstage to `v1.30.4`.
- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.10.1

## 0.4.0

### Minor Changes

- Upgraded Backstage to `v1.30.3`.

### Patch Changes

- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.4.0
  - @spotify/backstage-plugin-core-common@0.6.0
  - @spotify/backstage-plugin-core-node@0.10.0

## 0.3.2

### Patch Changes

- Upgraded Backstage to v1.29.1
- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.3.1
  - @spotify/backstage-plugin-core-common@0.5.14
  - @spotify/backstage-plugin-core-node@0.9.3

## 0.3.1

### Patch Changes

- Resolved an issue where some large metric responses would cause a request to fail when hitting caching limits.

## 0.3.0

### Minor Changes

- **BREAKING**: In order to support the new "Feedback" feature, `createRouter()` now requires that a `database` be passed in.

  If you are using the new Backend system, or if your `packages/backend/src/plugins/insights.ts` file looks like this, no action is necessary, other than to ensure that a persistent database is configured and available to the Insights backend:

  ```ts
  // packages/backend/src/plugins/insights.ts
  import { createRouter } from '@spotify/backstage-plugin-insights-backend';

  export default async function createPlugin(
    env: PluginEnvironment,
  ): Promise<Router> {
    return await createRouter({
      ...env,
    });
  }
  ```

  If you are manually specifying arguments to the `createRouter()` call, then you will need to add the database manager from the plugin environment:

  ```diff
  export default async function createPlugin(
    env: PluginEnvironment,
  ): Promise<Router> {
    return await createRouter({
      cache: env.cache,
      config: env.config,
  +   database: env.database,
      discovery: env.discovery,
      identity: env.identity,
      logger: env.logger,
      permissions: env.permissions,
      tokenManager: env.tokenManager,
    });
  }
  ```

### Patch Changes

- Fixes an issue where the names of entities are not being output correctly using the presentation API
- Added additional plugin metadata to `package.json`.
- Upgraded Backstage to v1.28.2
- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.3.0
  - @spotify/backstage-plugin-core-common@0.5.13
  - @spotify/backstage-plugin-core-node@0.9.2

## 0.2.14

### Patch Changes

- Improvements to the way configuration schema is handled.
- Updated dependency `yn` to `^5.0.0`.
- Updated dependency `supertest` to `^7.0.0`.
- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.9.1

## 0.2.13

### Patch Changes

- Created a generic deep catalog relational resolver utility
- Improved error handling in rare cases where network requests failed unexpectedly.
- Updates to experimental functionality.
- It's now possible to filter all metrics by the host name where usage data was captured (e.g. to differentiate between staging and production environments). To do so, set the `backstageInsights.hostFilter` config to the desired host. For example:

  ```yaml
  backstageInsights:
    hostFilter: backstage.acme-corp.net
  ```

- Fixed a bug that prevented relevant error details from being surfaced when querying for metrics.
- Now returns Catalog metadata required to leverage the Entity Presentation API
  in the Insights frontend.
- Added support for the new auth services in `createRouter`, which now optionally accepts the new `AuthService`, `HttpAuthService` and `PermissionService`. These service will be required (in place of the `TokenManager`, `IdentityApi` and `PermissionEvaluator`) in a future update.
- Aligned dependencies with Backstage package architecture expectations.
- Updated backstage dependencies to `v1.26.0`
- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.9.0
  - @spotify/backstage-plugin-core-common@0.5.12
  - @spotify/backstage-plugin-insights-common@0.2.9

## 0.2.12

### Patch Changes

- Fixed a bug that prevented relevant error details from being surfaced on the event collection endpoint when running Backstage `v1.23.x` or higher.
- Added compatibility for the new Backstage Backend System's default auth service.
- Updated backstage dependencies to `v1.24.0`
- Updated dependencies
  - `@spotify/backstage-plugin-core-node` to `^0.8.0`
  - `@spotify/backstage-plugin-core-common` to `^0.5.11`
  - `@spotify/backstage-plugin-insights-common` to `^0.2.8`

## 0.2.11

### Patch Changes

- Added support for [Backstage's New Backend System](https://backstage.io/docs/backend-system/). If you use or are planning to use the New Backend System, check the `README.md` for installation instructions. If you aren't using the New Backend System, no action is required.
- Updated dependency `@types/supertest` to `^6.0.0`.
- Upgraded to Backstage `v1.23.0`
- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.7.0
  - @spotify/backstage-plugin-insights-common@0.2.7
  - @spotify/backstage-plugin-core-common@0.5.10

## 0.2.10

### Patch Changes

- Upgraded Backstage to v1.22.0
- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.2.6
  - @spotify/backstage-plugin-core-node@0.6.9

## 0.2.9

### Patch Changes

- Upgraded Backstage to `v1.20.2`.
- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.2.5
  - @spotify/backstage-plugin-core-node@0.6.8

## 0.2.8

### Patch Changes

- Fixed an issue that was causing an incorrect filter to be sent to the catalog, resulting in a total user count of zero.

## 0.2.7

### Patch Changes

- Upgraded Backstage to v1.19.0
- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.2.4
  - @spotify/backstage-plugin-core-node@0.6.7

## 0.2.6

### Patch Changes

- Upgraded Backstage to v1.18.1
- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.2.3
  - @spotify/backstage-plugin-core-node@0.6.6

## 0.2.5

### Patch Changes

- Fixed a bug that prevented catalog entities from being loaded if auth middleware was being used on backend API routes.

## 0.2.4

### Patch Changes

- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.2.2

## 0.2.3

### Patch Changes

- Fixed a bug that prevented the total number of users from being shown if the Software Catalog was at Backstage version `~1.17.0`.

## 0.2.2

### Patch Changes

- Fixed a bug that prevented user groups from being collected when their relationship was only defined as direct `memberOf` groups.
- Upgraded Backstage to `v1.17.0`.
- Improved error handling and logging.
- Added a `backstageInsights.captureIdentityGroupsFilter` config option to specify which membership groups are captured for events. See [the Insights Backend README](https://www.npmjs.com/package/@spotify/backstage-plugin-insights-backend#user-content-identity-groups-filter) for details.
- Updated dependencies
  - @spotify/backstage-plugin-core-node@0.6.5
  - @spotify/backstage-plugin-insights-common@0.2.1

## 0.2.1

### Patch Changes

- Fixed a bug that could overload a cache store during event collection if the permissions framework was enabled.

## 0.2.0

### Minor Changes

- Introducing the new Backstage Insights! Now available in your Backstage instance. To get started, check the installation instructions at https://www.npmjs.com/package/@spotify/backstage-plugin-insights.

### Patch Changes

- Reduce the collection of duplicate metadata (like `entity.metadata.name`).
- Cleaned up unused dependencies.
- Upgraded Backstage to `v1.16.0`
- Updated dependencies
  - @spotify/backstage-plugin-insights-common@0.2.0
  - @spotify/backstage-plugin-core-node@0.6.4

## 0.1.1

### Patch Changes

- Upgraded to Backstage `v1.15.0`
- Updated dependencies
  - @spotify/backstage-plugin-analytics-module-insights@0.7.1
  - @spotify/backstage-plugin-core-node@0.6.3
  - @spotify/backstage-plugin-insights-common@0.1.1

## 0.1.0

### Minor Changes

- Initial release of the Insights backend plugin, with support for analytics event hydration.

### Patch Changes

- Upgraded to Backstage `v1.14.0`
- Updated dependencies
  - @spotify/backstage-plugin-analytics-module-insights@0.7.0
  - @spotify/backstage-plugin-insights-common@0.1.0
  - @spotify/backstage-plugin-core-node@0.6.2
