+): RequestHandler
=> {
+ return async (context, req, res) => {
+ const { isAvailable } = await context.integrationAssistant;
+ if (!isAvailable()) {
+ return res.notFound({
+ body: { message: 'This API route is not available using your current license/tier.' },
+ });
+ }
+ return handler(context, req, res);
+ };
+};
diff --git a/x-pack/plugins/integration_assistant/server/templates/package_readme.md.njk b/x-pack/plugins/integration_assistant/server/templates/package_readme.md.njk
index 74520da051b8b..02bf606ab386a 100644
--- a/x-pack/plugins/integration_assistant/server/templates/package_readme.md.njk
+++ b/x-pack/plugins/integration_assistant/server/templates/package_readme.md.njk
@@ -1,24 +1,38 @@
# {{ package_name }} Integration
-This integration is for ingesting data from [{{ package_name }}](https://example.com/).
-{% for data_stream in data_streams %}
-- `{{ data_stream.name }}`: {{ data_stream.description }}
-{% endfor %}
-See [Link to docs](https://example.com/docs) for more information.
+## Overview
+
+Explain what the integration is, define the third-party product that is providing data, establish its relationship to the larger ecosystem of Elastic products, and help the reader understand how it can be used to solve a tangible problem.
+Check the [overview guidelines](https://www.elastic.co/guide/en/integrations-developer/current/documentation-guidelines.html#idg-docs-guidelines-overview) for more information.
+
+## Datastreams
+
+Provide a high-level overview of the kind of data that is collected by the integration.
+Check the [datastreams guidelines](https://www.elastic.co/guide/en/integrations-developer/current/documentation-guidelines.html#idg-docs-guidelines-datastreams) for more information.
-## Compatibility
+## Requirements
-Insert compatibility information here. This could for example be which versions of the product it was tested with.
+The requirements section helps readers to confirm that the integration will work with their systems.
+Check the [requirements guidelines](https://www.elastic.co/guide/en/integrations-developer/current/documentation-guidelines.html#idg-docs-guidelines-requirements) for more information.
## Setup
-Insert how to configure the vendor side of the integration here, for example how to configure the API, create a syslog remote destination etc.
+Point the reader to the [Observability Getting started guide](https://www.elastic.co/guide/en/observability/master/observability-get-started.html) for generic, step-by-step instructions. Include any additional setup instructions beyond what’s included in the guide, which may include instructions to update the configuration of a third-party service.
+Check the [setup guidelines](https://www.elastic.co/guide/en/integrations-developer/current/documentation-guidelines.html#idg-docs-guidelines-setup) for more information.
+
+## Troubleshooting (optional)
+
+Provide information about special cases and exceptions that aren’t necessary for getting started or won’t be applicable to all users. Check the [troubleshooting guidelines](https://www.elastic.co/guide/en/integrations-developer/current/documentation-guidelines.html#idg-docs-guidelines-troubleshooting) for more information.
+
+## Reference
+
+Provide detailed information about the log or metric types we support within the integration. Check the [reference guidelines](https://www.elastic.co/guide/en/integrations-developer/current/documentation-guidelines.html#idg-docs-guidelines-reference) for more information.
## Logs
{% for data_stream in data_streams %}
### {{ data_stream.name }}
-Insert a description of the data stream here.
+Insert a description of the datastream here.
{% raw %}{{fields {% endraw %}"{{ data_stream.name }}"{% raw %}}}{% endraw %}
{% endfor %}
diff --git a/x-pack/plugins/integration_assistant/server/types.ts b/x-pack/plugins/integration_assistant/server/types.ts
index 54713df18b0d8..503c318648bad 100644
--- a/x-pack/plugins/integration_assistant/server/types.ts
+++ b/x-pack/plugins/integration_assistant/server/types.ts
@@ -5,11 +5,21 @@
* 2.0.
*/
-// eslint-disable-next-line @typescript-eslint/no-empty-interface
-export interface IntegrationAssistantPluginSetup {}
+import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server';
+
+export interface IntegrationAssistantPluginSetup {
+ setIsAvailable: (isAvailable: boolean) => void;
+}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface IntegrationAssistantPluginStart {}
+export interface IntegrationAssistantPluginSetupDependencies {
+ licensing: LicensingPluginSetup;
+}
+export interface IntegrationAssistantPluginStartDependencies {
+ licensing: LicensingPluginStart;
+}
+
export interface CategorizationState {
rawSamples: string[];
samples: string[];
diff --git a/x-pack/plugins/integration_assistant/tsconfig.json b/x-pack/plugins/integration_assistant/tsconfig.json
index ec7a7e094997d..47087c83731a0 100644
--- a/x-pack/plugins/integration_assistant/tsconfig.json
+++ b/x-pack/plugins/integration_assistant/tsconfig.json
@@ -33,6 +33,7 @@
"@kbn/stack-connectors-plugin",
"@kbn/core-analytics-browser",
"@kbn/logging-mocks",
+ "@kbn/licensing-plugin",
"@kbn/core-http-request-handler-context-server",
"@kbn/core-http-router-server-mocks",
"@kbn/core-http-server"
diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/top_erroneous_transactions/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/top_erroneous_transactions/index.tsx
index 50d63b305a644..f81d6b8d7abf3 100644
--- a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/top_erroneous_transactions/index.tsx
+++ b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/top_erroneous_transactions/index.tsx
@@ -154,6 +154,7 @@ export function TopErroneousTransactions({ serviceName }: Props) {