question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
annajungcommented, May 17, 2021

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?

Note: I need to expose more than these two metrics, as I am using these metrics to aggregate results across multiple runs.

In addition, I think you’re looking for a way to show more than two metrics? Should this be part of this issue?

1reaction
Bobgycommented, May 19, 2021

Thank you @annajung ! This is still relevant, it seems removing sorting would be enough.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipeline metrics are always sorted alphabetically · Issue #5215
I have a pipeline that exposes pipeline metrics following this example. It's working great, but it seems that the metrics always appear sorted...
Read more >
Sort Data in Visualizations | GoodData Cloud Native
You can sort the data alphabetically from A to Z, or vice versa. ... the data is always sorted by the total sum...
Read more >
Can I alphabetically sort Event Types listed in the Schema ...
In the Pipelines List View, click on the Pipeline for which you want to view the Event Types. From the Tools Bar, click...
Read more >
Sorting results by metrics in a table chart format - Zendesk help
I would like to sort on any table column by clicking on the header. I can do this for the metrics, but not...
Read more >
Sorting and ordering issue lists - GitLab Docs
When you sort by Title, the issue order changes to sort alphabetically by the issue title in this order: Emoji; Special characters; Numbers ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found