-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
DT transaction sample header #24294
DT transaction sample header #24294
Conversation
💚 Build Succeeded |
💔 Build Failed |
5144a37
to
5331c19
Compare
💔 Build Failed |
...ugins/apm/public/components/app/TransactionDetails/Transaction/TransactionPropertiesTable.js
Show resolved
Hide resolved
interval: 'auto', | ||
query: { | ||
language: 'lucene', | ||
query: `${PROCESSOR_EVENT}:transaction AND ${TRANSACTION_ID}:${transactionId}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In v2 transaction.id
is not globally unique but only within a trace. So we need to add a trace.id
if it's v2.
transaction: Transaction; | ||
docType: 'transaction'; | ||
children?: Array<IWaterfallItemSpan | IWaterfallItemTransaction>; | ||
} | ||
|
||
interface IWaterfallItemSpan extends IWaterfallItemBase { | ||
export interface IWaterfallItemSpan extends IWaterfallItemBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the export
again, if it's not used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed -- is there a danger in exporting and not using? I usually tend to export as a designation "this is something I intend to be usable outside this file", sort of a "public" vs "private" ... but definitely don't care that much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal. I think export
is a nice signal to denote whether it's an implementation detail or not.
Also: if it's unexported and unused in the file, you'll get a lint error to delete it (which is nice).
@@ -30,13 +30,13 @@ interface IWaterfallItemBase { | |||
offset: number; | |||
} | |||
|
|||
interface IWaterfallItemTransaction extends IWaterfallItemBase { | |||
export interface IWaterfallItemTransaction extends IWaterfallItemBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as below (unused export)
return { | ||
location: state.location, | ||
urlParams: getUrlParams(state) | ||
urlParams: getUrlParams(state), | ||
waterfall: waterfall && waterfall.data ? waterfall.data : null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If waterfall
is not set it's undefined
. Is there a reason for explicitly changing it to null
? Keeping it as undefined
also makes it possible to specify it as optional:
waterfall?: WaterfallResponse
which is a bit less verbose than:
waterfall: WaterfallResponse | null
Not sure it's a good argument, but TS teams advises against using null
: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#null-and-undefined
@@ -4,33 +4,40 @@ | |||
* you may not use this file except in compliance with the Elastic License. | |||
*/ | |||
|
|||
import { EuiLink, EuiLinkAnchorProps } from '@elastic/eui'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! Thanks for converting this file! Much used. Very profit.
p95: bucket.p95.values['95.0'], | ||
averageResponseTime, | ||
transactionsPerMinute, | ||
impact, | ||
transactionType: oc(sample).transaction.type('n/a') | ||
transactionType: oc(sample).transaction.type() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we use transactionType
, serviceName
, id
and traceId
for on transactionGroupList page?
|
||
return { | ||
name: bucket.key, | ||
serviceName: oc(sample).context.service.name('n/a'), | ||
id: oc(sample).transaction.id('n/a'), | ||
serviceName: oc(sample).context.service.name(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are sure there is a sample, we can be sure there is a serviceName
. So we should be able do get it without oc
id: oc(sample).transaction.id('n/a'), | ||
serviceName: oc(sample).context.service.name(), | ||
id: sample.transaction.id, | ||
traceId: oc(sample).trace.id(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like mentioned above, I think the interface should be changed to:
export interface ITransactionGroup {
name: string;
sample: {
transactionType: string;
serviceName: string;
transactionId: string;
traceId?: string;
};
p95: number;
averageResponseTime: number;
transactionsPerMinute: number;
impact: number;
}
To separate agg data, and sample data; avoid ambiguous id
and make all fields except traceId
required.
p95: number; | ||
averageResponseTime: number; | ||
transactionsPerMinute: number; | ||
impact: number; | ||
transactionType: string; | ||
transactionType?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaict traceId
is the only one that should be optional.
💔 Build Failed |
} | ||
|
||
return ( | ||
<KibanaLink pathname="/app/apm" {...linkProps}> | ||
{props.children} | ||
{children} | ||
</KibanaLink> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this looks much cleaner now ✨
context: Transaction['context']; | ||
trace?: TransactionV2['trace']; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again: nice!
Striking the right balance between having accurate interfaces, but the fewer the better, is hard.
@@ -49,7 +42,7 @@ export const TRANSACTION_GROUP_AGGREGATES = { | |||
aggs: { | |||
sample: { | |||
top_hits: { | |||
_source: ['context', 'transaction', 'trace'], | |||
// _source: ['context', 'transaction', 'trace'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete?
p95: number; | ||
averageResponseTime: number; | ||
transactionsPerMinute: number; | ||
impact: number; | ||
transactionType?: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete unused?
}, | ||
{ | ||
field: 'averageResponseTime', | ||
name: 'Avg. response time', | ||
sortable: true, | ||
dataType: 'number', | ||
render: (value: number) => asMillisWithDefault(value * 1000) | ||
render: (value: number) => asMillisWithDefault(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
5bfb67e
to
e6d5b74
Compare
💔 Build Failed |
💔 Build Failed |
Merging this after talking with @sqren, we'll let these tests all pass in the feature branch one last time before merging to master. |
💚 Build Succeeded |
* Adds traces overview with mock data (#22628) * Updates service overview snapshots * Adds tests for ManagedTable and ImpactBar * Refactored transaction overview to use new managed table component * Removed jsconfig file in apm * [APM] Distributed tracing - Trace details (waterfall) (#22763) * [APM] Add typescript to waterfall (#23635) * [APM] Migrate get_trace and constants to Typescript (#23634) * [APM] Add types for setup_request (#23762) * [APM] Adds trace overview queries and some refactoring (#23605) * ImpactBar component to align EuiProgress usage for impact bars * Sharing some logic between transaction and trace queries * Typescript support * Quick fix ‘banana’ * [APM] Ensure backwards compatibility for v1 and v2 (#23636) * Make interfaces versioned * Rename eventType to docType * Fixes trace links on traces overview (#24089) * [APM] use react-redux-request (#24117) * Updated yarn lockfile for new yarn version * Updated dependency issues for react-router-dom types * [APM] Display transaction info on span flyout (#24189) * [APM] Display transaction info on span flyout * Brings in real location and url param data for transaction flyout * Converts flyout to TS * Adds query param state for flyouts with ts support * Updates styles and uses EuiTabs for transaction flyout * [APM] Transaction flyout * [APM] Minor docs cleanup (#24325) * [APM] Minor docs cleanup * [APM] Fix issues with v1 spans (#24332) * [APM] Add agent marks (#24361) * [APM] Typescript migration for the transaction endpoints (#24397) * [APM] DT transaction sample header (#24294) Transaction sample header completed * Fixes link target for traces overview to include trans/trace ids as query params * Converts Transaction index file to TS * Adds trace link to sample section * Refactors the trace link and applies it to two usages * Implements transaction sample action context menu * Calculates and implements duration percentage * Re-typed how transaction groups work * Fixes transaction flyout links and context menu * Removes unnecessary ms multiplication * Removes unused commented code * Finalizes infra links * Fixes some type shenanigans
* Adds traces overview with mock data (#22628) * Adds traces overview with mock data * Updates service overview snapshots * Updates based on review feedback * Adds tests for ManagedTable and ImpactBar * Refactored transaction overview to use new managed table component * Fixes tab size * Cleans up some tests and types * Cleans up types and tests * kbn bootstrap changes to x-pack yarn.lock * Removed jsconfig file in apm * Updates snapshot tests * Reversed bogus yarn lock change in x-pack * review feedback wip * Resolves typescript issues * [APM] Distributed tracing - Trace details (waterfall) (#22763) * [APM] Add typescript to waterfall (#23635) * [APM] Migrate get_trace and constants to Typescript (#23634) * Bump lock files * [APM] Add types for setup_request (#23762) * [APM] Adds trace overview queries and some refactoring (#23605) Refactoring includes: * ImpactBar component to align EuiProgress usage for impact bars * Sharing some logic between transaction and trace queries * Typescript support * Quick fix ‘banana’ * [APM] Ensure backwards compatibility for v1 and v2 (#23636) Fix tests Make interfaces versioned Fix ts issues Rename eventType to docType WIP Working prototype Fix tests Limit get_transaction by trace.id * Fixes trace links on traces overview (#24089) * [APM] use react-redux-request (#24117) * [APM] use react-redux-request * Stricter type checking * Bump yarn lock files * Fix package.json * Updated yarn lockfile for new yarn version * Updated dependency issues for react-router-dom types * [APM] Display transaction info on span flyout (#24189) * [APM] Display transaction info on span flyout * Add links * Fix tests * Eui fixes * Remove color from span type * Fix failing tests * Adds versions to transaction and span itmes when they are returned from the API (#24186) * Timeline transaction flyout (#24027) * Duplicates transaction properties table for use in flyout, with dummy values * Brings in real location and url param data for transaction flyout * Converts flyout to TS * Adds query param state for flyouts with ts support * Updates styles and uses EuiTabs for transaction flyout * Updates type references after rebase * Updated index var name per review feedback * WIP transaction flyout * WIP transaction flyout * WIP * Fixes waterfall helpers after rebasing span flyout changes * Finalizes styling for transaction flyover from timeline * Fixes layout for span flyout header * Removed accidentally committed file (should be in other branch) * Small tweaks to the sticky property layout styling * Updates snapshot tests after sticky properties converting to EUI * Final review tweaks for TS * [APM] Minor docs cleanup (#24325) * [APM] Minor docs cleanup * Fix tests * Make `text` required * Simplify documentation module * Break docs into separate files * Remove `translateAgentName` method * Formatting * [APM] Fix issues with v1 spans (#24332) * [APM] Add agent marks (#24361) * Typescript migration for the transaction endpoints (#24397) * DT transaction sample header (#24294) Transaction sample header completed * Fixes link target for traces overview to include trans/trace ids as query params * Converts Transaction index file to TS * Adds trace link to sample section * Refactors the trace link and applies it to two usages * Implements transaction sample action context menu * Calculates and implements duration percentage * Re-typed how transaction groups work * Fixes transaction flyout links and context menu * Removes unnecessary ms multiplication * Removes unused commented code * Finalizes infra links * Fixes some type shenanigans
* Adds traces overview with mock data (#22628) * Updates service overview snapshots * Adds tests for ManagedTable and ImpactBar * Refactored transaction overview to use new managed table component * Removed jsconfig file in apm * [APM] Distributed tracing - Trace details (waterfall) (#22763) * [APM] Add typescript to waterfall (#23635) * [APM] Migrate get_trace and constants to Typescript (#23634) * [APM] Add types for setup_request (#23762) * [APM] Adds trace overview queries and some refactoring (#23605) * ImpactBar component to align EuiProgress usage for impact bars * Sharing some logic between transaction and trace queries * Typescript support * Quick fix ‘banana’ * [APM] Ensure backwards compatibility for v1 and v2 (#23636) * Make interfaces versioned * Rename eventType to docType * Fixes trace links on traces overview (#24089) * [APM] use react-redux-request (#24117) * Updated yarn lockfile for new yarn version * Updated dependency issues for react-router-dom types * [APM] Display transaction info on span flyout (#24189) * [APM] Display transaction info on span flyout * Brings in real location and url param data for transaction flyout * Converts flyout to TS * Adds query param state for flyouts with ts support * Updates styles and uses EuiTabs for transaction flyout * [APM] Transaction flyout * [APM] Minor docs cleanup (#24325) * [APM] Minor docs cleanup * [APM] Fix issues with v1 spans (#24332) * [APM] Add agent marks (#24361) * [APM] Typescript migration for the transaction endpoints (#24397) * [APM] DT transaction sample header (#24294) Transaction sample header completed * Fixes link target for traces overview to include trans/trace ids as query params * Converts Transaction index file to TS * Adds trace link to sample section * Refactors the trace link and applies it to two usages * Implements transaction sample action context menu * Calculates and implements duration percentage * Re-typed how transaction groups work * Fixes transaction flyout links and context menu * Removes unnecessary ms multiplication * Removes unused commented code * Finalizes infra links * Fixes some type shenanigans
Summary
Closes #20657