-
Notifications
You must be signed in to change notification settings - Fork 107
Ensure that metric id is always set during kafka ingestion #1687
Conversation
looking at tsdbgw, where this code came from, it seems the (undocumented) convention was that input plugins would SetId(), usually very shortly before calling Publish(). So why does the kafka publisher in master SetId() [again] when it needs to apply auto-interval detection? my suggestion is:
If you need help with this, feel free to hit me up. |
Done in 9cc9266... The publisher stuff was imported for mt-gateway, and that's the only place it's currently used. |
ok but now we still have the bug that if the auto interval stuff is invoked we have the incorrect Id set. |
bah, I misread point 2, will do |
So after doing a bit more digging, mt-gateway is already discarding metrics with an interval of In metrictank/cmd/mt-gateway/ingest/metrics.go Lines 86 to 91 in b78a563
which errors if the interval is Lines 43 to 49 in b78a563
I stripped out the publishing autointerval stuff in 5ac71f7 and made it error out if the Interval or ID is 0, and added comments to the interface making that explicit in 6c06422 |
While generating fake metric with parrot for #1680, kafka ingestion was failed due to the metric ID not being set.
This PR ensures that the metric ID is always set, instead of only setting it if
autoInterval
is true.