Skip to content

Commit

Permalink
[APM] Support error.{log,exception}.stacktrace.classname
Browse files Browse the repository at this point in the history
In elastic/apm-server/pull/3096, an alternative to stacktrace.filename was introduced: stacktrace.classname. This change makes sure classname is properly represented in the UI and in our types.
  • Loading branch information
dgieselaar committed Jan 13, 2020
1 parent 204155b commit 9831314
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ const FrameHeading: React.FC<Props> = ({ stackframe, isLibraryFrame }) => {
? LibraryFrameFileDetail
: AppFrameFileDetail;
const lineNumber = stackframe.line.number;

const name =
'filename' in stackframe ? stackframe.filename : stackframe.classname;

return (
<FileDetails>
<FileDetail>{stackframe.filename}</FileDetail> in{' '}
<FileDetail>{name}</FileDetail> in{' '}
<FileDetail>{stackframe.function}</FileDetail>
{lineNumber > 0 && (
<Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

interface IStackframeBase {
filename: string;
type IStackframeBase = {
function?: string;
library_frame?: boolean;
exclude_from_grouping?: boolean;
Expand All @@ -19,13 +18,13 @@ interface IStackframeBase {
line: {
number: number;
};
}
} & ({ classname: string } | { filename: string });

export interface IStackframeWithLineContext extends IStackframeBase {
export type IStackframeWithLineContext = IStackframeBase & {
line: {
number: number;
context: string;
};
}
};

export type IStackframe = IStackframeBase | IStackframeWithLineContext;

0 comments on commit 9831314

Please sign in to comment.