Series is shown twice in the legend

Hey Grafana folks! I’m trying to show the totals of two series, so my two metrics look like this:

alias(summarize(exclude(stats.counts.com.xxx.imports.zzz.parser.parse.*, 'regex'), '10m', 'sum', false), 'Non regex parses')

alias(summarize(stats.counts.com.xxx.imports.zzz.parser.error.*, '10m', 'sum', false), 'Parse errors')

The chart shows each series twice in the chart.

Am I making some basic error here? I just want to show the total of stats.counts.com.xxx.imports.zzz.parser.parse.*, excluding regex items, and the total of stats.counts.com.xxx.imports.zzz.parser.error.*.

I’ve summarized the series in 10 minute groupings. Here’s my query (with data series cut out to keep it short):

{
  "xhrStatus": "complete",
  "request": {
    "method": "POST",
    "url": "api/data/render",
    "data": "target=alias(summarize(exclude(stats.counts.com.xxx.imports.zzz.parser.parse.*%2C%20'regex')%2C%20'10min'%2C%20'sum'%2C%20false)%2C%20'Non%20regex%20parses')&target=alias(summarize(stats.counts.com.xxx.imports.zzz.parser.error.*%2C%20'10min'%2C%20'sum'%2C%20false)%2C%20'Parse%20errors')&from=-6h&until=now&format=json&maxDataPoints=764"
  },
  "response": [
    {
      "target": "Non regex parses",
      "datapoints": [
        // ...
      ]
    },
    {
      "target": "Non regex parses",
      "datapoints": [
        // ..
      ]
    },
    {
      "target": "Parse errors",
      "datapoints": [
        // ..
      ]
    },
    {
      "target": "Parse errors",
      "datapoints": [
       // ..
      ]
    }
  ]
}

I’ve figured it out. If you have * in a series, Grafana shows each metric encompassed by the wildcard separately. So if * gathers three different metrics, they’ll be shown as separate items in the legend. You need to add the data for all the metrics together using the sumSeries function.