<% set alerts = list_alerts(itype="runtimecloud", name_pattern="^rtc_templated\.hbf_drops\.") | sort(attribute='name') %>

<% set main = create_main_layout("flow", default_width=1, default_height=1, columns=4) %>

{
    "title": "HBF drops per location",
    "type": "panel",
    "editors": [
        "ndolganov",
        "sivanichkin",
        "dldmitry",
        "qwizzy"
    ],
    "charts": [
    <% for alert in alerts %>
        <% set tags = [] %>
        <% for tg, vl in alert.tags.items() %>
            <% do tags.append("{}={}".format(tg,vl[0])) %>
        <% endfor %>
        {
            "type": "graphic",
            "title": "<< alert.description >>",
            "stacked": false,
            "yAxis": [
                {}
            ],
            "signals": [
                {
                    "color": "#37bff2",
                    "tag": "<< tags|join(";") >>",
                    "host": "<< alert.mgroups[0] >>",
                    "name": "<< alert.signal >>"
                }
            ],
            << main.coords() >>
        },
        {
            "name": "<< alert >>",
            "type": "alert",
            "title": "<< alert.description >>",
            "showThresholds": true,
            << main.coords() >>
        },
    <% endfor %>
    ]
}
