Skip to content

Commit

Permalink
[Infra] Disable infra plugin in serverless projects (elastic#165289)
Browse files Browse the repository at this point in the history
closes elastic#158925

## Summary

This PR disables the infra plugin in the `oblt` and `security` projects

### Oblt
**Navbar**
<img width="300" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/f88fd2a5-ed58-4bcf-b5ad-5b25357daf5c">

**Saved Objects**
<img width="800" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/4140760c-2572-4391-8977-bc97fcd14bb8">



**Server-side APIs**
<img width="800" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/eb22b024-dfd5-4c7f-b760-bfd2c633f759">

**Infra routes**
/metrics/inventory

<img width="500" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/6ddba766-c6f0-40d0-9183-2bcbae348d52">

**Alert rules**
<img width="300" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/d03d087e-d562-425b-a4d9-a17d5fe0b158">


### APM

Infra links hidden in the Transaction "Investigate" pop up menu
<img width="800" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/d9364d55-6e06-4ac0-8668-6ce2331a6250">

Infra links removed from Services Overview Instance actions
<img width="800" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/73410e5c-be6c-4174-8df0-76fb6a25b2f6">

** Server Routes **

<img width="800" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/488f639b-81e8-497d-a55e-4e7f31644bc5">

<img width="800" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/4366005a-2eb8-4f33-8d1e-09865cad06b4">

<img width="800" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/46b34d0d-8171-4d8d-bfb8-fd4c32583fbb">





### Security

**Saved Objects**
<img width="800" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/14f08e7e-565b-42e9-8fc4-753d1b54c14a">



**Server-side APIs**
<img width="800" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/eb22b024-dfd5-4c7f-b760-bfd2c633f759">

**Infra routes**
/metrics/inventory

<img width="500" alt="image"
src="https://github.com/elastic/kibana/assets/2767137/6ddba766-c6f0-40d0-9183-2bcbae348d52">


### How to test

- Start a local ES instance
- run `yarn serverless-oblt` and `yarn serverless-security`
- Validate the screenshots above.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
crespocarlos and kibanamachine authored Sep 8, 2023
1 parent 631ffbb commit 7ba3554
Show file tree
Hide file tree
Showing 13 changed files with 220 additions and 195 deletions.
1 change: 1 addition & 0 deletions config/serverless.oblt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Disable plugins
enterpriseSearch.enabled: false
xpack.cloudSecurityPosture.enabled: false
xpack.infra.enabled: false
xpack.securitySolution.enabled: false
xpack.uptime.enabled: false
xpack.legacy_uptime.enabled: false
Expand Down
1 change: 1 addition & 0 deletions config/serverless.security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Disable plugins
enterpriseSearch.enabled: false
xpack.apm.enabled: false
xpack.infra.enabled: false
xpack.observability.enabled: false
xpack.uptime.enabled: false
xpack.legacy_uptime.enabled: false
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"controls",
"embeddable",
"features",
"infra",
"logsShared",
"inspector",
"licensing",
Expand All @@ -41,6 +40,7 @@
"discover",
"fleet",
"fieldFormats",
"infra",
"home",
"ml",
"security",
Expand All @@ -49,7 +49,7 @@
"usageCollection",
"customIntegrations", // Move this to requiredPlugins after completely migrating from the Tutorials Home App
"licenseManagement",
"profiling",
"profiling"
],
"requiredBundles": [
"advancedSettings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ export function InstanceActionsMenu({
kuery,
onClose,
}: Props) {
const {
core,
infra: { locators },
} = useApmPluginContext();
const { core, infra } = useApmPluginContext();
const { data, status } = useInstanceDetailsFetcher({
serviceName,
serviceNodeName,
Expand Down Expand Up @@ -92,7 +89,7 @@ export function InstanceActionsMenu({
basePath: core.http.basePath,
onFilterByInstanceClick: handleFilterByInstanceClick,
metricsHref,
infraLocators: locators,
infraLocators: infra?.locators,
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,67 +52,71 @@ export function getMenuSections({
? new Date(instanceDetails['@timestamp']).valueOf()
: undefined;
const infraMetricsQuery = getInfraMetricsQuery(instanceDetails['@timestamp']);
const infraNodeLocator = infraLocators.nodeLogsLocator;
const infraNodeLocator = infraLocators?.nodeLogsLocator;

const podActions: Action[] = [
{
key: 'podLogs',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.podLogs',
{ defaultMessage: 'Pod logs' }
),
href: infraNodeLocator.getRedirectUrl({
nodeId: podId!,
nodeType: 'pod',
time,
}),
condition: !!podId,
},
{
key: 'podMetrics',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.podMetrics',
{ defaultMessage: 'Pod metrics' }
),
href: getInfraHref({
app: 'metrics',
basePath,
path: `/link-to/pod-detail/${podId}`,
query: infraMetricsQuery,
}),
condition: !!podId,
},
];
const podActions: Action[] = infraNodeLocator
? [
{
key: 'podLogs',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.podLogs',
{ defaultMessage: 'Pod logs' }
),
href: infraNodeLocator?.getRedirectUrl({
nodeId: podId!,
nodeType: 'pod',
time,
}),
condition: !!podId,
},
{
key: 'podMetrics',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.podMetrics',
{ defaultMessage: 'Pod metrics' }
),
href: getInfraHref({
app: 'metrics',
basePath,
path: `/link-to/pod-detail/${podId}`,
query: infraMetricsQuery,
}),
condition: !!podId,
},
]
: [];

const containerActions: Action[] = [
{
key: 'containerLogs',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.containerLogs',
{ defaultMessage: 'Container logs' }
),
href: infraNodeLocator.getRedirectUrl({
nodeId: containerId!,
nodeType: 'container',
time,
}),
condition: !!containerId,
},
{
key: 'containerMetrics',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.containerMetrics',
{ defaultMessage: 'Container metrics' }
),
href: getInfraHref({
app: 'metrics',
basePath,
path: `/link-to/container-detail/${containerId}`,
query: infraMetricsQuery,
}),
condition: !!containerId,
},
];
const containerActions: Action[] = infraNodeLocator
? [
{
key: 'containerLogs',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.containerLogs',
{ defaultMessage: 'Container logs' }
),
href: infraNodeLocator?.getRedirectUrl({
nodeId: containerId!,
nodeType: 'container',
time,
}),
condition: !!containerId,
},
{
key: 'containerMetrics',
label: i18n.translate(
'xpack.apm.serviceOverview.instancesTable.actionMenus.containerMetrics',
{ defaultMessage: 'Container metrics' }
),
href: getInfraHref({
app: 'metrics',
basePath,
path: `/link-to/container-detail/${containerId}`,
query: infraMetricsQuery,
}),
condition: !!containerId,
},
]
: [];

const apmActions: Action[] = [
{
Expand Down
Loading

0 comments on commit 7ba3554

Please sign in to comment.