Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
ensure that metric id is set by mt-gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzoh committed Feb 26, 2020
1 parent be61fff commit 1971826
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions cmd/mt-gateway/ingest/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func prepareIngest(in []*schema.MetricData, toPublish []*schema.MetricData) ([]*
promDiscards.Add(m.OrgId, err.Error())
continue
}
m.SetId()
metricTimestamp = getMetricsTimestampStat(m.OrgId)
metricTimestamp.ValueUint32(uint32(m.Time))
toPublish = append(toPublish, m)
Expand Down
1 change: 0 additions & 1 deletion publish/kafka/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ func (m *mtPublisher) Publish(metrics []*schema.MetricData) error {
if m.autoInterval {
_, s := m.schemas.Match(metric.Name, 0)
metric.Interval = s.Retentions.Rets[0].SecondsPerPoint
metric.SetId()
} else {
log.Error("interval is 0 but can't deduce interval automatically. this should never happen")
return errors.New("need to deduce interval but cannot")
Expand Down

0 comments on commit 1971826

Please sign in to comment.