Skip to content

Allow querying logs only by instance to simplify frontend query#9157

Merged
wu-sheng merged 1 commit intomasterfrom
ondemandlog2
Jun 1, 2022
Merged

Allow querying logs only by instance to simplify frontend query#9157
wu-sheng merged 1 commit intomasterfrom
ondemandlog2

Conversation

@kezhenxu94
Copy link
Copy Markdown
Member

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
  • Update the CHANGES log.

@kezhenxu94 kezhenxu94 added backend OAP backend related. enhancement Enhancement on performance or codes labels Jun 1, 2022
@kezhenxu94 kezhenxu94 added this to the 9.1.0 milestone Jun 1, 2022
@kezhenxu94 kezhenxu94 requested a review from wu-sheng June 1, 2022 07:33
@kezhenxu94 kezhenxu94 marked this pull request as ready for review June 1, 2022 07:33

protected Map<String, String> ensureInstanceHasPodProperties(final ServiceInstance instance) {
if (instance == null) {
throw new IllegalArgumentException("No such instance");
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.

Should we return an empty container list? rather than an exception?

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.

Should we return an empty container list? rather than an exception?

An exception is more reasonable in my opinion for non-existing instance, I think "no such instance" is totally different from "no logs in this instance"

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 don't mean for text. I want the UI could visualize this message in a different way.

In the metrics query, you would have seen similar cases that happened before. Before the current v1 and v2 metric query, SkyWalking reports errors when a service/instance doesn't exist, but the client/UI applies a query for that. Back then, we faced a lot of meaningless bug reports. This was why I added a metric mock logic(default value or zero) for the no existing metrics.

I agree that An exception is more reasonable in my opinion for non-existing instance. But meanwhile, what the reality told me is that ppl are panic when they saw a red exception.

@wu-sheng
Copy link
Copy Markdown
Member

wu-sheng commented Jun 1, 2022

I think generally, we should not report errors if this instance doesn't have on-demand logs.

If you want this available on the UI, we could add one more field for the response.

@kezhenxu94
Copy link
Copy Markdown
Member Author

If you want this available on the UI, we could add one more field for the response.

Why? UI already displays the errors reported by backend correctly,
Screen Shot 2022-06-01 at 15 59 26

@wu-sheng
Copy link
Copy Markdown
Member

wu-sheng commented Jun 1, 2022

This kind of exception would make us suffer many questions from new users since the day we release this, from my experience. Many of them are throwing any exception to this issue channel without thinking or reading.

The on-demand log is not available for this instance. may be a better statement on the on-demand widget.

@kezhenxu94 kezhenxu94 force-pushed the ondemandlog2 branch 3 times, most recently from 8028042 to 838ba93 Compare June 1, 2022 08:34
return attributesMap;
}

public List<String> listContainers(
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.

@Fine0830 Once UI faces listContainers returning an empty list, please show a tip on the logs page, The on-demand logs are not available.

@wu-sheng
Copy link
Copy Markdown
Member

wu-sheng commented Jun 1, 2022

Notice, please fix https://skywalking.apache.org/docs/main/latest/en/setup/backend/on-demand-pod-log/'s menu, there is a extra g in the menu link.

Also, could you reword this doc to follow the latest changes? Please highlight those two key properties, and which values should be put.

wu-sheng
wu-sheng previously approved these changes Jun 1, 2022
@wu-sheng wu-sheng merged commit b69e3f4 into master Jun 1, 2022
@wu-sheng wu-sheng deleted the ondemandlog2 branch June 1, 2022 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend OAP backend related. enhancement Enhancement on performance or codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants