Skip to content

Commit 5cae8bf

Browse files
[9.2] [APM] adding missing fields to transaction (#241336) (#241367)
# Backport This will backport the following commits from `main` to `9.2`: - [[APM] adding missing fields to transaction (#241336)](#241336) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Cauê Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-10-30T19:00:49Z","message":"[APM] adding missing fields to transaction (#241336)\n\ncloses https://github.com/elastic/kibana/issues/233880\n\nAfter:\n<img width=\"338\" height=\"343\" alt=\"Screenshot 2025-10-30 at 13 11 59\"\nsrc=\"https://github.com/user-attachments/assets/dec593a1-7681-42dc-82cb-e949e0fc7669\"\n/>\n\n<img width=\"337\" height=\"346\" alt=\"Screenshot 2025-10-30 at 13 12 59\"\nsrc=\"https://github.com/user-attachments/assets/88414e52-3686-4325-b97a-e004651edf36\"\n/>","sha":"d50928173db8dc4fbfcfd7cf3a941636ad6151fa","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:all-open","Team:obs-ux-infra_services","v9.3.0"],"title":"[APM] adding missing fields to transaction","number":241336,"url":"https://github.com/elastic/kibana/pull/241336","mergeCommit":{"message":"[APM] adding missing fields to transaction (#241336)\n\ncloses https://github.com/elastic/kibana/issues/233880\n\nAfter:\n<img width=\"338\" height=\"343\" alt=\"Screenshot 2025-10-30 at 13 11 59\"\nsrc=\"https://github.com/user-attachments/assets/dec593a1-7681-42dc-82cb-e949e0fc7669\"\n/>\n\n<img width=\"337\" height=\"346\" alt=\"Screenshot 2025-10-30 at 13 12 59\"\nsrc=\"https://github.com/user-attachments/assets/88414e52-3686-4325-b97a-e004651edf36\"\n/>","sha":"d50928173db8dc4fbfcfd7cf3a941636ad6151fa"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/241336","number":241336,"mergeCommit":{"message":"[APM] adding missing fields to transaction (#241336)\n\ncloses https://github.com/elastic/kibana/issues/233880\n\nAfter:\n<img width=\"338\" height=\"343\" alt=\"Screenshot 2025-10-30 at 13 11 59\"\nsrc=\"https://github.com/user-attachments/assets/dec593a1-7681-42dc-82cb-e949e0fc7669\"\n/>\n\n<img width=\"337\" height=\"346\" alt=\"Screenshot 2025-10-30 at 13 12 59\"\nsrc=\"https://github.com/user-attachments/assets/88414e52-3686-4325-b97a-e004651edf36\"\n/>","sha":"d50928173db8dc4fbfcfd7cf3a941636ad6151fa"}}]}] BACKPORT--> Co-authored-by: Cauê Marcondes <[email protected]>
1 parent 07b7b92 commit 5cae8bf

File tree

2 files changed

+37
-29
lines changed

2 files changed

+37
-29
lines changed

x-pack/solutions/observability/plugins/apm/server/routes/transactions/__snapshots__/queries.test.ts.snap

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/solutions/observability/plugins/apm/server/routes/transactions/get_transaction/index.ts

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,45 @@ import {
3535
SERVER_ADDRESS,
3636
SERVER_PORT,
3737
USER_AGENT_VERSION,
38+
KUBERNETES_POD_UID,
39+
CONTAINER_ID,
40+
HOST_HOSTNAME,
3841
} from '../../../../common/es_fields/apm';
3942
import { asMutableArray } from '../../../../common/utils/as_mutable_array';
4043
import type { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client';
4144
import { ApmDocumentType } from '../../../../common/document_type';
4245
import { RollupInterval } from '../../../../common/rollup';
46+
const requiredFields = asMutableArray([
47+
TRACE_ID,
48+
AGENT_NAME,
49+
PROCESSOR_EVENT,
50+
AT_TIMESTAMP,
51+
TIMESTAMP_US,
52+
SERVICE_NAME,
53+
TRANSACTION_ID,
54+
TRANSACTION_DURATION,
55+
TRANSACTION_NAME,
56+
TRANSACTION_SAMPLED,
57+
TRANSACTION_TYPE,
58+
] as const);
59+
60+
const optionalFields = asMutableArray([
61+
PROCESSOR_NAME,
62+
SERVICE_LANGUAGE_NAME,
63+
URL_FULL,
64+
TRANSACTION_PAGE_URL,
65+
HTTP_RESPONSE_STATUS_CODE,
66+
HTTP_REQUEST_METHOD,
67+
USER_AGENT_NAME,
68+
URL_PATH,
69+
URL_SCHEME,
70+
SERVER_ADDRESS,
71+
SERVER_PORT,
72+
USER_AGENT_VERSION,
73+
KUBERNETES_POD_UID,
74+
HOST_HOSTNAME,
75+
CONTAINER_ID,
76+
] as const);
4377

4478
export async function getTransaction({
4579
transactionId,
@@ -54,35 +88,6 @@ export async function getTransaction({
5488
start: number;
5589
end: number;
5690
}): Promise<Transaction | undefined> {
57-
const requiredFields = asMutableArray([
58-
TRACE_ID,
59-
AGENT_NAME,
60-
PROCESSOR_EVENT,
61-
AT_TIMESTAMP,
62-
TIMESTAMP_US,
63-
SERVICE_NAME,
64-
TRANSACTION_ID,
65-
TRANSACTION_DURATION,
66-
TRANSACTION_NAME,
67-
TRANSACTION_SAMPLED,
68-
TRANSACTION_TYPE,
69-
] as const);
70-
71-
const optionalFields = asMutableArray([
72-
PROCESSOR_NAME,
73-
SERVICE_LANGUAGE_NAME,
74-
URL_FULL,
75-
TRANSACTION_PAGE_URL,
76-
HTTP_RESPONSE_STATUS_CODE,
77-
HTTP_REQUEST_METHOD,
78-
USER_AGENT_NAME,
79-
URL_PATH,
80-
URL_SCHEME,
81-
SERVER_ADDRESS,
82-
SERVER_PORT,
83-
USER_AGENT_VERSION,
84-
] as const);
85-
8691
const resp = await apmEventClient.search('get_transaction', {
8792
apm: {
8893
sources: [

0 commit comments

Comments
 (0)