-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore: add k8s job resources #6410
Conversation
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.
👍 Looks good to me! Reviewed everything up to 51df0c4 in 1 minute and 20 seconds
More details
- Looked at
662
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
9
drafted comments based on config settings.
1. pkg/query-service/app/infra.go:509
- Draft comment:
Consider providing more specific error messages for better debugging and user feedback. - Reason this comment was not posted:
Confidence changes required:50%
The code for handling job attribute keys and values is consistent with other similar functions. However, the error handling could be improved by providing more specific error messages.
2. pkg/query-service/app/infra.go:525
- Draft comment:
Consider providing more specific error messages for better debugging and user feedback. - Reason this comment was not posted:
Confidence changes required:50%
The code for handling job attribute keys and values is consistent with other similar functions. However, the error handling could be improved by providing more specific error messages.
3. pkg/query-service/app/infra.go:543
- Draft comment:
Consider providing more specific error messages for better debugging and user feedback. - Reason this comment was not posted:
Confidence changes required:50%
The code for handling job list is consistent with other similar functions. However, the error handling could be improved by providing more specific error messages.
4. pkg/query-service/app/inframetrics/common.go:89
- Draft comment:
Consider refactoring to avoid repetition across similar functions likegetParamsForTopJobs
,getParamsForTopHosts
, etc. - Reason this comment was not posted:
Confidence changes required:50%
The functiongetParamsForTopJobs
is consistent with other similar functions. However, the code could be refactored to avoid repetition.
5. pkg/query-service/app/inframetrics/jobs.go:153
- Draft comment:
Consider providing more specific error messages for better debugging and user feedback. - Reason this comment was not posted:
Confidence changes required:50%
TheGetJobAttributeKeys
function is consistent with other similar functions. However, the error handling could be improved by providing more specific error messages.
6. pkg/query-service/app/inframetrics/jobs.go:178
- Draft comment:
Consider providing more specific error messages for better debugging and user feedback. - Reason this comment was not posted:
Confidence changes required:50%
TheGetJobAttributeValues
function is consistent with other similar functions. However, the error handling could be improved by providing more specific error messages.
7. pkg/query-service/app/inframetrics/jobs.go:364
- Draft comment:
Consider providing more specific error messages for better debugging and user feedback. - Reason this comment was not posted:
Confidence changes required:50%
TheGetJobList
function is consistent with other similar functions. However, the error handling could be improved by providing more specific error messages.
8. pkg/query-service/app/inframetrics/jobs.go:369
- Draft comment:
Consider providing more specific error messages for better debugging and user feedback. - Reason this comment was not posted:
Confidence changes required:50%
TheGetJobList
function is consistent with other similar functions. However, the error handling could be improved by providing more specific error messages.
9. pkg/query-service/app/http_handler.go:122
- Draft comment:
Do not add non-ClickHouse related functions to the ClickHouseReader interface. Use the DAO in the telemetry instance to access such information instead. This applies to the addition ofjobsRepo
and related methods. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment seems to be addressing a design concern about the ClickHouseReader interface, but the diff does not show any changes to the ClickHouseReader interface itself. The addition of 'jobsRepo' is related to inframetrics, not ClickHouseReader, so the comment might not be directly relevant to the changes made.
I might be missing the context of how 'jobsRepo' interacts with ClickHouseReader, but based on the diff, there is no direct evidence of a change to ClickHouseReader.
The comment might be preemptively addressing a potential design issue, but without evidence of a direct change to ClickHouseReader, it seems speculative.
The comment does not seem directly relevant to the changes made in the diff, as there is no evidence of a change to ClickHouseReader. The comment should be deleted.
Workflow ID: wflow_YK7sUESKk2ziB763
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
queryNamesForJobs = map[string][]string{ | ||
"cpu": {"A"}, | ||
"cpu_request": {"B", "A"}, | ||
"cpu_limit": {"C", "A"}, | ||
"memory": {"D"}, | ||
"memory_request": {"E", "D"}, | ||
"memory_limit": {"F", "D"}, | ||
"restarts": {"G", "A"}, | ||
"desired_pods": {"H"}, | ||
"active_pods": {"I"}, | ||
"failed_pods": {"J"}, | ||
"successful_pods": {"K"}, | ||
} |
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.
nit: rename a, b, c, to some better query names
eg for kafka_fetch_latency I used "latency"
reason: code readability
}, | ||
} | ||
|
||
jobQueryNames = []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K"} |
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.
if someone also uses similar pattern, the whole codebase would become tricky to decode
A, B, C, ...... X1, X2, ...., AA1 etc namings are not conventional
I will change the query names for all in another PR. |
Summary
Part of #5373
Important
Adds Kubernetes job metrics handling to the query service with new endpoints, models, and repository for job metrics queries.
APIHandler
inhttp_handler.go
with new endpoints for job attribute keys, values, and list.JobsRepo
injobs.go
for handling job metrics queries.JobListRequest
,JobListResponse
, andJobListRecord
tomodel/infra.go
.getParamsForTopJobs()
incommon.go
for job metrics aggregation.JobsRepo
injobs.go
.infra.go
to include job-related API handler functions.This description was created by for 51df0c4. It will automatically update as commits are pushed.