-
Notifications
You must be signed in to change notification settings - Fork 232
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
Use REST API for metrics #229
Conversation
aef92cb
to
e7b2048
Compare
546198d
to
77022cd
Compare
/// Get a job's metrics | ||
#[utoipa::path( | ||
get, | ||
path = "/v1/pipelines/{pipeline_id}/jobs/{job_id}/operator_metric_groups", |
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.
operator_metric_groups
is a bit long, maybe just operator_metrics
?
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.
Sure, I guess, but to follow the REST convention of plural nouns implying being collections then we'll need to name this struct/object like this:
pub struct OperatorMetric {
pub operator_id: String,
pub metric_groups: Vec<MetricGroup>,
}
...which is weird because it's not a single metric. This kind of naming problem is kind of a consequence of too many levels of nesting in api objects.
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.
I'll try to come up with something better though.
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.
I actually think this is the best option even though it's long. Let me know if you have any other ideas.
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.
sounds good
arroyo-api/src/rest_types.rs
Outdated
#[serde(rename_all = "camelCase")] | ||
pub struct Metric { | ||
pub time: u64, | ||
pub value: u64, |
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.
in this protobuf this is a double, should this be f64
?
09f9404
to
444fbf4
Compare
Add an endpoint to the REST API to retrieve metrics. Use the new endpoint in the console.
Add an endpoint to the REST API to retrieve metrics. Use the new
endpoint in the console.