Skip to content

Commit

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

Closes elastic#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)
  • Loading branch information
jennypavlova committed Jan 16, 2025
1 parent 96a0ecf commit 8b829c5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface UserAgent {
name: string;
};
name?: string;
original: string;
original?: string;
os?: {
name: string;
version?: string;
Expand Down

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 type { 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

0 comments on commit 8b829c5

Please sign in to comment.