Skip to content

Commit

Permalink
Merge branch 'main' into 192857-service-map-possible-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MiriamAparicio authored Nov 5, 2024
2 parents aa66780 + 4e753fa commit 5a728a0
Show file tree
Hide file tree
Showing 29 changed files with 525 additions and 154 deletions.
355 changes: 355 additions & 0 deletions docs/CHANGELOG.asciidoc

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions docs/upgrade-notes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,30 @@ When you create *Lens* visualization, the default for the *Legend width* is now
[float]
==== Elastic Observability solution

[discrete]
[[deprecation-192003]]
* Deprecated the Observability AI Assistant specific advanced setting `observability:aiAssistantLogsIndexPattern`. (8.16)
[%collapsible]
====
*Details* +
The Observability AI Assistant specific advanced setting for Logs index patterns `observability:aiAssistantLogsIndexPattern` is deprecated and no longer used. The AI Assistant will now use the existing **Log sources** setting `observability:logSources` instead. For more information, refer to ({kibana-pull}192003[#192003]).
//*Impact* +
//!!TODO!!
====

[discrete]
[[deprecation-194519]]
* The Logs Stream was hidden by default in favor of the Logs Explorer app. (8.16)
[%collapsible]
====
*Details* +
You can find the Logs Explorer app in the navigation menu under Logs > Explorer, or as a separate tab in Discover. For more information, refer to ({kibana-pull}194519[#194519]).
*Impact* +
You can still show the Logs Stream app again by navigating to Stack Management > Advanced Settings and by enabling the `observability:enableLogsStream` setting.
====


[discrete]
[[deprecation-120689]]
Expand Down
Binary file added docs/user/images/dashboard-star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/dashboard-usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/discover-log-level.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/esql-suggestions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/ip-location-processor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/metric-customization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/monaco-console.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/solution-view-obs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/space-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/images/table-coloring.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
163 changes: 66 additions & 97 deletions docs/user/whats-new.asciidoc

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,6 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
base: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}`,
inputElasticAgent: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}/plugins-inputs-elastic_agent.html`,
},
functionbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/functionbeat/${DOC_LINK_VERSION}`,
},
winlogbeat: {
base: `${ELASTIC_WEBSITE_URL}guide/en/beats/winlogbeat/${DOC_LINK_VERSION}`,
},
Expand Down
3 changes: 0 additions & 3 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ export interface DocLinks {
readonly base: string;
readonly inputElasticAgent: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ export const LanguageClientPanel: React.FC<SelectClientProps> = ({
width={euiTheme.size.xl}
/>
<EuiSpacer size="s" />
<EuiText textAlign="center" color={isSelectedLanguage ? 'default' : 'subdued'}>
<h5>{language.name}</h5>
<EuiText
size="relative"
textAlign="center"
color={isSelectedLanguage ? 'default' : 'subdued'}
>
<strong>{language.name}</strong>
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/data/server/search/session/session_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ export class SearchSessionService implements ISearchSessionService {
const session = await this.get(deps, user, sessionId);
const requestHash = createRequestHash(searchRequest.params);
if (!Object.hasOwn(session.attributes.idMapping, requestHash)) {
this.logger.error(`SearchSessionService: getId | ${sessionId} | ${requestHash} not found`);
this.logger.debug(
this.logger.debug(`SearchSessionService: getId | ${sessionId} | ${requestHash} not found`);
this.logger.error(
`SearchSessionService: getId not found search with params: ${JSON.stringify(
searchRequest.params
)}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export const CreateApiKeyFlyout: React.FC<CreateApiKeyFlyoutProps> = ({ onClose
defaultMessage: 'Store this API key',
})}
titleSize="xs"
role="alert"
>
<EuiText>
{i18n.translate('xpack.enterpriseSearch.apiKey.apiKeyStepDescription', {
Expand Down
36 changes: 26 additions & 10 deletions x-pack/plugins/fleet/server/services/agent_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import { asyncForEach } from '@kbn/std';

import type { SavedObjectError } from '@kbn/core-saved-objects-common';

import { withSpan } from '@kbn/apm-utils';

import {
getAllowedOutputTypeForPolicy,
packageToPackagePolicy,
Expand Down Expand Up @@ -170,11 +172,13 @@ class AgentPolicyService {
removeProtection: boolean;
skipValidation: boolean;
returnUpdatedPolicy?: boolean;
asyncDeploy?: boolean;
} = {
bumpRevision: true,
removeProtection: false,
skipValidation: false,
returnUpdatedPolicy: true,
asyncDeploy: false,
}
): Promise<AgentPolicy> {
const savedObjectType = await getAgentPolicySavedObjectType();
Expand Down Expand Up @@ -228,10 +232,19 @@ class AgentPolicyService {
newAgentPolicy!.package_policies = existingAgentPolicy.package_policies;

if (options.bumpRevision || options.removeProtection) {
await this.triggerAgentPolicyUpdatedEvent(esClient, 'updated', id, {
spaceId: soClient.getCurrentNamespace(),
agentPolicy: newAgentPolicy,
});
if (!options.asyncDeploy) {
await this.triggerAgentPolicyUpdatedEvent(esClient, 'updated', id, {
spaceId: soClient.getCurrentNamespace(),
agentPolicy: newAgentPolicy,
});
} else {
await scheduleDeployAgentPoliciesTask(appContextService.getTaskManagerStart()!, [
{
id,
spaceId: soClient.getCurrentNamespace(),
},
]);
}
}
logger.debug(
`Agent policy ${id} update completed, revision: ${
Expand Down Expand Up @@ -878,13 +891,16 @@ class AgentPolicyService {
soClient: SavedObjectsClientContract,
esClient: ElasticsearchClient,
id: string,
options?: { user?: AuthenticatedUser; removeProtection?: boolean }
options?: { user?: AuthenticatedUser; removeProtection?: boolean; asyncDeploy?: boolean }
): Promise<void> {
await this._update(soClient, esClient, id, {}, options?.user, {
bumpRevision: true,
removeProtection: options?.removeProtection ?? false,
skipValidation: false,
returnUpdatedPolicy: false,
return withSpan('bump_agent_policy_revision', async () => {
await this._update(soClient, esClient, id, {}, options?.user, {
bumpRevision: true,
removeProtection: options?.removeProtection ?? false,
skipValidation: false,
returnUpdatedPolicy: false,
asyncDeploy: options?.asyncDeploy,
});
});
}

Expand Down
28 changes: 14 additions & 14 deletions x-pack/plugins/fleet/server/services/package_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,22 +480,21 @@ class PackagePolicyClientImpl implements PackagePolicyClient {
user?: AuthenticatedUser;
bumpRevision?: boolean;
force?: true;
asyncDeploy?: boolean;
}
): Promise<{
created: PackagePolicy[];
failed: Array<{ packagePolicy: NewPackagePolicy; error?: Error | SavedObjectError }>;
}> {
const useSpaceAwareness = await isSpaceAwarenessEnabled();
const savedObjectType = await getPackagePolicySavedObjectType();
for (const packagePolicy of packagePolicies) {
const [useSpaceAwareness, savedObjectType, packageInfos] = await Promise.all([
isSpaceAwarenessEnabled(),
getPackagePolicySavedObjectType(),
getPackageInfoForPackagePolicies(packagePolicies, soClient),
]);

await pMap(packagePolicies, async (packagePolicy) => {
const basePkgInfo = packagePolicy.package
? await getPackageInfo({
savedObjectsClient: soClient,
pkgName: packagePolicy.package.name,
pkgVersion: packagePolicy.package.version,
ignoreUnverified: true,
prerelease: true,
})
? packageInfos.get(`${packagePolicy.package.name}-${packagePolicy.package.version}`)
: undefined;
if (!packagePolicy.id) {
packagePolicy.id = SavedObjectsUtils.generateId();
Expand All @@ -508,7 +507,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient {

this.keepPolicyIdInSync(packagePolicy);
await preflightCheckPackagePolicy(soClient, packagePolicy, basePkgInfo);
}
});

const agentPolicyIds = new Set(packagePolicies.flatMap((pkgPolicy) => pkgPolicy.policy_ids));

Expand All @@ -528,8 +527,6 @@ class PackagePolicyClientImpl implements PackagePolicyClient {
}
}

const packageInfos = await getPackageInfoForPackagePolicies(packagePolicies, soClient);

const isoDate = new Date().toISOString();

const policiesToCreate: Array<SavedObjectsBulkCreateObject<PackagePolicySOAttributes>> = [];
Expand Down Expand Up @@ -665,6 +662,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient {
for (const agentPolicyId of agentPolicyIds) {
await agentPolicyService.bumpRevision(soClient, esClient, agentPolicyId, {
user: options?.user,
asyncDeploy: options?.asyncDeploy,
});
}
}
Expand Down Expand Up @@ -1176,7 +1174,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient {
soClient: SavedObjectsClientContract,
esClient: ElasticsearchClient,
packagePolicyUpdates: Array<NewPackagePolicy & { version?: string; id: string }>,
options?: { user?: AuthenticatedUser; force?: boolean }
options?: { user?: AuthenticatedUser; force?: boolean; asyncDeploy?: boolean }
): Promise<{
updatedPolicies: PackagePolicy[] | null;
failedPolicies: Array<{
Expand Down Expand Up @@ -1347,6 +1345,7 @@ class PackagePolicyClientImpl implements PackagePolicyClient {
await agentPolicyService.bumpRevision(soClient, esClient, agentPolicyId, {
user: options?.user,
removeProtection,
asyncDeploy: options?.asyncDeploy,
});
});

Expand Down Expand Up @@ -2368,6 +2367,7 @@ class PackagePolicyClientWithAuthz extends PackagePolicyClientImpl {
user?: AuthenticatedUser | undefined;
bumpRevision?: boolean | undefined;
force?: true | undefined;
asyncDeploy?: boolean;
}
| undefined
): Promise<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export interface PackagePolicyClient {
bumpRevision?: boolean;
force?: true;
authorizationHeader?: HTTPAuthorizationHeader | null;
asyncDeploy?: boolean;
}
): Promise<{
created: PackagePolicy[];
Expand All @@ -115,7 +116,7 @@ export interface PackagePolicyClient {
soClient: SavedObjectsClientContract,
esClient: ElasticsearchClient,
packagePolicyUpdates: UpdatePackagePolicy[],
options?: { user?: AuthenticatedUser; force?: boolean },
options?: { user?: AuthenticatedUser; force?: boolean; asyncDeploy?: boolean },
currentVersion?: string
): Promise<{
updatedPolicies: PackagePolicy[] | null;
Expand Down Expand Up @@ -165,6 +166,7 @@ export interface PackagePolicyClient {
user?: AuthenticatedUser;
skipUnassignFromAgentPolicies?: boolean;
force?: boolean;
asyncDeploy?: boolean;
},
context?: RequestHandlerContext,
request?: KibanaRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# APM E2E

APM uses [FTR](../../../../../packages/kbn-test/README.md) (functional test runner) and [Cypress](https://www.cypress.io/) to run the e2e tests. The tests are located at `kibana/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/integration`.
APM uses [FTR](../../../../../packages/kbn-test/README.mdx) (functional test runner) and [Cypress](https://www.cypress.io/) to run the e2e tests. The tests are located at `kibana/x-pack/plugins/observability_solution/apm/ftr_e2e/cypress/integration`.

## Tips and best practices

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const timeRange = {
rangeTo: end,
};
// flaky
describe.skip('Transaction details', () => {
describe('Transaction details', () => {
before(() => {
synthtrace.index(
opbeans({
Expand All @@ -34,8 +34,7 @@ describe.skip('Transaction details', () => {
cy.loginAsViewerUser();
});

// skipping this as it´s been failing a lot lately, more information here https://github.com/elastic/kibana/issues/197386
it.skip('shows transaction name and transaction charts', () => {
it('shows transaction name and transaction charts', () => {
cy.intercept('GET', '/internal/apm/services/opbeans-java/transactions/charts/latency?*').as(
'transactionLatencyRequest'
);
Expand All @@ -61,7 +60,7 @@ describe.skip('Transaction details', () => {
'@transactionThroughputRequest',
'@transactionFailureRateRequest',
],
{ timeout: 60000 }
{ timeout: 30000 }
).spread((latencyInterception, throughputInterception, failureRateInterception) => {
expect(latencyInterception.request.query.transactionName).to.be.eql('GET /api/product');

Expand Down Expand Up @@ -107,16 +106,15 @@ describe.skip('Transaction details', () => {
);
cy.contains('Create SLO');
});
// skipping this as it´s been failing a lot lately, more information here https://github.com/elastic/kibana/issues/197386
it.skip('shows top errors table', () => {
it('shows top errors table', () => {
cy.visitKibana(
`/app/apm/services/opbeans-java/transactions/view?${new URLSearchParams({
...timeRange,
transactionName: 'GET /api/product',
})}`
);

cy.contains('Top 5 errors');
cy.contains('Top 5 errors', { timeout: 30000 });
cy.getByTestSubj('topErrorsForTransactionTable').contains('a', '[MockError] Foo').click();
cy.url().should('include', 'opbeans-java/errors');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,10 @@ export class SyntheticsPrivateLocation {
return await this.server.fleet.packagePolicyService.bulkCreate(
soClient,
esClient,
newPolicies
newPolicies,
{
asyncDeploy: true,
}
);
}
}
Expand All @@ -384,6 +387,7 @@ export class SyntheticsPrivateLocation {
policiesToUpdate,
{
force: true,
asyncDeploy: true,
}
);
return failedPolicies;
Expand All @@ -401,6 +405,7 @@ export class SyntheticsPrivateLocation {
policyIdsToDelete,
{
force: true,
asyncDeploy: true,
}
);
} catch (e) {
Expand Down Expand Up @@ -430,6 +435,7 @@ export class SyntheticsPrivateLocation {
policyIdsToDelete,
{
force: true,
asyncDeploy: true,
}
);
const failedPolicies = result?.filter((policy) => {
Expand Down
10 changes: 2 additions & 8 deletions x-pack/test/functional/apps/spaces/spaces_selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function spaceSelectorFunctionalTests({
'spaceSelector',
]);
const spacesService = getService('spaces');
const sampleData = getService('sampleData');

describe('Spaces', function () {
const testSpacesIds = ['another-space', ...Array.from('123456789', (idx) => `space-${idx}`)];
Expand Down Expand Up @@ -158,14 +159,7 @@ export default function spaceSelectorFunctionalTests({
});

after(async () => {
// No need to remove the same sample data in both spaces, the index
// data will be removed in the first call. By feature limitation,
// the created saved objects in the second space will be broken but removed
// when we call esArchiver.unload('x-pack/test/functional/es_archives/spaces').
await PageObjects.common.navigateToApp('home', {
hash: sampleDataHash,
});
await PageObjects.home.removeSampleDataSet('logs');
await sampleData.testResources.removeKibanaSampleData('logs');
await PageObjects.security.forceLogout();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function SearchSessionsPageProvider({ getService, getPageObjects }: FtrPr
id: ((await row.getAttribute('data-test-search-session-id')) ?? '').split('id-')[1],
name: $.findTestSubject('sessionManagementNameCol').text().trim(),
status: $.findTestSubject('sessionManagementStatusLabel').attr('data-test-status'),
mainUrl: $.findTestSubject('sessionManagementNameCol').text(),
mainUrl: $.findTestSubject('sessionManagementNameCol').attr('href'),
created: $.findTestSubject('sessionManagementCreatedCol').text(),
expires: $.findTestSubject('sessionManagementExpiresCol').text(),
searchesCount: Number($.findTestSubject('sessionManagementNumSearchesCol').text()),
Expand Down
Loading

0 comments on commit 5a728a0

Please sign in to comment.