Table panel sort by severity (info / warning / critical)

Hi, we are using the table panel to display prometheus alerts like

alertname severity additionalinfo
alert1 critical something
alert2 info something
alert3 warning something
  • What Grafana version and what operating system are you using?
    9.2.2

  • What are you trying to achieve?
    Sort the table by severity NOT alphabetically but in order “critical”, “warning”, “info”

  • How are you trying to achieve it?
    Transformation sort is sorting alphabetically/numerically by a column.
    I was looking for a transformation to map a string to a numeric value like
    “critical=>1, warning=>2, info=3” , to then sort by the new colum, however I didn’t find that in Grafana.

  • What happened?
    I run out of ideas what I could try :slight_smile:

  • What did you expect to happen?
    Sorting by the real level of severity.

Thanks in advance

This is the way I was able to sort the table by severity:

add a CSV data source with a local csv file:

severity,code
info,10
warning,20
critical,30

add that data source in my panel

add a transformation → join

sort by code