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

[APM] Add "View in Logs" button by the Logstream component in Trace detail #85915

Open
formgeist opened this issue Dec 15, 2020 · 9 comments
Open
Assignees
Labels
apm:logs enhancement New value added to drive a business result Team:APM All issues that need APM UI Team support Unified Observability Work to make the observability apps more consistent and eventually more unified as a user experience

Comments

@formgeist
Copy link
Contributor

formgeist commented Dec 15, 2020

Summary

The Logs component embeddable supports adding a "View in logs" link in the top-right corner of the component which is useful for quickly exploring all related logs in the dedicated app.

Screenshot 2020-12-15 at 09 23 27

@formgeist formgeist added Team:APM All issues that need APM UI Team support enhancement New value added to drive a business result labels Dec 15, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@sorenlouv sorenlouv added [zube]: Inbox apm:logs Team:APM All issues that need APM UI Team support enhancement New value added to drive a business result and removed Team:APM All issues that need APM UI Team support enhancement New value added to drive a business result [zube]: Inbox labels Jan 7, 2021
@formgeist formgeist reopened this Jun 16, 2021
@zube zube bot closed this as completed Jun 16, 2021
@zube zube bot reopened this Jun 16, 2021
@zube zube bot added [zube]: Inbox and removed [zube]: Done labels Jun 16, 2021
@zube zube bot closed this as completed Jun 16, 2021
@zube zube bot added [zube]: Done and removed [zube]: Inbox labels Jun 16, 2021
@zube zube bot reopened this Jun 16, 2021
@zube zube bot added [zube]: Inbox and removed [zube]: Done labels Jun 16, 2021
@zube zube bot closed this as completed Jun 16, 2021
@zube zube bot added [zube]: Done and removed [zube]: Inbox labels Jun 16, 2021
@formgeist formgeist reopened this Jun 16, 2021
@formgeist formgeist added the Unified Observability Work to make the observability apps more consistent and eventually more unified as a user experience label Nov 5, 2021
@formgeist
Copy link
Contributor Author

@dannycroft I think it'd be great to get this prioritised for the next release if possible

@cauemarcondes
Copy link
Contributor

cauemarcondes commented May 9, 2022

Like, described in this issue #82635, we should basically import the new component and use it to create the link.

@afgomez / @jasonrhodes for what I could see the linkToLogs was not implemented. Have you come up with a different solution?

@afgomez
Copy link
Contributor

afgomez commented May 9, 2022

I'm not in that team anymore but AFAIK there's no component/function. There is a magic /link-to URL (https://github.com/elastic/kibana/blob/1bfeab7553899efcfa9a6e46b37dc3c7681dcf3b/x-pack/plugins/infra/public/pages/link_to/link_to_logs.tsx) so that could be a good start.

@elastic/infra-monitoring-ui could you chime in? Is there an officially supported way to link to the logs app?

@miltonhultgren
Copy link
Contributor

As far as I know, other apps (like the Deprecations UI) use our /link-to URLs for this. We have an issue to add Kibana Locators somewhere...
I don't know if the Log Stream component has anything built in for that, @weltenwort @Kerry350 ?

@weltenwort
Copy link
Member

There's nothing built into the log stream component. The link-to URLs would indeed be the best approach until we've added locators. An example of the Stack Monitoring UI using a link-to URL would be

const base = `${Legacy.shims.getBasePath()}/app/logs/link-to/${INFRA_SOURCE_ID}/logs`;

@sorenlouv
Copy link
Member

Using the "link-to" approach sounds good to me. How would we apply the kql filter like "service.name: "opbeans-dotnet" or (not service.name and (container.id:"581c0655"))"?

Would it look like this?

/app/logs/link-to/internal-stack-monitoring/logs?kql=foo

@weltenwort
Copy link
Member

Yes, the route supports a filter query parameter that takes kql like that.

@weltenwort
Copy link
Member

Also time as a unix epoch to center on a point in time and from/to as unix epochs to set the time range:

export const getTimeFromLocation = (location: Location) => {
const timeParam = getParamFromQueryString(getQueryStringFromLocation(location), 'time');
return timeParam ? parseFloat(timeParam) : NaN;
};
export const getFilterFromLocation = (location: Location) => {
const param = getParamFromQueryString(getQueryStringFromLocation(location), 'filter');
return param ? param : '';
};
export const getToFromLocation = (location: Location) => {
const timeParam = getParamFromQueryString(getQueryStringFromLocation(location), 'to');
return timeParam ? parseFloat(timeParam) : NaN;
};
export const getFromFromLocation = (location: Location) => {
const timeParam = getParamFromQueryString(getQueryStringFromLocation(location), 'from');
return timeParam ? parseFloat(timeParam) : NaN;
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:logs enhancement New value added to drive a business result Team:APM All issues that need APM UI Team support Unified Observability Work to make the observability apps more consistent and eventually more unified as a user experience
Projects
None yet
Development

No branches or pull requests

7 participants