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

Use REST API for metrics #229

Merged
merged 1 commit into from
Aug 4, 2023
Merged

Use REST API for metrics #229

merged 1 commit into from
Aug 4, 2023

Conversation

jbeisen
Copy link
Collaborator

@jbeisen jbeisen commented Aug 3, 2023

Add an endpoint to the REST API to retrieve metrics. Use the new
endpoint in the console.

@jbeisen jbeisen force-pushed the metrics-rest branch 2 times, most recently from aef92cb to e7b2048 Compare August 4, 2023 01:30
@jbeisen jbeisen force-pushed the metrics-rest branch 2 times, most recently from 546198d to 77022cd Compare August 4, 2023 01:40
Base automatically changed from stream-output to master August 4, 2023 16:34
/// Get a job's metrics
#[utoipa::path(
get,
path = "/v1/pipelines/{pipeline_id}/jobs/{job_id}/operator_metric_groups",
Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

#[serde(rename_all = "camelCase")]
pub struct Metric {
pub time: u64,
pub value: u64,
Copy link
Member

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?

@jbeisen jbeisen force-pushed the metrics-rest branch 3 times, most recently from 09f9404 to 444fbf4 Compare August 4, 2023 21:34
@jbeisen jbeisen enabled auto-merge (rebase) August 4, 2023 21:38
@jbeisen jbeisen disabled auto-merge August 4, 2023 21:42
Add an endpoint to the REST API to retrieve metrics. Use the new
endpoint in the console.
@jbeisen jbeisen enabled auto-merge (rebase) August 4, 2023 21:44
@jbeisen jbeisen merged commit ea66bc2 into master Aug 4, 2023
@jbeisen jbeisen deleted the metrics-rest branch August 4, 2023 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants