diff --git a/x-pack/platform/plugins/private/translations/translations/de-DE.json b/x-pack/platform/plugins/private/translations/translations/de-DE.json index 7daddff3bac7e..edb00f6add63e 100644 --- a/x-pack/platform/plugins/private/translations/translations/de-DE.json +++ b/x-pack/platform/plugins/private/translations/translations/de-DE.json @@ -12138,13 +12138,8 @@ "xpack.apm.tooltip.maxGroup.message": "Die Kardinalität der erfassten APM-Daten ist zu hoch. Bitte überprüfen Sie {apmServerDocs}, um die Situation zu entschärfen.", "xpack.apm.trace.barDetails.euiIconTip.orphanSpanContentLabel": "Dieser Span ist aufgrund fehlenden Trace-Kontexts verwaist und wurde dem Stamm-Span neu zugeordnet, um den Ausführungsablauf wiederherzustellen", "xpack.apm.trace.barDetails.euiIconTip.orphanTitleLabel": "Orphan", - "xpack.apm.traceExplorer.appName": "APM", "xpack.apm.traceItemRow.openDetailsButton": "Details für {name} anzeigen", "xpack.apm.traceLink.fetchingTraceLabel": "Trace wird abgerufen ...", - "xpack.apm.traceSearchBox.queryLanguageSelectAriaLabel": "Abfragesprache", - "xpack.apm.traceSearchBox.refreshButton": "Suchen", - "xpack.apm.traceSearchBox.traceSearchTypeEql": "EQL", - "xpack.apm.traceSearchBox.traceSearchTypeKql": "KQL", "xpack.apm.tracesTable.avgResponseTimeColumnLabel": "Latenz (Durchschnitt)", "xpack.apm.tracesTable.impactColumnDescription": "Die am häufigsten genutzten und langsamsten Endpoints in Ihrem Service. Berechnet durch Multiplikation der Latenz mit dem Durchsatz.", "xpack.apm.tracesTable.impactColumnLabel": "Auswirkungen", @@ -35849,7 +35844,6 @@ "xpack.securitySolution.assistant.commentActions.addToCaseExistingCase": "Zu einem bestehenden Fall hinzufügen", "xpack.securitySolution.assistant.commentActions.copyToClipboard": "In die Zwischenablage kopieren", "xpack.securitySolution.assistant.commentActions.elasticAiAssistantTitle": "Elastic AI Assistant", - "xpack.securitySolution.assistant.commentActions.viewAPMTraceLabel": "APM-Trace für diese Nachricht anzeigen", "xpack.securitySolution.assistant.content.promptContexts.indexTitle": "Index", "xpack.securitySolution.assistant.content.promptContexts.viewTitle": "anzeigen", "xpack.securitySolution.assistant.content.prompts.investigationGuide": "Bewerten Sie das oben beschriebene Sicherheitsereignis und stellen Sie eine strukturierte, markdown-formatierte Zusammenfassung bereit, die für die Aufnahme in ein Elastic Security-Ticket geeignet ist. Stellen Sie sicher, dass Sie alle verfügbaren Tools verwenden. Ihre Reaktion muss Folgendes enthalten: 1. Ereignisbeschreibung - Fassen Sie das Ereignis zusammen, einschließlich der Risikobewertungen von Nutzer und Host aus dem bereitgestellten Kontext. - Referenzieren Sie relevante MITRE ATT&CK-Techniken, mit Hyperlinks zu den offiziellen MITRE-Seiten. 2. Triage-Schritte - Listen Sie klare, stichpunktartige Triage-Schritte auf, die auf die Workflows von Elastic Security zugeschnitten sind (z. B. Untersuchung von Warnmeldungen, Erstellung einer Zeitleiste, Überprüfung der Entitätsanalysen). - Heben Sie relevante Erkennungsregeln oder Anomaliebefunde hervor. 3. Empfohlene Maßnahmen - Stellen Sie priorisierte Reaktionsmaßnahmen bereit, einschließlich: - Elastic Defend Endpoint-Reaktionsmaßnahmen (z. B. Host isolieren, Prozess beenden, Datei abrufen/löschen), mit Links zur Elastic-Dokumentation. - Beispielhafte ES|QL-Abfragen zur weiteren Untersuchung, formatiert als Codeblöcke. - Beispielhafte OSQuery Manager-Abfragen zur weiteren Untersuchung, formatiert als Codeblöcke. - Leitlinien zur Verwendung von Timelines und Entity Analytics für tiefgehende Kontexte, mit Dokumentationslinks. 4. MITRE ATT&CK®-Kontext – Fassen Sie die zugeordneten MITRE ATT&CK®-Techniken zusammen und geben Sie auf Basis der MITRE-Richtlinien konkrete Handlungsempfehlungen mit Hyperlinks. 5. Dokumentationslinks – Fügen Sie direkte Links zu allen referenzierten Elastic Security-Dokumentationen und MITRE ATT&CK®-Seiten hinzu. Formatierungsanforderungen: - Verwenden Sie Markdown-Überschriften, Tabellen und Codeblöcke zur besseren Übersicht. - Organisieren Sie die Reaktion in visuell unterscheidbare Abschnitte. - Verwenden Sie eine präzise, umsetzbare Sprache. - Fügen Sie relevante Emojis in die Abschnittsüberschriften für visuelle Klarheit ein (z.B. 📝, 🛡️, 🔍, 📚).", diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index c28716ff6462b..1e37d31f8a469 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -12143,13 +12143,8 @@ "xpack.apm.tooltip.maxGroup.message": "La cardinalité des données APM collectées est trop élevée. Veuillez consulter {apmServerDocs} pour atténuer la situation.", "xpack.apm.trace.barDetails.euiIconTip.orphanSpanContentLabel": "Cet intervalle est orphelin en raison d'un contexte de trace manquant et a été réattribué à la racine pour restaurer le flux d'exécution", "xpack.apm.trace.barDetails.euiIconTip.orphanTitleLabel": "Orphelin", - "xpack.apm.traceExplorer.appName": "APM", "xpack.apm.traceItemRow.openDetailsButton": "Voir les détails pour {name}", "xpack.apm.traceLink.fetchingTraceLabel": "Récupération des traces...", - "xpack.apm.traceSearchBox.queryLanguageSelectAriaLabel": "Langage de requête", - "xpack.apm.traceSearchBox.refreshButton": "Recherche", - "xpack.apm.traceSearchBox.traceSearchTypeEql": "EQL", - "xpack.apm.traceSearchBox.traceSearchTypeKql": "KQL", "xpack.apm.tracesTable.avgResponseTimeColumnLabel": "Latence (moy.)", "xpack.apm.tracesTable.impactColumnDescription": "Points de terminaison les plus utilisés et les plus lents de votre service. Calculé en multipliant la latence par le rendement.", "xpack.apm.tracesTable.impactColumnLabel": "Impact", @@ -35868,7 +35863,6 @@ "xpack.securitySolution.assistant.commentActions.addToCaseExistingCase": "Ajouter à un cas existant", "xpack.securitySolution.assistant.commentActions.copyToClipboard": "Copier dans le presse-papiers", "xpack.securitySolution.assistant.commentActions.elasticAiAssistantTitle": "Assistant d'IA d'Elastic", - "xpack.securitySolution.assistant.commentActions.viewAPMTraceLabel": "Voir la trace APM pour ce message", "xpack.securitySolution.assistant.content.promptContexts.indexTitle": "index", "xpack.securitySolution.assistant.content.promptContexts.viewTitle": "Afficher", "xpack.securitySolution.assistant.content.prompts.investigationGuide": "Évaluez l'événement de sécurité décrit ci-dessus et fournissez un résumé structuré au format Markdown, susceptible d'être inclus dans un cas Elastic Security. Assurez-vous d'utiliser tous les outils à votre disposition. Votre réponse doit inclure : 1. Description de l'événement : résumez l'événement, y compris les scores de risque des utilisateurs et des hôtes à partir du contexte fourni. Référencez les techniques MITRE ATT&CK® pertinentes, avec des hyperliens vers les pages officielles de MITRE. 2. Étapes de tri : énumérez des étapes de tri claires et à puces adaptées aux workflows d'Elastic Security (par exemple, enquête sur les alertes, création d'une chronologie, examen des analyses d'entités). Mettez en évidence les règles de détection pertinentes ou les anomalies constatées. 3. Actions recommandées : fournissez des actions de réponse classées par ordre de priorité, notamment : - Des actions de réponse pour les points de terminaison Elastic Defend (par exemple, isoler l'hôte, arrêter le processus, récupérer ou supprimer le fichier), avec des liens vers la documentation Elastic. - Des exemples de requêtes ES|QL pour une analyse plus approfondie, formatées sous forme de blocs de code. - Des exemples de requêtes Osquery Manager pour une analyse plus approfondie, formatées sous forme de blocs de code. - Des conseils sur l'utilisation des chronologies et des analyses d'entités pour un contexte plus détaillé, avec des liens vers la documentation. 4. Contexte MITRE ATT&CK® : résumez les techniques MITRE ATT&CK® mappées et fournissez des recommandations concrètes basées sur les directives MITRE, avec des hyperliens. 5. Liens vers la documentation : incluez des liens directs vers toute la documentation Elastic Security référencée et les pages MITRE ATT&CK®. Exigences de formatage : - Utilisez des en-têtes, des tableaux et des blocs de code Markdown pour plus de clarté. - Organisez la réponse en sections visuellement distinctes. - Utilisez un langage concis et concret. - Incluez des emojis pertinents dans les en-têtes de section pour plus de clarté visuelle (par exemple, 📝, 🛡️, 🔍, 📚).", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index 473af827f524e..1b95dbf677422 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -12181,13 +12181,8 @@ "xpack.apm.tooltip.maxGroup.message": "収集されているAPMデータのカーディナリティが高すぎます。この状況を軽減するには、{apmServerDocs}を確認してください。", "xpack.apm.trace.barDetails.euiIconTip.orphanSpanContentLabel": "このスパンはトレースコンテキストが欠落しているためオーファンになっており、実行フローを復元するためにルートに再関連付けされました。", "xpack.apm.trace.barDetails.euiIconTip.orphanTitleLabel": "オーファン", - "xpack.apm.traceExplorer.appName": "APM", "xpack.apm.traceItemRow.openDetailsButton": "{name}の詳細を表示", "xpack.apm.traceLink.fetchingTraceLabel": "トレースを取得中...", - "xpack.apm.traceSearchBox.queryLanguageSelectAriaLabel": "クエリ言語", - "xpack.apm.traceSearchBox.refreshButton": "検索", - "xpack.apm.traceSearchBox.traceSearchTypeEql": "EQL", - "xpack.apm.traceSearchBox.traceSearchTypeKql": "KQL", "xpack.apm.tracesTable.avgResponseTimeColumnLabel": "レイテンシ(平均)", "xpack.apm.tracesTable.impactColumnDescription": "ご利用のサービスで最も頻繁に使用されていて、最も遅いエンドポイントです。レイテンシをスループットで乗算して計算されました。", "xpack.apm.tracesTable.impactColumnLabel": "インパクト", @@ -35974,7 +35969,6 @@ "xpack.securitySolution.assistant.commentActions.addToCaseExistingCase": "既存のケースに追加", "xpack.securitySolution.assistant.commentActions.copyToClipboard": "クリップボードにコピー", "xpack.securitySolution.assistant.commentActions.elasticAiAssistantTitle": "Elastic AI Assistant", - "xpack.securitySolution.assistant.commentActions.viewAPMTraceLabel": "このメッセージのAPMトレースを表示", "xpack.securitySolution.assistant.content.promptContexts.indexTitle": "インデックス", "xpack.securitySolution.assistant.content.promptContexts.viewTitle": "表示", "xpack.securitySolution.assistant.content.prompts.investigationGuide": "上記のセキュリティイベントを評価し、Elastic Securityケースに含めるのに適した、構造化されたマークダウン形式のサマリーを提供してください。必ず利用可能なすべてのツールを使用してください。応答には次の内容を含める必要があります。1. イベントの説明 - 提供されたコンテキストからのユーザーおよびホストのリスクスコアを含む、イベントの概要を説明します。-MITREのオフィシャルページへのハイパーリンクを付けて、関連するMITRE ATT&CK®テクニックを参照してください。2. トリアージ手順 - Elastic Securityワークフローに合わせて調整された、明確で箇条書きのトリアージ手順をリストしてください(アラート調査、タイムラインの作成、エンティティ分析のレビューなど)。- 関連する検出ルールまたは異常の検出を強調表示します。3。推奨アクション-以下を含む優先的な対応アクションを提供してください。- Elastic Defendエンドポイントのレスポンスアクション(ホストの隔離、プロセスの強制終了、ファイルの取得/削除など)を、Elasticドキュメントへのリンクとともに提供してください。- さらなる調査のためのコードブロックとしてフォーマットされたES|QLクエリの例。- さらなる調査のためのコードブロックとしてフォーマットされたOSQuery Managerクエリの例。- TimelinesとEntity Analyticsを使用した、より深いコンテキストに関するガイダンスとドキュメントへのリンク。4. MITRE ATT&CK®コンテキスト - マッピングされたMITRE ATT&CK®テクニックを要約し、MITREのガイダンスに基づく実行可能な推奨事項をハイパーリンク付きで提供してください。5. ドキュメントリンク - 参照されたすべてのElastic SecurityドキュメントとMITRE ATT&CK®ページへの直接リンクを含めます。フォーマット要件:- 明確にするためにマークダウンヘッダー、表、コードブロックを使用してください。- 応答を視覚的に区別できるセクションに整理してください。- 簡潔で実行可能な言葉を使うこと。- 視覚的な明確さのために、セクションの見出しに関連する絵文字を含めてください(例:📝、🛡️、🔍、📚)。", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index b2b8d390e9605..f2aa9c80d7eb6 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -12181,13 +12181,8 @@ "xpack.apm.tooltip.maxGroup.message": "正收集的 APM 数据的基数过高。请复查 {apmServerDocs} 以缓解该情况。", "xpack.apm.trace.barDetails.euiIconTip.orphanSpanContentLabel": "由于缺少跟踪上下文,此跨度处于孤立状态,已被重新挂接到根节点以还原执行流", "xpack.apm.trace.barDetails.euiIconTip.orphanTitleLabel": "孤立", - "xpack.apm.traceExplorer.appName": "APM", "xpack.apm.traceItemRow.openDetailsButton": "查看 {name} 详情", "xpack.apm.traceLink.fetchingTraceLabel": "正在提取追溯信息......", - "xpack.apm.traceSearchBox.queryLanguageSelectAriaLabel": "查询语言", - "xpack.apm.traceSearchBox.refreshButton": "搜索", - "xpack.apm.traceSearchBox.traceSearchTypeEql": "EQL", - "xpack.apm.traceSearchBox.traceSearchTypeKql": "KQL", "xpack.apm.tracesTable.avgResponseTimeColumnLabel": "延迟(平均值)", "xpack.apm.tracesTable.impactColumnDescription": "服务中最常用的和响应最慢的终端节点。已通过延迟和吞吐量相乘进行计算。", "xpack.apm.tracesTable.impactColumnLabel": "影响", @@ -35974,7 +35969,6 @@ "xpack.securitySolution.assistant.commentActions.addToCaseExistingCase": "添加到现有案例", "xpack.securitySolution.assistant.commentActions.copyToClipboard": "复制到剪贴板", "xpack.securitySolution.assistant.commentActions.elasticAiAssistantTitle": "Elastic AI 助手", - "xpack.securitySolution.assistant.commentActions.viewAPMTraceLabel": "查看此消息的 APM 跟踪", "xpack.securitySolution.assistant.content.promptContexts.indexTitle": "索引", "xpack.securitySolution.assistant.content.promptContexts.viewTitle": "视图", "xpack.securitySolution.assistant.content.prompts.investigationGuide": "评估上述安全事件,并提供结构化、按 markdown 格式的摘要,适合纳入 Elastic Security 案例。确保有效利用所有可用工具。您的响应必须包括:1. 事件描述 — 根据提供的上下文概述事件,包括用户和主机风险评分。- 参考相关的 MITRE ATT&CK® 技术,并提供指向官方 MITRE 页面的超链接。2. 分类步骤 — 列出清晰的项目符号式分类步骤,这些步骤需针对 Elastic Security 工作流量身定制(例如:告警调查、时间线创建、实体分析审查)。— 突出显示任何相关的检测规则或异常发现。3. 推荐操作 — 提供按优先级排序的响应操作,包括:Elastic Defend 终端响应操作(例如,隔离主机、终止进程、检索/删除文件),并附上 Elastic 文档链接。— 用于进一步调查的示例 ES|QL 查询,采用代码块格式展示。— 示例 OSQuery Manager 查询,以代码块形式提供,供进一步研究。— 关于使用时间线和实体分析以获取更深层次上下文的指南,包含文档链接。4. MITRE ATT&CK® 背景 — 总结映射的 MITRE ATT&CK® 技术,并根据 MITRE 指南提供可行的建议,包含超链接。5. 文档链接 — 包含所有引用的 Elastic Security 文档和 MITRE ATT&CK® 页面的直接链接。格式要求:— 为了清晰起见,请使用 Markdown 标题、表格和代码块。— 将响应组织成视觉上不同的部分。— 使用简洁、可执行的语言。— 在章节标题中加入相关的表情符号以提高视觉清晰度(例如:📝、🛡️、🔍、📚)。", diff --git a/x-pack/solutions/observability/plugins/apm/common/trace_explorer.ts b/x-pack/solutions/observability/plugins/apm/common/trace_explorer.ts deleted file mode 100644 index 9ce3bc8df0bd6..0000000000000 --- a/x-pack/solutions/observability/plugins/apm/common/trace_explorer.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export interface TraceSearchQuery { - query: string; - type: TraceSearchType; -} - -export enum TraceSearchType { - kql = 'kql', - eql = 'eql', -} diff --git a/x-pack/solutions/observability/plugins/apm/ftr_e2e/cypress/e2e/trace_explorer/trace_explorer.cy.ts b/x-pack/solutions/observability/plugins/apm/ftr_e2e/cypress/e2e/trace_explorer/trace_explorer.cy.ts deleted file mode 100644 index 5b76a910a1719..0000000000000 --- a/x-pack/solutions/observability/plugins/apm/ftr_e2e/cypress/e2e/trace_explorer/trace_explorer.cy.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import url from 'url'; -import { synthtrace } from '../../../synthtrace'; -import { opbeans } from '../../fixtures/synthtrace/opbeans'; - -const start = '2021-10-10T00:00:00.000Z'; -const end = '2021-10-10T00:15:00.000Z'; - -const traceExplorerHref = url.format({ - pathname: '/app/apm/traces/explorer', - query: { - environment: 'ENVIRONMENT_ALL', - rangeFrom: start, - rangeTo: end, - }, -}); - -describe('Trace Explorer', () => { - before(() => { - synthtrace.index( - opbeans({ - from: new Date(start).getTime(), - to: new Date(end).getTime(), - }) - ); - }); - - after(() => { - synthtrace.clean(); - }); - - beforeEach(() => { - cy.loginAsViewerUser(); - }); - - it('opens the action menu popup when clicking the investigate button', () => { - cy.visitKibana(traceExplorerHref); - cy.getByTestSubj('apmActionMenuButtonInvestigateButton').click(); - cy.getByTestSubj('apmActionMenuInvestigateButtonPopup'); - }); -}); diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/trace_explorer/index.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/trace_explorer/index.tsx deleted file mode 100644 index a8a2bfedc69ac..0000000000000 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/trace_explorer/index.tsx +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import React, { useEffect, useMemo, useState } from 'react'; -import { useHistory } from 'react-router-dom'; -import type { TraceSearchQuery } from '../../../../common/trace_explorer'; -import { TraceSearchType } from '../../../../common/trace_explorer'; -import { useApmParams } from '../../../hooks/use_apm_params'; -import { useTimeRange } from '../../../hooks/use_time_range'; -import { TraceExplorerSamplesFetcherContextProvider } from '../../../hooks/use_trace_explorer_samples'; -import type { APIClientRequestParamsOf } from '../../../services/rest/create_call_apm_api'; -import { ApmDatePicker } from '../../shared/date_picker/apm_date_picker'; -import { push } from '../../shared/links/url_helpers'; -import { TraceSearchBox } from './trace_search_box'; - -export function TraceExplorer({ children }: { children: React.ReactElement }) { - const [searchQuery, setSearchQuery] = useState({ - query: '', - type: TraceSearchType.kql, - }); - - const { - query: { rangeFrom, rangeTo, environment, query: queryFromUrlParams, type: typeFromUrlParams }, - } = useApmParams('/traces/explorer'); - - const history = useHistory(); - - useEffect(() => { - setSearchQuery({ - query: queryFromUrlParams, - type: typeFromUrlParams, - }); - }, [queryFromUrlParams, typeFromUrlParams]); - - const { start, end } = useTimeRange({ - rangeFrom, - rangeTo, - }); - - const params = useMemo< - APIClientRequestParamsOf<'GET /internal/apm/traces/find'>['params'] - >(() => { - return { - query: { - start, - end, - environment, - query: queryFromUrlParams, - type: typeFromUrlParams, - }, - }; - }, [start, end, environment, queryFromUrlParams, typeFromUrlParams]); - - return ( - - - - - - { - push(history, { - query: { - query: searchQuery.query, - type: searchQuery.type, - }, - }); - }} - onQueryChange={(nextQuery) => { - setSearchQuery(nextQuery); - }} - /> - - - - - - - {children} - - - ); -} diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/trace_explorer/trace_explorer_waterfall.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/trace_explorer/trace_explorer_waterfall.tsx deleted file mode 100644 index aef70cd2c8526..0000000000000 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/trace_explorer/trace_explorer_waterfall.tsx +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { FETCH_STATUS } from '@kbn/observability-shared-plugin/public'; -import React, { useCallback, useEffect } from 'react'; -import { useHistory } from 'react-router-dom'; -import { usePerformanceContext } from '@kbn/ebt-tools'; -import { useApmParams } from '../../../hooks/use_apm_params'; -import { useTimeRange } from '../../../hooks/use_time_range'; -import { useTraceExplorerSamples } from '../../../hooks/use_trace_explorer_samples'; -import { ResettingHeightRetainer } from '../../shared/height_retainer/resetting_height_container'; -import { push, replace } from '../../shared/links/url_helpers'; -import { useWaterfallFetcher } from '../transaction_details/use_waterfall_fetcher'; -import { useUnifiedWaterfallFetcher } from '../transaction_details/use_unified_waterfall_fetcher'; -import { WaterfallWithSummary } from '../transaction_details/waterfall_with_summary'; -import type { TransactionTab } from '../transaction_details/waterfall_with_summary/transaction_tabs'; -import { isPending } from '../../../hooks/use_fetcher'; - -export function TraceExplorerWaterfall() { - const history = useHistory(); - const { onPageReady } = usePerformanceContext(); - const traceSamplesFetchResult = useTraceExplorerSamples(); - - const { - query: { - traceId, - transactionId, - waterfallItemId, - rangeFrom, - rangeTo, - environment, - showCriticalPath, - detailTab, - }, - } = useApmParams('/traces/explorer/waterfall'); - - const { start, end } = useTimeRange({ rangeFrom, rangeTo }); - - useEffect(() => { - const nextSample = traceSamplesFetchResult.data?.traceSamples[0]; - const nextWaterfallItemId = ''; - replace(history, { - query: { - traceId: nextSample?.traceId ?? '', - transactionId: nextSample?.transactionId ?? '', - waterfallItemId: nextWaterfallItemId, - }, - }); - }, [traceSamplesFetchResult.data, history]); - - const waterfallFetchResult = useWaterfallFetcher({ - traceId, - transactionId, - start, - end, - }); - - const unifiedWaterfallFetchResult = useUnifiedWaterfallFetcher({ - start, - end, - traceId, - entryTransactionId: transactionId, - }); - - const serviceName = waterfallFetchResult.useUnified - ? unifiedWaterfallFetchResult.entryTransaction?.service.name - : waterfallFetchResult.waterfall.entryWaterfallTransaction?.doc.service.name; - - const activeStatus = waterfallFetchResult.useUnified - ? unifiedWaterfallFetchResult.status - : waterfallFetchResult.status; - - const traceDocsTotal = waterfallFetchResult.useUnified - ? unifiedWaterfallFetchResult.traceItems.length - : waterfallFetchResult.waterfall.traceDocsTotal; - - useEffect(() => { - if (activeStatus === FETCH_STATUS.SUCCESS) { - onPageReady({ - meta: { - rangeFrom, - rangeTo, - }, - customMetrics: { - key1: 'traceDocsTotal', - value1: traceDocsTotal, - }, - }); - } - }, [activeStatus, traceDocsTotal, onPageReady, rangeFrom, rangeTo]); - - const onSampleClick = useCallback( - (sample: any) => { - push(history, { - query: { - traceId: sample.traceId, - transactionId: sample.transactionId, - waterfallItemId: '', - }, - }); - }, - [history] - ); - - const onTabClick = useCallback( - (nextDetailTab: TransactionTab) => { - push(history, { - query: { - detailTab: nextDetailTab, - }, - }); - }, - [history] - ); - - const onShowCriticalPathChange = useCallback( - (nextShowCriticalPath: boolean) => { - push(history, { - query: { - showCriticalPath: nextShowCriticalPath ? 'true' : 'false', - }, - }); - }, - [history] - ); - - const isWaterfallLoading = waterfallFetchResult.useUnified - ? isPending(unifiedWaterfallFetchResult.status) && !unifiedWaterfallFetchResult.entryTransaction - : isPending(waterfallFetchResult.status) && - !waterfallFetchResult.waterfall.entryWaterfallTransaction; - - return ( - - - - ); -} diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/trace_explorer/trace_search_box/index.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/trace_explorer/trace_search_box/index.tsx deleted file mode 100644 index d831789f01a53..0000000000000 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/trace_explorer/trace_search_box/index.tsx +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import React from 'react'; -import type { EuiSelectOption } from '@elastic/eui'; -import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import type { TraceSearchQuery } from '../../../../../common/trace_explorer'; -import { TraceSearchType } from '../../../../../common/trace_explorer'; -import { useAdHocApmDataView } from '../../../../hooks/use_adhoc_apm_data_view'; -import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; - -import { EQLCodeEditor } from '../../../shared/monaco_code_editor'; - -interface Props { - query: TraceSearchQuery; - error: boolean; - onQueryChange: (query: TraceSearchQuery) => void; - onQueryCommit: () => void; - loading: boolean; -} - -const options: EuiSelectOption[] = [ - { - value: TraceSearchType.kql, - text: i18n.translate('xpack.apm.traceSearchBox.traceSearchTypeKql', { - defaultMessage: 'KQL', - }), - }, - { - value: TraceSearchType.eql, - text: i18n.translate('xpack.apm.traceSearchBox.traceSearchTypeEql', { - defaultMessage: 'EQL', - }), - }, -]; - -export function TraceSearchBox({ query, onQueryChange, onQueryCommit, loading }: Props) { - const { - kql: { QueryStringInput }, - } = useApmPluginContext(); - - const { dataView } = useAdHocApmDataView(); - - return ( - - - - - - - {query.type === TraceSearchType.eql ? ( - { - onQueryChange({ - ...query, - query: value, - }); - }} - /> - ) : ( -
- { - onQueryCommit(); - }} - disableAutoFocus - submitOnBlur - isClearable - onChange={(e) => { - onQueryChange({ - ...query, - query: String(e.query ?? ''), - }); - }} - appName={i18n.translate('xpack.apm.traceExplorer.appName', { - defaultMessage: 'APM', - })} - /> - - )} -
- - { - onQueryChange({ - query: '', - type: e.target.value as TraceSearchType, - }); - }} - options={options} - aria-label={i18n.translate( - 'xpack.apm.traceSearchBox.queryLanguageSelectAriaLabel', - { - defaultMessage: 'Query language', - } - )} - /> - -
-
- - { - onQueryCommit(); - }} - iconType="magnify" - style={{ width: '100px' }} - > - {i18n.translate('xpack.apm.traceSearchBox.refreshButton', { - defaultMessage: 'Search', - })} - - -
-
-
- ); -} diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx index 488621ec17dd7..ad31a15910eb3 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/maybe_view_trace_link.tsx @@ -63,7 +63,6 @@ export function MaybeViewTraceLink({ } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer', '/dependencies/operation' ); diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/transaction_tabs.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/transaction_tabs.tsx index e164a4dfce510..1c95a9ec3878c 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/transaction_tabs.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/transaction_tabs.tsx @@ -174,7 +174,6 @@ function TimelineTabContent({ } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer/waterfall', '/dependencies/operation' ); const traceId = unifiedWaterfallFetchResult.traceItems[0]?.traceId; diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/flyout_top_level_properties.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/flyout_top_level_properties.tsx index 591f5a45e96f8..df61d45ca43d5 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/flyout_top_level_properties.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/flyout_top_level_properties.tsx @@ -30,7 +30,6 @@ export function FlyoutTopLevelProperties({ transaction }: Props) { const { query } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer', '/dependencies/operation' ); const { link } = useApmRouter(); diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx index f6844dd0b838c..f2c92d658e097 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx @@ -95,7 +95,6 @@ export function Waterfall({ } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer/waterfall', '/dependencies/operation' ); const traceId = waterfall.entryTransaction?.trace.id; diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx index ed83cbd5cbdf6..0715591aa8ee2 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/sticky_span_properties.tsx @@ -38,7 +38,6 @@ export function StickySpanProperties({ span, transaction }: Props) { const { query } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer', '/dependencies/operation' ); const router = useApmRouter(); diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/unified_waterfall_flyout.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/unified_waterfall_flyout.tsx index bab1c7a4b3c37..62a19a7eed976 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/unified_waterfall_flyout.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/unified_waterfall_flyout.tsx @@ -33,7 +33,6 @@ export function UnifiedWaterfallFlyout({ waterfallItemId, traceItems, toggleFlyo } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer/waterfall', '/dependencies/operation' ); diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_flyout.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_flyout.tsx index 6cf8359f59243..2f32ef3e23340 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_flyout.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_flyout.tsx @@ -33,7 +33,6 @@ export function WaterfallFlyout({ waterfallItemId, waterfall, toggleFlyout }: Pr } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer/waterfall', '/dependencies/operation' ); const currentItem = waterfall.items?.find((item) => item.id === waterfallItemId); diff --git a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx index f1d749dd5e796..067bb7dda10aa 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx @@ -437,7 +437,6 @@ function RelatedErrors({ const { query } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer', '/dependencies/operation' ); const { diff --git a/x-pack/solutions/observability/plugins/apm/public/components/routing/home/index.tsx b/x-pack/solutions/observability/plugins/apm/public/components/routing/home/index.tsx index 613be89b28d56..656bc3f1fb320 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/routing/home/index.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/routing/home/index.tsx @@ -14,14 +14,12 @@ import { dynamic } from '@kbn/shared-ux-utility'; import { offsetRt } from '../../../../common/comparison_rt'; import { ENVIRONMENT_ALL } from '../../../../common/environment_filter_values'; import { environmentRt } from '../../../../common/environment_rt'; -import { TraceSearchType } from '../../../../common/trace_explorer'; import { ApmTimeRangeMetadataContextProvider } from '../../../context/time_range_metadata/time_range_metadata_context'; import { RedirectTo } from '../redirect_to'; import { SearchBar } from '../../shared/search_bar/search_bar'; import { dependencies } from './dependencies'; import { legacyBackends } from './legacy_backends'; import { storageExplorer } from './storage_explorer'; -import { TransactionTab } from '../../app/transaction_details/waterfall_with_summary/transaction_tabs'; const ServiceGroupTemplate = dynamic(() => import('../templates/service_group_template').then((mod) => ({ @@ -37,14 +35,6 @@ const ServiceMapHome = dynamic(() => const TopTracesOverview = dynamic(() => import('../../app/top_traces_overview').then((mod) => ({ default: mod.TopTracesOverview })) ); -const TraceExplorer = dynamic(() => - import('../../app/trace_explorer').then((mod) => ({ default: mod.TraceExplorer })) -); -const TraceExplorerWaterfall = dynamic(() => - import('../../app/trace_explorer/trace_explorer_waterfall').then((mod) => ({ - default: mod.TraceExplorerWaterfall, - })) -); const TraceOverview = dynamic(() => import('../../app/trace_overview').then((mod) => ({ default: mod.TraceOverview })) ); @@ -165,60 +155,6 @@ export const homeRoute = { ), children: { - '/traces/explorer': { - element: ( - - - - ), - children: { - '/traces/explorer/waterfall': { - element: , - params: t.type({ - query: t.intersection([ - t.type({ - traceId: t.string, - transactionId: t.string, - waterfallItemId: t.string, - detailTab: t.union([ - t.literal(TransactionTab.timeline), - t.literal(TransactionTab.metadata), - t.literal(TransactionTab.logs), - ]), - }), - t.partial({ - flyoutDetailTab: t.string, - }), - ]), - }), - defaults: { - query: { - waterfallItemId: '', - traceId: '', - transactionId: '', - detailTab: TransactionTab.timeline, - }, - }, - }, - '/traces/explorer': { - element: , - }, - }, - params: t.type({ - query: t.type({ - query: t.string, - type: t.union([t.literal(TraceSearchType.kql), t.literal(TraceSearchType.eql)]), - showCriticalPath: toBooleanRt, - }), - }), - defaults: { - query: { - query: '', - type: TraceSearchType.kql, - showCriticalPath: '', - }, - }, - }, '/traces': { element: , }, diff --git a/x-pack/solutions/observability/plugins/apm/public/components/shared/charts/timeline/marker/error_marker_with_link.tsx b/x-pack/solutions/observability/plugins/apm/public/components/shared/charts/timeline/marker/error_marker_with_link.tsx index fa565bc7e69ef..6f3544719f8e9 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/shared/charts/timeline/marker/error_marker_with_link.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/shared/charts/timeline/marker/error_marker_with_link.tsx @@ -19,7 +19,6 @@ export function ErrorMarkerWithLink({ mark }: { mark: ErrorMark }) { '/mobile-services/{serviceName}/overview', '/mobile-services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/errors-and-crashes', - '/traces/explorer/waterfall', '/dependencies/operation' ); diff --git a/x-pack/solutions/observability/plugins/apm/public/components/shared/span_links/index.tsx b/x-pack/solutions/observability/plugins/apm/public/components/shared/span_links/index.tsx index eb6215150c97a..5cce084a3a8fd 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/shared/span_links/index.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/shared/span_links/index.tsx @@ -33,7 +33,6 @@ export function SpanLinks({ spanLinksCount, traceId, spanId, processorEvent }: P } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer/waterfall', '/dependencies/operation' ); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); diff --git a/x-pack/solutions/observability/plugins/apm/public/components/shared/span_links/span_links_table.tsx b/x-pack/solutions/observability/plugins/apm/public/components/shared/span_links/span_links_table.tsx index fe1e951f95ba6..3250cdc08f8fa 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/shared/span_links/span_links_table.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/shared/span_links/span_links_table.tsx @@ -40,7 +40,6 @@ export function SpanLinksTable({ items }: Props) { } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer/waterfall', '/dependencies/operation' ); const [idActionMenuOpen, setIdActionMenuOpen] = useState(); @@ -120,7 +119,11 @@ export function SpanLinksTable({ items }: Props) { return ( - + { expect(href).toBe('/apm/services/checkout-service/overview'); }); - it('works when called from the /traces/explorer/waterfall route', () => { - mockUseAnyOfApmParams.mockReturnValue({ - query: { - rangeFrom: 'now-1h', - rangeTo: 'now', - environment: 'production', - comparisonEnabled: false, - kuery: '', - serviceGroup: '', - }, - } as any); - - const { result } = renderHook(() => useGetServiceBadgeHrefFromRouter()); - - result.current('trace-service'); - - expect(mockLink).toHaveBeenCalledWith('/services/{serviceName}/overview', { - path: { serviceName: 'trace-service' }, - query: expect.objectContaining({ - rangeFrom: 'now-1h', - rangeTo: 'now', - environment: 'production', - kuery: '', - serviceGroup: '', - }), - }); - }); - it('works when called from the /dependencies/operation route', () => { mockUseAnyOfApmParams.mockReturnValue({ query: { diff --git a/x-pack/solutions/observability/plugins/apm/public/components/shared/trace_waterfall/use_get_service_badge_href_from_router.ts b/x-pack/solutions/observability/plugins/apm/public/components/shared/trace_waterfall/use_get_service_badge_href_from_router.ts index 5cdf8d49fed14..4762044093450 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/shared/trace_waterfall/use_get_service_badge_href_from_router.ts +++ b/x-pack/solutions/observability/plugins/apm/public/components/shared/trace_waterfall/use_get_service_badge_href_from_router.ts @@ -15,8 +15,7 @@ export function useGetServiceBadgeHrefFromRouter(): WaterfallGetServiceBadgeHref const { query } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/dependencies/operation', - '/traces/explorer/waterfall' // TODO remove this url when the trace explorer url and its ftrs tests are removed https://github.com/elastic/kibana/issues/254449 + '/dependencies/operation' ); return useCallback( diff --git a/x-pack/solutions/observability/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.tsx b/x-pack/solutions/observability/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.tsx index 8203c0fef4867..4904e89d7ef4f 100644 --- a/x-pack/solutions/observability/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.tsx +++ b/x-pack/solutions/observability/plugins/apm/public/components/shared/transaction_action_menu/transaction_action_menu.tsx @@ -148,7 +148,6 @@ function ActionMenuSections({ } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', - '/traces/explorer/waterfall', '/dependencies/operation' ); diff --git a/x-pack/solutions/observability/plugins/apm/public/hooks/use_trace_explorer_samples.ts b/x-pack/solutions/observability/plugins/apm/public/hooks/use_trace_explorer_samples.ts deleted file mode 100644 index aa57b04b23b8a..0000000000000 --- a/x-pack/solutions/observability/plugins/apm/public/hooks/use_trace_explorer_samples.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useMemo } from 'react'; -import { createSharedUseFetcher } from './create_shared_use_fetcher'; - -const sharedUseFetcher = createSharedUseFetcher('GET /internal/apm/traces/find'); - -const useTraceExplorerSamples = () => { - const result = sharedUseFetcher.useFetcherResult(); - - return useMemo(() => { - return { - ...result, - data: result.data || { - traceSamples: [], - }, - }; - }, [result]); -}; -const TraceExplorerSamplesFetcherContextProvider = sharedUseFetcher.Provider; - -export { useTraceExplorerSamples, TraceExplorerSamplesFetcherContextProvider }; diff --git a/x-pack/solutions/observability/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts b/x-pack/solutions/observability/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts deleted file mode 100644 index 0c989822b3cae..0000000000000 --- a/x-pack/solutions/observability/plugins/apm/server/routes/traces/get_trace_samples_by_query.ts +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { rangeQuery, kqlQuery, termsQuery } from '@kbn/observability-plugin/server'; -import { ProcessorEvent } from '@kbn/observability-plugin/common'; -import type { Environment } from '../../../common/environment_rt'; -import { TraceSearchType } from '../../../common/trace_explorer'; -import { environmentQuery } from '../../../common/utils/environment_query'; -import { - PARENT_ID, - PROCESSOR_EVENT, - TRACE_ID, - TRANSACTION_ID, - TRANSACTION_SAMPLED, -} from '../../../common/es_fields/apm'; -import { asMutableArray } from '../../../common/utils/as_mutable_array'; -import type { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client'; - -export type TraceSamplesResponse = Array<{ - traceId: string; - transactionId: string; -}>; - -export async function getTraceSamplesByQuery({ - apmEventClient, - start, - end, - environment, - query, - type, -}: { - apmEventClient: APMEventClient; - start: number; - end: number; - environment: Environment; - query: string; - type: TraceSearchType; -}): Promise { - const size = 500; - - let traceIds: string[] = []; - - if (type === TraceSearchType.kql) { - traceIds = - ( - await apmEventClient.search('get_trace_ids_by_kql_query', { - apm: { - events: [ProcessorEvent.transaction, ProcessorEvent.span, ProcessorEvent.error], - }, - track_total_hits: false, - size: 0, - query: { - bool: { - filter: [ - ...rangeQuery(start, end), - ...environmentQuery(environment), - ...kqlQuery(query), - ], - }, - }, - aggs: { - traceId: { - terms: { - field: TRACE_ID, - execution_hint: 'map', - size, - }, - }, - }, - }) - ).aggregations?.traceId.buckets.map((bucket) => bucket.key as string) ?? []; - } else if (type === TraceSearchType.eql) { - traceIds = - ( - await apmEventClient.eqlSearch('get_trace_ids_by_eql_query', { - apm: { - events: [ProcessorEvent.transaction, ProcessorEvent.span, ProcessorEvent.error], - }, - size: 1000, - filter: { - bool: { - filter: [...rangeQuery(start, end), ...environmentQuery(environment)], - }, - }, - event_category_field: PROCESSOR_EVENT, - query, - fields: [TRACE_ID], - }) - ).hits?.sequences?.flatMap((sequence) => - sequence.events.map((event) => (event.fields as { [TRACE_ID]: [string] })[TRACE_ID][0]) - ) ?? []; - } - - if (!traceIds.length) { - return []; - } - - const traceSamplesResponse = await apmEventClient.search('get_trace_samples_by_trace_ids', { - apm: { - events: [ProcessorEvent.transaction], - }, - track_total_hits: false, - size: 0, - query: { - bool: { - filter: [ - { - term: { - [TRANSACTION_SAMPLED]: true, - }, - }, - ...termsQuery(TRACE_ID, ...traceIds), - ...rangeQuery(start, end), - ], - must_not: [{ exists: { field: PARENT_ID } }], - }, - }, - aggs: { - transactionId: { - terms: { - field: TRANSACTION_ID, - size, - }, - aggs: { - latest: { - top_metrics: { - metrics: asMutableArray([{ field: TRACE_ID }] as const), - size: 1, - sort: { - '@timestamp': 'desc' as const, - }, - }, - }, - }, - }, - }, - }); - - return ( - traceSamplesResponse.aggregations?.transactionId.buckets.map((bucket) => ({ - traceId: bucket.latest.top[0].metrics['trace.id'] as string, - transactionId: bucket.key as string, - })) ?? [] - ); -} diff --git a/x-pack/solutions/observability/plugins/apm/server/routes/traces/route.ts b/x-pack/solutions/observability/plugins/apm/server/routes/traces/route.ts index 23653c631cd16..6066f591ceda9 100644 --- a/x-pack/solutions/observability/plugins/apm/server/routes/traces/route.ts +++ b/x-pack/solutions/observability/plugins/apm/server/routes/traces/route.ts @@ -10,7 +10,6 @@ import * as t from 'io-ts'; import type { Error } from '@kbn/apm-types'; import { type ErrorsByTraceId, type UnifiedSpanDocument, type TraceRootSpan } from '@kbn/apm-types'; import type { TraceItem } from '../../../common/waterfall/unified_trace_item'; -import { TraceSearchType } from '../../../common/trace_explorer'; import type { Span } from '../../../typings/es_schemas/ui/span'; import type { Transaction } from '../../../typings/es_schemas/ui/transaction'; import { getApmEventClient } from '../../lib/helpers/get_apm_event_client'; @@ -31,8 +30,6 @@ import type { TopTracesPrimaryStatsResponse } from './get_top_traces_primary_sta import { getTopTracesPrimaryStats } from './get_top_traces_primary_stats'; import type { TraceItems } from './get_trace_items'; import { getTraceItems } from './get_trace_items'; -import type { TraceSamplesResponse } from './get_trace_samples_by_query'; -import { getTraceSamplesByQuery } from './get_trace_samples_by_query'; import { getTraceSummaryCount } from './get_trace_summary_count'; import { getUnifiedTraceItems } from './get_unified_trace_items'; import { getUnifiedTraceErrors } from './get_unified_trace_errors'; @@ -437,41 +434,6 @@ const transactionByNameRoute = createApmServerRoute({ }, }); -const findTracesRoute = createApmServerRoute({ - endpoint: 'GET /internal/apm/traces/find', - params: t.type({ - query: t.intersection([ - rangeRt, - environmentRt, - t.type({ - query: t.string, - type: t.union([t.literal(TraceSearchType.kql), t.literal(TraceSearchType.eql)]), - }), - ]), - }), - security: { authz: { requiredPrivileges: ['apm'] } }, - handler: async ( - resources - ): Promise<{ - traceSamples: TraceSamplesResponse; - }> => { - const { start, end, environment, query, type } = resources.params.query; - - const apmEventClient = await getApmEventClient(resources); - - return { - traceSamples: await getTraceSamplesByQuery({ - apmEventClient, - start, - end, - environment, - query, - type, - }), - }; - }, -}); - const transactionFromTraceByIdRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/traces/{traceId}/transactions/{transactionId}', params: t.type({ @@ -568,7 +530,6 @@ export const traceRouteRepository = { ...rootTransactionByTraceIdRoute, ...rootItemByTraceIdRoute, ...transactionByIdRoute, - ...findTracesRoute, ...transactionFromTraceByIdRoute, ...spanFromTraceByIdRoute, ...transactionByNameRoute, diff --git a/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/find_traces.spec.ts b/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/find_traces.spec.ts deleted file mode 100644 index d8fe5e8f4757e..0000000000000 --- a/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/find_traces.spec.ts +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { apm, timerange } from '@kbn/synthtrace-client'; -import expect from '@kbn/expect'; -import { TraceSearchType } from '@kbn/apm-plugin/common/trace_explorer'; -import type { Environment } from '@kbn/apm-plugin/common/environment_rt'; -import { ENVIRONMENT_ALL } from '@kbn/apm-plugin/common/environment_filter_values'; -import { sortBy } from 'lodash'; -import type { ApmSynthtraceEsClient } from '@kbn/synthtrace'; -import type { ApmApiError } from '../../../services/apm_api'; -import type { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; -import { generateTrace } from './generate_trace'; - -export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { - const apmApiClient = getService('apmApi'); - const synthtrace = getService('synthtrace'); - - const start = new Date('2022-01-01T00:00:00.000Z').getTime(); - const end = new Date('2022-01-01T00:15:00.000Z').getTime() - 1; - - // for EQL sequences to work, events need a slight time offset, - // as ES will sort based on @timestamp. to acommodate this offset - // we also add a little bit of a buffer to the requested time range - const endWithOffset = end + 100000; - - describe('Find traces', () => { - let apmSynthtraceEsClient: ApmSynthtraceEsClient; - - async function fetchTraceSamples({ - query, - type, - environment, - }: { - query: string; - type: TraceSearchType; - environment: Environment; - }) { - return apmApiClient.readUser({ - endpoint: `GET /internal/apm/traces/find`, - params: { - query: { - query, - type, - start: new Date(start).toISOString(), - end: new Date(endWithOffset).toISOString(), - environment, - }, - }, - }); - } - - function fetchTraces(traceSamples: Array<{ traceId: string; transactionId: string }>) { - if (!traceSamples.length) { - return []; - } - - return Promise.all( - traceSamples.map(async ({ traceId, transactionId }) => { - const response = await apmApiClient.readUser({ - endpoint: `GET /internal/apm/traces/{traceId}`, - params: { - path: { traceId }, - query: { - start: new Date(start).toISOString(), - end: new Date(endWithOffset).toISOString(), - entryTransactionId: transactionId, - }, - }, - }); - return response.body.traceItems.traceDocs; - }) - ); - } - - before(async () => { - apmSynthtraceEsClient = await synthtrace.createApmSynthtraceEsClient(); - }); - - after(() => apmSynthtraceEsClient.clean()); - - describe('when traces do not exist', () => { - it('handles empty state', async () => { - const response = await fetchTraceSamples({ - query: '', - type: TraceSearchType.kql, - environment: ENVIRONMENT_ALL.value, - }); - - expect(response.status).to.be(200); - expect(response.body).to.eql({ - traceSamples: [], - }); - }); - }); - - describe('when traces exist', () => { - before(() => { - const java = apm - .service({ name: 'java', environment: 'production', agentName: 'java' }) - .instance('java'); - - const node = apm - .service({ name: 'node', environment: 'development', agentName: 'nodejs' }) - .instance('node'); - - const python = apm - .service({ name: 'python', environment: 'production', agentName: 'python' }) - .instance('python'); - - return apmSynthtraceEsClient.index( - timerange(start, end) - .interval('15m') - .rate(1) - .generator((timestamp) => { - return [ - generateTrace(timestamp, [java, node]), - generateTrace(timestamp, [node, java], 'redis'), - generateTrace(timestamp, [python], 'redis'), - generateTrace(timestamp, [python, node, java], 'elasticsearch'), - generateTrace(timestamp, [java, python, node]), - ]; - }) - ); - }); - - describe('when using KQL', () => { - describe('and the query is empty', () => { - it('returns all trace samples', async () => { - const { - body: { traceSamples }, - } = await fetchTraceSamples({ - query: '', - type: TraceSearchType.kql, - environment: 'ENVIRONMENT_ALL', - }); - - expect(traceSamples.length).to.eql(5); - }); - }); - - describe('and query is set', () => { - it('returns the relevant traces', async () => { - const { - body: { traceSamples }, - } = await fetchTraceSamples({ - query: 'span.destination.service.resource:elasticsearch', - type: TraceSearchType.kql, - environment: 'ENVIRONMENT_ALL', - }); - - expect(traceSamples.length).to.eql(1); - }); - }); - }); - - describe('when using EQL', () => { - describe('and the query is invalid', () => { - it.skip('returns a 400', async function () { - try { - await fetchTraceSamples({ - query: '', - type: TraceSearchType.eql, - environment: 'ENVIRONMENT_ALL', - }); - this.fail(); - } catch (error: unknown) { - const apiError = error as ApmApiError; - expect(apiError.res.status).to.eql(400); - } - }); - }); - - describe('and the query is set', () => { - it('returns the correct trace samples for transaction sequences', async () => { - const { - body: { traceSamples }, - } = await fetchTraceSamples({ - query: `sequence by trace.id - [ transaction where service.name == "java" ] - [ transaction where service.name == "node" ]`, - type: TraceSearchType.eql, - environment: 'ENVIRONMENT_ALL', - }); - - const traces = await fetchTraces(traceSamples); - - expect(traces.length).to.eql(2); - - const mapped = traces.map((traceDocs) => { - return sortBy(traceDocs, '@timestamp') - .filter((doc) => doc.processor.event === 'transaction') - .map((doc) => doc.service.name); - }); - - expect(mapped).to.eql([ - ['java', 'node'], - ['java', 'python', 'node'], - ]); - }); - }); - - it('returns the correct trace samples for join sequences', async () => { - const { - body: { traceSamples }, - } = await fetchTraceSamples({ - query: `sequence by trace.id - [ span where service.name == "java" ] by span.id - [ transaction where service.name == "python" ] by parent.id`, - type: TraceSearchType.eql, - environment: 'ENVIRONMENT_ALL', - }); - - const traces = await fetchTraces(traceSamples); - - expect(traces.length).to.eql(1); - - const mapped = traces.map((traceDocs) => { - return sortBy(traceDocs, '@timestamp') - .filter((doc) => doc.processor.event === 'transaction') - .map((doc) => doc.service.name); - }); - - expect(mapped).to.eql([['java', 'python', 'node']]); - }); - }); - }); - }); -} diff --git a/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/focused_trace.spec.ts b/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/focused_trace.spec.ts index 5b9ba58a69545..6e282c70fd50b 100644 --- a/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/focused_trace.spec.ts +++ b/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/focused_trace.spec.ts @@ -6,9 +6,7 @@ */ import { apm, timerange } from '@kbn/synthtrace-client'; import expect from '@kbn/expect'; -import type { Environment } from '@kbn/apm-plugin/common/environment_rt'; -import { ENVIRONMENT_ALL } from '@kbn/apm-plugin/common/environment_filter_values'; -import { TraceSearchType } from '@kbn/apm-plugin/common/trace_explorer'; +import { Readable } from 'stream'; import type { APIReturnType } from '@kbn/apm-plugin/public/services/rest/create_call_apm_api'; import type { ApmSynthtraceEsClient } from '@kbn/synthtrace'; import type { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; @@ -26,29 +24,6 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon const endWithOffset = end + 100000; describe('traces', () => { - async function fetchTraceSamples({ - query, - type, - environment, - }: { - query: string; - type: TraceSearchType; - environment: Environment; - }) { - return apmApiClient.readUser({ - endpoint: `GET /internal/apm/traces/find`, - params: { - query: { - query, - type, - start: new Date(start).toISOString(), - end: new Date(endWithOffset).toISOString(), - environment, - }, - }, - }); - } - async function fetchFocusedTrace({ traceId, docId, @@ -80,7 +55,10 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon after(() => apmSynthtraceEsClient.clean()); describe('when traces exist', () => { - before(() => { + let entryTraceId: string; + let entryTransactionId: string; + + before(async () => { const java = apm .service({ name: 'java', environment: 'production', agentName: 'java' }) .instance('java'); @@ -93,7 +71,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon .service({ name: 'python', environment: 'production', agentName: 'python' }) .instance('python'); - return apmSynthtraceEsClient.index( + const events = Array.from( timerange(start, end) .interval('15m') .rate(1) @@ -101,24 +79,24 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon generateTrace(timestamp, [python, node, java], 'elasticsearch') ) ); + + const serialized = events.flatMap((event) => event.serialize()); + const rootTransaction = serialized.find( + (doc) => doc['transaction.id'] && !doc['parent.id'] + ); + entryTraceId = rootTransaction!['trace.id']!; + entryTransactionId = rootTransaction!['transaction.id']!; + + await apmSynthtraceEsClient.index(Readable.from(events)); }); describe('focused trace', () => { - let traceId: string; let focusedTrace: FocusedTraceResponseType | undefined; let rootTransactionId: string | undefined; before(async () => { - const response = await fetchTraceSamples({ - query: '', - type: TraceSearchType.kql, - environment: ENVIRONMENT_ALL.value, - }); - - expect(response.status).to.be(200); - traceId = response.body.traceSamples[0].traceId; const focusedTraceResponse = await fetchFocusedTrace({ - traceId, - docId: response.body.traceSamples[0].transactionId, + traceId: entryTraceId, + docId: entryTransactionId, }); expect(focusedTraceResponse?.status).to.be(200); focusedTrace = focusedTraceResponse?.body; @@ -158,7 +136,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon nodeTransactionId = focusedTrace?.traceItems?.focusedTraceTree?.[0]?.children?.[0]?.traceDoc?.id; const focusedTraceResponse = await fetchFocusedTrace({ - traceId, + traceId: entryTraceId, docId: nodeTransactionId, }); expect(focusedTraceResponse?.status).to.be(200); @@ -186,7 +164,7 @@ export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderCon describe('focused item not found', () => { before(async () => { const focusedTraceResponse = await fetchFocusedTrace({ - traceId, + traceId: entryTraceId, docId: 'bar', }); expect(focusedTraceResponse?.status).to.be(200); diff --git a/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/index.ts b/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/index.ts index db209c0345839..2b462dd8e1945 100644 --- a/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/index.ts +++ b/x-pack/solutions/observability/test/api_integration_deployment_agnostic/apis/apm/traces/index.ts @@ -11,7 +11,6 @@ export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) describe('Traces', () => { loadTestFile(require.resolve('./large_trace/large_trace.spec.ts')); loadTestFile(require.resolve('./large_trace/unified_large_trace.spec.ts')); - loadTestFile(require.resolve('./find_traces.spec.ts')); loadTestFile(require.resolve('./span_details.spec.ts')); loadTestFile(require.resolve('./top_traces.spec.ts')); loadTestFile(require.resolve('./trace_by_id.spec.ts')); diff --git a/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/index.test.tsx index 30f9d86bf46aa..86acaaf7a3009 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/index.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/index.test.tsx @@ -13,9 +13,7 @@ import { CommentActions } from '.'; import { updateAndAssociateNode } from '../../timelines/components/notes/helpers'; import { useKibana } from '../../common/lib/kibana'; import { useAssistantAvailability } from '../use_assistant_availability'; -import { useIsExperimentalFeatureEnabled } from '../../common/hooks/use_experimental_features'; -jest.mock('../../common/hooks/use_experimental_features'); jest.mock('../use_assistant_availability'); jest.mock('../../timelines/components/notes/helpers', () => ({ ...jest.requireActual('../../timelines/components/notes/helpers'), @@ -49,7 +47,6 @@ describe('CommentActions', () => { (useAssistantAvailability as jest.Mock).mockReturnValue({ hasSearchAILakeConfigurations: false, }); - (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); }); it('content added to timeline is correct', () => { const message: ClientMessage = { @@ -99,20 +96,23 @@ describe('CommentActions', () => { expect(attachments).toHaveLength(1); expect(attachments[0].comment).toBe('Only this should be copied!'); }); - it('renders all actions when traceData and not EASE', () => { + it('renders timeline and case actions when not EASE', () => { const message: ClientMessage = { content: `Only this should be copied! {reference(exampleReferenceId)}`, role: 'assistant', timestamp: '2025-01-08T10:47:34.578Z', - traceData: { traceId: '123' }, }; - const { getByTestId } = render(, { wrapper: Wrapper }); + const { getByTestId } = render(, { + wrapper: Wrapper, + }); - expect(getByTestId('apmTraceButton')).toBeInTheDocument(); expect(getByTestId('addMessageContentAsTimelineNote')).toBeInTheDocument(); expect(getByTestId('addToExistingCaseButton')).toBeInTheDocument(); }); - it('renders only case and timeline actions when no traceData and not EASE', () => { + it('renders only case action when EASE', () => { + (useAssistantAvailability as jest.Mock).mockReturnValue({ + hasSearchAILakeConfigurations: true, + }); const message: ClientMessage = { content: `Only this should be copied! {reference(exampleReferenceId)}`, role: 'assistant', @@ -122,14 +122,10 @@ describe('CommentActions', () => { wrapper: Wrapper, }); - expect(queryByTestId('apmTraceButton')).not.toBeInTheDocument(); - expect(getByTestId('addMessageContentAsTimelineNote')).toBeInTheDocument(); + expect(queryByTestId('addMessageContentAsTimelineNote')).not.toBeInTheDocument(); expect(getByTestId('addToExistingCaseButton')).toBeInTheDocument(); }); - it('renders only case action when traceData and EASE', () => { - (useAssistantAvailability as jest.Mock).mockReturnValue({ - hasSearchAILakeConfigurations: true, - }); + it('does not render APM trace button even when traceData is present', () => { const message: ClientMessage = { content: `Only this should be copied! {reference(exampleReferenceId)}`, role: 'assistant', @@ -141,7 +137,7 @@ describe('CommentActions', () => { }); expect(queryByTestId('apmTraceButton')).not.toBeInTheDocument(); - expect(queryByTestId('addMessageContentAsTimelineNote')).not.toBeInTheDocument(); + expect(getByTestId('addMessageContentAsTimelineNote')).toBeInTheDocument(); expect(getByTestId('addToExistingCaseButton')).toBeInTheDocument(); }); }); diff --git a/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/index.tsx index aa4294e2ef557..97b5ef7e7eb7e 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/index.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/index.tsx @@ -11,7 +11,6 @@ import type { ClientMessage } from '@kbn/elastic-assistant'; import React, { useCallback } from 'react'; import { useDispatch } from 'react-redux'; -import { useAssistantContext } from '@kbn/elastic-assistant'; import { removeContentReferences } from '@kbn/elastic-assistant-common'; import { useAssistantAvailability } from '../use_assistant_availability'; import { useKibana, useToasts } from '../../common/lib/kibana'; @@ -21,7 +20,6 @@ import { TimelineId } from '../../../common/types'; import { updateAndAssociateNode } from '../../timelines/components/notes/helpers'; import { timelineActions } from '../../timelines/store'; import * as i18n from './translations'; -import { useIsExperimentalFeatureEnabled } from '../../common/hooks/use_experimental_features'; interface Props { message: ClientMessage; @@ -40,9 +38,7 @@ const CommentActionsComponent: React.FC = ({ message }) => { const toasts = useToasts(); const { cases } = useKibana().services; const dispatch = useDispatch(); - const isModelEvaluationEnabled = useIsExperimentalFeatureEnabled('assistantModelEvaluation'); const { hasSearchAILakeConfigurations } = useAssistantAvailability(); - const { traceOptions } = useAssistantContext(); const associateNote = useCallback( (noteId: string) => dispatch(timelineActions.addNote({ id: TimelineId.active, noteId })), @@ -86,38 +82,8 @@ const CommentActionsComponent: React.FC = ({ message }) => { }); }, [selectCaseModal, content]); - // Note: This feature is behind the `isModelEvaluationEnabled` FF. If ever released, this URL should be configurable - // as APM data may not go to the same cluster where the Kibana instance is running - // Links to the experimental trace explorer page - // Note: There's a bug with URL params being rewritten, so must specify 'query' to filter on transaction id - // See: https://github.com/elastic/kibana/issues/171368 - const apmTraceLink = - message.traceData != null && Object.keys(message.traceData).length > 0 - ? `${traceOptions.apmUrl}/traces/explorer/waterfall?comparisonEnabled=false&detailTab=timeline&environment=ENVIRONMENT_ALL&kuery=&query=transaction.id:%20${message.traceData.transactionId}&rangeFrom=now-1y/d&rangeTo=now&showCriticalPath=false&traceId=${message.traceData.traceId}&transactionId=${message.traceData.transactionId}&type=kql&waterfallItemId=` - : undefined; - - // Use this link for routing to the services/transactions view which provides a slightly different view - // const apmTraceLink = - // message.traceData != null - // ? `${basePath}/app/apm/services/kibana/transactions/view?kuery=&rangeFrom=now-1y&rangeTo=now&environment=ENVIRONMENT_ALL&serviceGroup=&comparisonEnabled=true&traceId=${message.traceData.traceId}&transactionId=${message.traceData.transactionId}&transactionName=POST%20/internal/elastic_assistant/actions/connector/?/_execute&transactionType=request&offset=1d&latencyAggregationType=avg` - // : undefined; - return ( - // APM Trace support is currently behind the Model Evaluation feature flag until wider testing is performed - {isModelEvaluationEnabled && apmTraceLink != null && !hasSearchAILakeConfigurations && ( - - - - - - )} {!hasSearchAILakeConfigurations && ( diff --git a/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/translations.ts index d4f975a6e367b..1f85d7b2cb96f 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/translations.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/translations.ts @@ -14,13 +14,6 @@ export const ADDED_NOTE_TO_TIMELINE = i18n.translate( } ); -export const VIEW_APM_TRACE = i18n.translate( - 'xpack.securitySolution.assistant.commentActions.viewAPMTraceLabel', - { - defaultMessage: 'View APM Trace for this message', - } -); - export const ADD_MESSAGE_CONTENT_AS_TIMELINE_NOTE = i18n.translate( 'xpack.securitySolution.assistant.commentActions.addMessageContentAsTimelineNoteAriaLabel', {