-
Notifications
You must be signed in to change notification settings - Fork 135
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
backend: add /logs
API for searching logs
#3
Conversation
/logs
API for search logs/logs
API for searching logs
Do you mean the client should fetch logs of different components or instances individually? and sort them by time in the client? |
@lonng This is a POC implementation. I have sent you a formal design. |
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.
Is pkg/apiserver/logs/task.go still WIP?
/logs
API for searching logs/logs
API for searching logs
/logs
API for searching logs/logs
API for searching logs
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.
Good job! I will have another detailed review tomorrow.
pkg/apiserver/logsearch/router.go
Outdated
StatusPort: "10080", | ||
}, | ||
} | ||
taskGroupID := scheduler.addTasks(components, searchLogReq) |
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.
Does a single search request contain multiple tasks?
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.
Yes, a request will start a taskGroup
, and it will start multiple tasks (one component per task).
pkg/apiserver/logsearch/models.go
Outdated
|
||
type PreviewModel struct { | ||
ID uint `json:"-" grom:"primary_key"` | ||
TaskID string `json:"task_id" gorm:"index;type:char(36)"` |
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.
how about using simple auto increment int?
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.
It will increase code complexity, I'd keep using UUID.
Signed-off-by: Breezewish <me@breeswish.org>
Polish some code
Refactor/tree diagram
This PR add a new API
/api/logs
for Dashboard backend.For all available APIs, please run
and visit API documents generated by swagger:
http://127.0.0.1:12333/dashboard/api/swagger/index.html
Changes: