mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `8.10`: - [[Observability AI Assistant] Use POST for get_apm_services_list (#165621)](https://github.com/elastic/kibana/pull/165621) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Coen Warmer","email":"coen.warmer@gmail.com"},"sourceCommit":{"committedDate":"2023-09-04T18:18:58Z","message":"[Observability AI Assistant] Use POST for get_apm_services_list (#165621)\n\nCo-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>","sha":"300e2985c18498e35b2b82cd88c86459471beed3","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:APM","release_note:skip","backport:prev-minor","v8.10.0","v8.11.0"],"number":165621,"url":"https://github.com/elastic/kibana/pull/165621","mergeCommit":{"message":"[Observability AI Assistant] Use POST for get_apm_services_list (#165621)\n\nCo-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>","sha":"300e2985c18498e35b2b82cd88c86459471beed3"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165621","number":165621,"mergeCommit":{"message":"[Observability AI Assistant] Use POST for get_apm_services_list (#165621)\n\nCo-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>","sha":"300e2985c18498e35b2b82cd88c86459471beed3"}}]}] BACKPORT--> Co-authored-by: Coen Warmer <coen.warmer@gmail.com>
This commit is contained in:
parent
310c5f1a5b
commit
913dd8bc66
3 changed files with 14 additions and 15 deletions
|
@ -66,10 +66,10 @@ export function registerGetApmServicesListFunction({
|
|||
} as const,
|
||||
},
|
||||
async ({ arguments: args }, signal) => {
|
||||
return callApmApi('GET /internal/apm/assistant/get_services_list', {
|
||||
return callApmApi('POST /internal/apm/assistant/get_services_list', {
|
||||
signal,
|
||||
params: {
|
||||
query: args,
|
||||
body: args,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ import { getApmEventClient } from '../../lib/helpers/get_apm_event_client';
|
|||
import { getMlClient } from '../../lib/helpers/get_ml_client';
|
||||
import { getRandomSampler } from '../../lib/helpers/get_random_sampler';
|
||||
import { createApmServerRoute } from '../apm_routes/create_apm_server_route';
|
||||
import { environmentRt } from '../default_api_types';
|
||||
import { getServicesItems } from '../services/get_services/get_services_items';
|
||||
import {
|
||||
CorrelationValue,
|
||||
|
@ -26,20 +25,20 @@ import {
|
|||
getApmCorrelationValues,
|
||||
} from './get_apm_correlation_values';
|
||||
import {
|
||||
type APMDownstreamDependency,
|
||||
downstreamDependenciesRouteRt,
|
||||
getAssistantDownstreamDependencies,
|
||||
type APMDownstreamDependency,
|
||||
} from './get_apm_downstream_dependencies';
|
||||
import { errorRouteRt, getApmErrorDocument } from './get_apm_error_document';
|
||||
import {
|
||||
getApmServiceSummary,
|
||||
type ServiceSummary,
|
||||
serviceSummaryRouteRt,
|
||||
type ServiceSummary,
|
||||
} from './get_apm_service_summary';
|
||||
import {
|
||||
type ApmTimeseries,
|
||||
getApmTimeseries,
|
||||
getApmTimeseriesRt,
|
||||
type ApmTimeseries,
|
||||
} from './get_apm_timeseries';
|
||||
|
||||
const getApmTimeSeriesRoute = createApmServerRoute({
|
||||
|
@ -204,15 +203,15 @@ interface ApmServicesListItem {
|
|||
type ApmServicesListContent = ApmServicesListItem[];
|
||||
|
||||
const getApmServicesListRoute = createApmServerRoute({
|
||||
endpoint: 'GET /internal/apm/assistant/get_services_list',
|
||||
endpoint: 'POST /internal/apm/assistant/get_services_list',
|
||||
params: t.type({
|
||||
query: t.intersection([
|
||||
body: t.intersection([
|
||||
t.type({
|
||||
start: t.string,
|
||||
end: t.string,
|
||||
}),
|
||||
t.partial({
|
||||
'service.environment': environmentRt.props.environment,
|
||||
'service.environment': t.string,
|
||||
healthStatus: t.array(
|
||||
t.union([
|
||||
t.literal(ServiceHealthStatus.unknown),
|
||||
|
@ -229,9 +228,9 @@ const getApmServicesListRoute = createApmServerRoute({
|
|||
},
|
||||
handler: async (resources): Promise<{ content: ApmServicesListContent }> => {
|
||||
const { params } = resources;
|
||||
const { query } = params;
|
||||
const { body } = params;
|
||||
|
||||
const { healthStatus } = query;
|
||||
const { healthStatus } = body;
|
||||
|
||||
const [apmEventClient, apmAlertsClient, mlClient, randomSampler] =
|
||||
await Promise.all([
|
||||
|
@ -245,8 +244,8 @@ const getApmServicesListRoute = createApmServerRoute({
|
|||
}),
|
||||
]);
|
||||
|
||||
const start = datemath.parse(query.start)?.valueOf()!;
|
||||
const end = datemath.parse(query.end)?.valueOf()!;
|
||||
const start = datemath.parse(body.start)?.valueOf()!;
|
||||
const end = datemath.parse(body.end)?.valueOf()!;
|
||||
|
||||
const serviceItems = await getServicesItems({
|
||||
apmAlertsClient,
|
||||
|
@ -254,7 +253,7 @@ const getApmServicesListRoute = createApmServerRoute({
|
|||
documentType: ApmDocumentType.TransactionMetric,
|
||||
start,
|
||||
end,
|
||||
environment: query['service.environment'] ?? ENVIRONMENT_ALL.value,
|
||||
environment: body['service.environment'] || ENVIRONMENT_ALL.value,
|
||||
kuery: '',
|
||||
logger: resources.logger,
|
||||
randomSampler,
|
||||
|
|
|
@ -56,7 +56,7 @@ export async function registerFunctions({
|
|||
);
|
||||
|
||||
if (isReady) {
|
||||
description += `You can use the "summarize" functions to store new information you have learned in a knowledge database. Once you have established that you did not know the answer to a question, and the user gave you this information, it's important that you create a summarisation of what you have learned and store it in the knowledge database.
|
||||
description += `You can use the "summarize" functions to store new information you have learned in a knowledge database. Once you have established that you did not know the answer to a question, and the user gave you this information, it's important that you create a summarisation of what you have learned and store it in the knowledge database. Don't create a new summarization if you see a similar summarization in the conversation, instead, update the existing one by re-using its ID.
|
||||
|
||||
Additionally, you can use the "recall" function to retrieve relevant information from the knowledge database.
|
||||
`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue