Pipeline metrics are always sorted alphabetically
See original GitHub issue/kind bug
I have a pipeline that exposes pipeline metrics following this example. It’s working great, but it seems that the metrics always appear sorted alphabetically. I would like to make use of the fact that the first two metrics are displayed next to each run in the run list view, but the two metrics I’m interested in are not the first two in alphabetical order.
Note: I need to expose more than these two metrics, as I am using these metrics to aggregate results across multiple runs.
Am I doing something wrong? Is there a way to not sort the metrics alphabetically?
For context, here is the code I’m using to expose the metrics:
def write_metrics_data(kpis: dict):
metrics = {
'metrics': [
{
'name': name,
'numberValue': value,
'format': "PERCENTAGE" if 'percent' in name else "RAW",
}
for name, value in kpis.items()
]
}
myjson.write(metrics, Path('/mlpipeline-metrics.json'))
and this is the header row as displayed in the Run Output tab:
activeTrips | dropsPerHour | idleHours | kilometresPerDrop | kilometresPerHour | percentReloads | ...
which seems to be in alphabetical order. However, if I do:
print(kpis.keys())
I get this:
['dropsPerHour', 'unscheduled', 'activeTrips', 'totalHours', ...]
which isn’t in alphabetical order. And the two metrics I’m interested in are the first two ones in this list.
Environment:
- Kubeflow version: 1.0.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
Hi @Bobgy @ypitrey, a new contributor here looking for a good first issue to work on. I like to work on this issue if this is still relevant & have a few questions to clarify the ask.
Is the ask to simply remove the sorting of metrics or to create a functionality that a user can choose the metrics that show up on the UI?
In addition, I think you’re looking for a way to show more than two metrics? Should this be part of this issue?
Thank you @annajung ! This is still relevant, it seems removing sorting would be enough.