Skip to content

Add "Show trace logs" action#34310

Merged
jasonrhodes merged 5 commits intoelastic:masterfrom
jasonrhodes:add-trace-id-action_23317
Apr 8, 2019
Merged

Add "Show trace logs" action#34310
jasonrhodes merged 5 commits intoelastic:masterfrom
jasonrhodes:add-trace-id-action_23317

Conversation

@jasonrhodes
Copy link
Copy Markdown
Member

@jasonrhodes jasonrhodes commented Apr 1, 2019

Closes #23317

Note: we should separate link creation logic per Kibana destination, so we have better type safety around things like query params. In this PR I've relaxed the query param types significantly, but in a separate branch I'm going to try to make this better with destination-specific types (ML vs APM vs Discover etc) ... see also #34443

Also fixes a bug discovered while working on this ticket, where links to infra/logs were not including correct time params.

Summary

Adds a conditional "Show trace logs" link to the transaction action menu (if trace.id is present).

Screen Shot 2019-04-01 at 3 22 37 PM

Screen Shot 2019-04-01 at 3 23 32 PM

Also:

While working on this ticket, I also discovered that the links to infra were not including the correct time params (we were using rison-based params which infra does not recognize). This ticket fixes that by using the correctly formatted params for time for logs and metrics links.

@jasonrhodes jasonrhodes requested a review from a team April 1, 2019 19:24
@jasonrhodes jasonrhodes changed the title Add trace id action 23317 Add "Show trace logs" action Apr 1, 2019
@jasonrhodes jasonrhodes force-pushed the add-trace-id-action_23317 branch from af8bfe5 to 3c18f8a Compare April 1, 2019 19:29
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@jasonrhodes
Copy link
Copy Markdown
Member Author

Looking at this more closely, I'm not sure anything we're doing with time ranges for these links is actually working. Going to take a closer look at those and see if we can find a simple fix for that here if necessary.

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@jasonrhodes jasonrhodes force-pushed the add-trace-id-action_23317 branch 2 times, most recently from f677abf to aaff150 Compare April 3, 2019 16:16
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@jasonrhodes jasonrhodes force-pushed the add-trace-id-action_23317 branch 2 times, most recently from 10f8981 to 23c9677 Compare April 3, 2019 16:23
@jasonrhodes jasonrhodes added the bug Fixes for quality problems that affect the customer experience label Apr 3, 2019
@jasonrhodes jasonrhodes force-pushed the add-trace-id-action_23317 branch from 23c9677 to 83497c6 Compare April 3, 2019 16:35
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Member

@weltenwort weltenwort left a comment

Choose a reason for hiding this comment

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

The generated link looks good and seems to work with my test data. 👍

),
target: traceId,
hash: `/link-to/logs`,
query: { time, filter: `trace.id:${traceId}` }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not seeing this here, but wanted to mention it because I got burned by this before:

Characters like : in the URL might be strictly encoded by the querystring module, which is seems to be used here. I have run into situations where this caused duplicate history entries due to angular undoing the encoding of certain characters. I previously prevented that by using the encoding functions provided by ui/utils/query_string instead of those from querystring.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, we'll look into this -- we already handle this issue with the % character, but maybe we can consolidate into one solution.

Copy link
Copy Markdown
Contributor

@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!

@jasonrhodes jasonrhodes merged commit c9f65ad into elastic:master Apr 8, 2019
@jasonrhodes jasonrhodes deleted the add-trace-id-action_23317 branch April 8, 2019 18:24
jasonrhodes added a commit to jasonrhodes/kibana that referenced this pull request Apr 8, 2019
* Adds trace logs link to action menu

* Updates tests

* Fixes time range values for action menu links

* Relaxes type checking on query param object to allow for outgoing links

* Revert unnecessary rison changes after realizing infra links do not accept rison
jasonrhodes added a commit that referenced this pull request Apr 8, 2019
* Adds trace logs link to action menu

* Updates tests

* Fixes time range values for action menu links

* Relaxes type checking on query param object to allow for outgoing links

* Revert unnecessary rison changes after realizing infra links do not accept rison
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes for quality problems that affect the customer experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[APM] Action menu: Link trace.id to Logs UI

4 participants