-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tag propagation for temporal functions #1307
Conversation
Note: I also refactored the tests to deduplicate a bit; I thought I would need it, and figured I might as well leave it even though I didn't. |
expectedSeriesMetas[0].Name = "t1=v1," | ||
expectedSeriesMetas[1].Name = "t1=v2," | ||
|
||
assert.Equal(t, expectedSeriesMetas, sink.Metas, "Process should pass along series meta, renaming by ID") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: renaming to ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
assert.Len(t, sink.Values, 4, "output from both blocks") | ||
compareCacheState(t, bNode, bounds, []bool{false, false}, "everything removed from cache") | ||
blks, err := bNode.cache.multiGet(bounds, 2, false) | ||
assert.Len(t, tc.Sink.Values, 4, "output from both tc.Blocks") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: copy/paste error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops yeah thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but make sure to squash down the description on merge since it reads really weirdly on git log
0fda4ef
to
2d44293
Compare
Temporal functions don't properly propagate series tags (thanks to @arnikola for suggesting this as the bug!). For instance, given series: ``` coordinator_engine_datapoints{type="fetched"} 1386 coordinator_engine_datapoints{type="generated"} 104 ``` a query like increase(coordinator_engine_datapoints[5s]) will return ``` { "__name__": "coordinator_engine_datapoints", "instance": "host.docker.internal:7203", "job": "coordinator", "role": "remote" } { "__name__": "coordinator_engine_datapoints", "instance": "host.docker.internal:7203", "job": "coordinator", "role": "remote" } ``` dropping tags. Querying the same range without increase gives all tags, as expected. Fix is simple; we weren't copying tags into the new block's SeriesMetas; now we do.
I ran into this bug locally today--temporal functions don't properly propagate series tags (thanks to @arnikola for suggesting this as the bug!).
For instance, given series:
a query like
increase(coordinator_engine_datapoints[5s])
will returndropping tags. Query the same range without
increase
gives all tags, as expected.Fix is simple; we weren't copying tags into the new block's
SeriesMetas
; now we do.