Skip to content

Commit

Permalink
[APM] Fix: Add tracing sample missing fields in the overview (#206932)
Browse files Browse the repository at this point in the history
Closes #200474

## Summary

This PR fixes the issue with tracing sample missing URL/Status Code/User
Agent fields in the overview

## Testing
- Open the APM UI and find APM traces that contains `url.full` /
`transaction.page.url`, `http.request.method` and
`http.response.status_code`
- One should be ingested using an otel collector the other should use an
apm-server
- if using oblt cluster you can check transactions from `loadgenerator`
and `opbeans-python` for example
    - check the trace summary:
        - Otel:

![image](https://github.com/user-attachments/assets/871172b6-8307-4aa2-844e-73a8405da746)

        - APM server:

![image](https://github.com/user-attachments/assets/ef233cf4-0fbb-49c2-8f09-d4299a34ec8c)

(cherry picked from commit 1d493c0)

# Conflicts:
#	x-pack/plugins/spaces/public/config.ts
  • Loading branch information
jennypavlova committed Jan 16, 2025
1 parent dcb4cc4 commit d2164d7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ import {
SPAN_LINKS,
TRANSACTION_AGENT_MARKS,
SERVICE_LANGUAGE_NAME,
URL_FULL,
HTTP_REQUEST_METHOD,
HTTP_RESPONSE_STATUS_CODE,
TRANSACTION_PAGE_URL,
USER_AGENT_NAME,
} from '../../../../common/es_fields/apm';
import { asMutableArray } from '../../../../common/utils/as_mutable_array';
import { APMEventClient } from '../../../lib/helpers/create_es_client/create_apm_event_client';
Expand Down Expand Up @@ -58,7 +63,15 @@ export async function getTransaction({
TRANSACTION_TYPE,
] as const);

const optionalFields = asMutableArray([PROCESSOR_NAME, SERVICE_LANGUAGE_NAME] as const);
const optionalFields = asMutableArray([
PROCESSOR_NAME,
SERVICE_LANGUAGE_NAME,
URL_FULL,
TRANSACTION_PAGE_URL,
HTTP_RESPONSE_STATUS_CODE,
HTTP_REQUEST_METHOD,
USER_AGENT_NAME,
] as const);

const resp = await apmEventClient.search('get_transaction', {
apm: {
Expand Down
8 changes: 8 additions & 0 deletions x-pack/plugins/spaces/public/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ export interface ConfigType {
experimental: {
forceSolutionVisibility: boolean;
};
name?: string;
original?: string;
os?: {
name: string;
version?: string;
full?: string;
};
version?: string;
}

0 comments on commit d2164d7

Please sign in to comment.