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

Timeline transaction flyout #24027

Merged
merged 17 commits into from
Oct 19, 2018

Conversation

jasonrhodes
Copy link
Member

@jasonrhodes jasonrhodes commented Oct 15, 2018

Summary

This replaces work in #24010 after discussions with the team and me better understanding the work here. Closes #23567

UPDATE: this work also includes persisting the flyout and flyout active tab state in the query string for both the transaction flyouts and the span flyouts.

e.g.

example transaction link (with service tab active)
http://localhost:5601/app/apm#/opbeans-java/transactions/request/APIRestController~23products?_g=()&kuery=&flyoutDetailTab=service&activeTimelineId=6da58c75083c86e9

example span link
http://localhost:5601/app/apm#/opbeans-java/transactions/request/APIRestController~23products?_g=()&kuery=&flyoutDetailTab=null&activeTimelineId=1b394e907aaf708d

@sorenlouv
Copy link
Member

Thanks for the very thorough description and checkboxes.
Did you mean to merge it into master or apm/dt?

@jasonrhodes
Copy link
Member Author

@sqren defiitely meant apm/dt, keep forgetting to switch that base when I create.

Looks like the checkboxes are new, modeled after EUI's PR template or similar!

@jasonrhodes jasonrhodes changed the base branch from master to apm/dt October 15, 2018 15:23
@sorenlouv
Copy link
Member

Looks like the checkboxes are new, modeled after EUI's PR template or similar!

Oh, that makes sense. I was very impressed that you were going to test it in IE11 at this stage :D

@elasticmachine
Copy link
Contributor

💔 Build Failed

location: PropTypes.object.isRequired,
transaction: PropTypes.object.isRequired,
urlParams: PropTypes.object.isRequired
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps convert to typescript, since it's a new file anyway.

...location,
search: fromQuery({
...toQuery(location.search),
flyoutDetailTab: key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this currently work? I think you'll have to update urlparams.js to make it work (this is something I want to change)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah! I figured that out eventually (before I saw this comment unfortunately :D)

@elasticmachine
Copy link
Contributor

💔 Build Failed

@@ -11,10 +11,13 @@ import {
EuiTitle
} from '@elastic/eui';
import React from 'react';
import { IUrlParams } from '..';
Copy link
Member

@sorenlouv sorenlouv Oct 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only a few minor things.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@@ -38,6 +39,8 @@ export interface IUrlParams {
transactionType: string;
transactionName: string;
errorGroupId: string;
flyoutDetailTab: string | null;
activeTimelineId: string | null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this work?

Suggested change
activeTimelineId: string | null;
activeTimelineId?: string;

(btw. had to try out the new suggestion feature ;) )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you might want to rebase with apm/dt. Lots of typescript changes :)

Copy link
Member Author

@jasonrhodes jasonrhodes Oct 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ? doesn't work here either because that is an alias for string | undefined but not for null. I was using null to clear out query param values since you can't remove them easily, since they are merged in with old ones. The spanId that exists in 6.4 sets them to null so I went with that. :)

*Open to suggestions on how to make this work better. :)

@elasticmachine
Copy link
Contributor

💔 Build Failed

@jasonrhodes
Copy link
Member Author

retest

@jasonrhodes jasonrhodes force-pushed the timeline-transaction-flyout-b branch 2 times, most recently from 5e0a476 to 8e4a72f Compare October 17, 2018 03:11
@jasonrhodes
Copy link
Member Author

This is all rebased and feedback addressed. :D

@jasonrhodes jasonrhodes changed the title WIP: Timeline transaction flyout (B) Timeline transaction flyout (B) Oct 17, 2018
@jasonrhodes jasonrhodes changed the title Timeline transaction flyout (B) Timeline transaction flyout Oct 17, 2018
@jasonrhodes
Copy link
Member Author

Just remembered, for tomorrow: this flyout needs a link to go to the transaction group

@elasticmachine
Copy link
Contributor

💔 Build Failed

@jasonrhodes
Copy link
Member Author

retest

const { waterfall } = this.props;
const { waterfall, location, urlParams } = this.props;
const currentItem =
urlParams.activeTimelineId && waterfall.index[urlParams.activeTimelineId];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just:

Suggested change
urlParams.activeTimelineId && waterfall.index[urlParams.activeTimelineId];
waterfall.index[urlParams.activeTimelineId];

@jasonrhodes
Copy link
Member Author

OK if builds pass (lol) then I think this is in good shape to move on for now. We should rethink the sticky properties stuff later bc I'm not thrilled with how it's working right now, but I was able to use EUI flex components and get it laid out like the mock up so I think that's a win for this week. :)

@elasticmachine
Copy link
Contributor

💔 Build Failed

@jasonrhodes jasonrhodes force-pushed the timeline-transaction-flyout-b branch from a68d7ad to 8020e0e Compare October 19, 2018 12:24
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@jasonrhodes jasonrhodes force-pushed the timeline-transaction-flyout-b branch from 51ef796 to bd965ff Compare October 19, 2018 14:43
): AgentDoc | void {
if (!agentName) {
return;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have to keep this return type for now because otherwise callers of this function don't know what they're getting returned, because TS can't infer from the lodash get call.

But splitting out AgentDoc as an interface and using it here and in the list above uncovered a bug with the javascript object having the URL assigned to the text key instead of url, so yay typescript!

@@ -112,7 +123,7 @@ export const APM_AGENT_DOCS = {
url: `${DOCS_ROOT}/agent/ruby/1.x/advanced.html#_adding_tags`
},
javascript: {
text: `${DOCS_ROOT}/agent/js-base/0.x/api.html#apm-set-tags`
url: `${DOCS_ROOT}/agent/js-base/0.x/api.html#apm-set-tags`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TS was all worth it

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@jasonrhodes jasonrhodes merged commit 5ffd3a6 into elastic:apm/dt Oct 19, 2018
@jasonrhodes jasonrhodes deleted the timeline-transaction-flyout-b branch October 19, 2018 19:12
jasonrhodes added a commit that referenced this pull request Oct 23, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants