Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [APM][Errors] Fix: Missing summary data in in error sample (#213430) #213574

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code';
export const USER_ID = 'user.id';
export const USER_AGENT_ORIGINAL = 'user_agent.original';
export const USER_AGENT_NAME = 'user_agent.name';
export const USER_AGENT_VERSION = 'user_agent.version';

export const OBSERVER_VERSION = 'observer.version';
export const OBSERVER_VERSION_MAJOR = 'observer.version_major';
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 @@ -158,6 +158,7 @@ export function ErrorSampleDetails({
const errorUrl = error.error.page?.url || error.url?.full;
const method = error.http?.request?.method;
const status = error.http?.response?.status_code;
const userAgent = error?.user_agent;
const environment = error.service.environment;
const serviceVersion = error.service.version;
const isUnhandled = error.error.exception?.[0]?.handled === false;
Expand Down Expand Up @@ -249,9 +250,7 @@ export function ErrorSampleDetails({
errorUrl && method ? (
<HttpInfoSummaryItem url={errorUrl} method={method} status={status} />
) : null,
transaction && transaction.user_agent ? (
<UserAgentSummaryItem {...transaction.user_agent} />
) : null,
userAgent?.name ? <UserAgentSummaryItem {...userAgent} /> : null,
transaction && (
<EuiToolTip
content={i18n.translate('xpack.apm.errorSampleDetails.relatedTransactionSample', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ import {
ERROR_STACK_TRACE,
SPAN_ID,
SERVICE_LANGUAGE_NAME,
URL_FULL,
HTTP_REQUEST_METHOD,
HTTP_RESPONSE_STATUS_CODE,
TRANSACTION_PAGE_URL,
USER_AGENT_NAME,
USER_AGENT_VERSION,
} from '../../../../common/es_fields/apm';
import { environmentQuery } from '../../../../common/utils/environment_query';
import { ApmDocumentType } from '../../../../common/document_type';
Expand All @@ -42,6 +48,7 @@ export interface ErrorSampleDetailsResponse {
transaction: Transaction | undefined;
error: Omit<APMError, 'transaction' | 'error'> & {
transaction?: { id?: string; type?: string };
user_agent?: { name?: string; version?: string };
error: {
id: string;
} & Omit<APMError['error'], 'exception' | 'log'> & {
Expand Down Expand Up @@ -90,6 +97,12 @@ export async function getErrorSampleDetails({
ERROR_EXC_MESSAGE,
ERROR_EXC_HANDLED,
ERROR_EXC_TYPE,
URL_FULL,
HTTP_REQUEST_METHOD,
HTTP_RESPONSE_STATUS_CODE,
TRANSACTION_PAGE_URL,
USER_AGENT_NAME,
USER_AGENT_VERSION,
] as const);

const params = {
Expand Down