Skip to content
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

Sync with Prometheus up to 2023-04-14 (7309ac27) #480

Merged
merged 36 commits into from
Apr 18, 2023

Commits on Mar 13, 2023

  1. tsdb: Replay m-map chunk only when required

    M-map chunks replayed on startup are discarded if there
    was no WAL and no snapshot loaded, because there is no
    series created in the Head that it can map to. So only
    load m-map chunks from disk if there is either a snapshot
    loaded or there is WAL on disk.
    
    Signed-off-by: Ganesh Vernekar <[email protected]>
    codesome committed Mar 13, 2023
    Configuration menu
    Copy the full SHA
    c9d06f2 View commit details
    Browse the repository at this point in the history
  2. tsdb: Test querying after missing wbl with snapshots enabled

    If the snapshot was enabled with some ooo mmap chunks on disk,
    and wbl was removed between restarts, then we should still be able
    to query the ooo mmap chunks after a restart. This test shows that
    we are not able to query those ooo mmap chunks after a restart
    under this situation.
    
    Signed-off-by: Ganesh Vernekar <[email protected]>
    codesome committed Mar 13, 2023
    Configuration menu
    Copy the full SHA
    1c3f121 View commit details
    Browse the repository at this point in the history
  3. tsdb: Update OOO min/max time properly after replaying m-map chunks

    Without this fix, if snapshots were enabled, and wbl goes missing
    between restarts, then TSDB does not recognize that there are ooo
    mmap chunks on disk and we cannot query them until those chunks
    are compacted into blocks.
    
    Signed-off-by: Ganesh Vernekar <[email protected]>
    codesome committed Mar 13, 2023
    Configuration menu
    Copy the full SHA
    2af44f9 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2023

  1. labels: simplify call to get Labels from Builder

    It took a `Labels` where the memory could be re-used, but in practice
    this hardly ever benefitted. Especially after converting `relabel.Process`
    to `relabel.ProcessBuilder`.
    
    Comparing the parameter to `nil` was a bug; `EmptyLabels` is not `nil`
    so the slice was reallocated multiple times by `append`.
    
    Lastly `Builder.Labels()` now estimates that the final size will depend
    on labels added and deleted.
    
    Signed-off-by: Bryan Boreham <[email protected]>
    bboreham committed Mar 22, 2023
    Configuration menu
    Copy the full SHA
    b987afa View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2023

  1. remote-write: raise default samples per send to 2,000

    Larger messages cost less, because the per-message overheads at sender
    and receiver are spread over more samples.
    
    Example: scraping 1.5 million series every 15 seconds will send 50
    messages per second.
    
    Previous default was 500.
    
    Signed-off-by: Bryan Boreham <[email protected]>
    bboreham committed Mar 31, 2023
    Configuration menu
    Copy the full SHA
    2fc2e23 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2023

  1. remote-write: adjust MaxShards and Capacity for larger MaxSamplesPerSend

    Keep the target throughput and total pending samples the same.
    
    Signed-off-by: Bryan Boreham <[email protected]>
    bboreham committed Apr 2, 2023
    Configuration menu
    Copy the full SHA
    889ef99 View commit details
    Browse the repository at this point in the history
  2. labels: make sure estimated size is not negative

    Deleted labels are remembered, even if they were not in `base` or were
    removed from `add`, so `base+add-del` could go negative.
    
    Signed-off-by: Bryan Boreham <[email protected]>
    bboreham committed Apr 2, 2023
    Configuration menu
    Copy the full SHA
    e917202 View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2023

  1. build(deps): bump github.com/Azure/go-autorest/autorest/adal

    Bumps [github.com/Azure/go-autorest/autorest/adal](https://github.com/Azure/go-autorest) from 0.9.22 to 0.9.23.
    - [Release notes](https://github.com/Azure/go-autorest/releases)
    - [Changelog](https://github.com/Azure/go-autorest/blob/main/CHANGELOG.md)
    - [Commits](Azure/go-autorest@autorest/adal/v0.9.22...autorest/adal/v0.9.23)
    
    ---
    updated-dependencies:
    - dependency-name: github.com/Azure/go-autorest/autorest/adal
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    dependabot[bot] authored Apr 3, 2023
    Configuration menu
    Copy the full SHA
    c8b408c View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2023

  1. Allow populate block logic in compact to be overriden outside Prometh…

    …eus (#11711)
    
    Signed-off-by: Alex Le <[email protected]>
    Signed-off-by: Alex Le <[email protected]>
    alexqyle authored Apr 4, 2023
    Configuration menu
    Copy the full SHA
    1936868 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #12173 from bboreham/builder-no-empty-labels

    labels: simplify call to get Labels from Builder
    codesome authored Apr 4, 2023
    Configuration menu
    Copy the full SHA
    5588cab View commit details
    Browse the repository at this point in the history
  3. Merge pull request #12127 from codesome/ooo-mmap-replay

    Update OOO min/max time properly after replaying m-map chunks
    codesome authored Apr 4, 2023
    Configuration menu
    Copy the full SHA
    e709b0b View commit details
    Browse the repository at this point in the history
  4. Merge pull request #12203 from bboreham/raise-max-samples-per-send

    remote-write: raise default samples per send to 2,000
    csmarchbanks authored Apr 4, 2023
    Configuration menu
    Copy the full SHA
    044b3ec View commit details
    Browse the repository at this point in the history
  5. Generalized rule group iteration evaluation hook (#11885)

    Signed-off-by: Soon-Ping Phang <[email protected]>
    soonping-amzn authored Apr 4, 2023
    Configuration menu
    Copy the full SHA
    6cecb87 View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2023

  1. Check health & ready: move to flags (#12223)

    This makes it more consistent with other command like import rules. We
    don't have stricts rules and uniformity accross promtool unfortunately,
    but I think it's better to only have the http config on relevant check
    commands to avoid thinking Prometheus can e.g. check the config over the
    wire.
    
    Signed-off-by: Julien Pivotto <[email protected]>
    roidelapluie authored Apr 5, 2023
    Configuration menu
    Copy the full SHA
    3914731 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #12216 from prometheus/dependabot/go_modules/githu…

    …b.com/Azure/go-autorest/autorest/adal-0.9.23
    
    build(deps): bump github.com/Azure/go-autorest/autorest/adal from 0.9.22 to 0.9.23
    roidelapluie authored Apr 5, 2023
    Configuration menu
    Copy the full SHA
    8dba916 View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2023

  1. Add support for native histograms to concreteSeriesIterator

    Signed-off-by: Justin Lei <[email protected]>
    leizor committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    83f4398 View commit details
    Browse the repository at this point in the history
  2. Update storage/remote/codec.go

    Co-authored-by: Björn Rabenstein <[email protected]>
    Signed-off-by: Justin Lei <[email protected]>
    leizor and beorn7 committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    f90013a View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2023

  1. tsdb: Improve a couple of histogram documentation comments

    Signed-off-by: Arve Knudsen <[email protected]>
    aknuds1 committed Apr 7, 2023
    Configuration menu
    Copy the full SHA
    cca7178 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2023

  1. Merge pull request #12192 from leizor/leizor/prometheus/issues/11204

    Add support for native histograms to concreteSeriesIterator
    beorn7 authored Apr 11, 2023
    Configuration menu
    Copy the full SHA
    6e0a469 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2023

  1. Merge pull request #12234 from aknuds1/chore/improve-histogram-comments

    tsdb: Improve a couple of histogram documentation comments
    beorn7 authored Apr 12, 2023
    Configuration menu
    Copy the full SHA
    8ed90b5 View commit details
    Browse the repository at this point in the history
  2. Rename PopulateBlockFunc to BlockPopulator

    Signed-off-by: Alex Le <[email protected]>
    alexqyle committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    01d0dda View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2023

  1. labels: add ScratchBuilder.Overwrite for slice implementation

    This is a method used by some downstream projects; it was created to
    optimize the implementation in `labels_string.go` but we should have one
    for both implementations so the same code works with either.
    
    Signed-off-by: Bryan Boreham <[email protected]>
    bboreham committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    10cc60a View commit details
    Browse the repository at this point in the history
  2. Merge pull request #12259 from bboreham/labels-overwrite

    labels: add ScratchBuilder.Overwrite for slice implementation
    bwplotka authored Apr 13, 2023
    Configuration menu
    Copy the full SHA
    136b488 View commit details
    Browse the repository at this point in the history
  3. promql: Separate Point into FPoint and HPoint

    In other words: Instead of having a “polymorphous” `Point` that can
    either contain a float value or a histogram value, use an `FPoint` for
    floats and an `HPoint` for histograms.
    
    This seemingly small change has a _lot_ of repercussions throughout
    the codebase.
    
    The idea here is to avoid the increase in size of `Point` arrays that
    happened after native histograms had been added.
    
    The higher-level data structures (`Sample`, `Series`, etc.) are still
    “polymorphous”. The same idea could be applied to them, but at each
    step the trade-offs needed to be evaluated.
    
    The idea with this change is to do the minimum necessary to get back
    to pre-histogram performance for functions that do not touch
    histograms. Here are comparisons for the `changes` function. The test
    data doesn't include histograms yet. Ideally, there would be no change
    in the benchmark result at all.
    
    First runtime v2.39 compared to directly prior to this commit:
    
    ```
    name                                                  old time/op    new time/op    delta
    RangeQuery/expr=changes(a_one[1d]),steps=1-16            391µs ± 2%     542µs ± 1%  +38.58%  (p=0.000 n=9+8)
    RangeQuery/expr=changes(a_one[1d]),steps=10-16           452µs ± 2%     617µs ± 2%  +36.48%  (p=0.000 n=10+10)
    RangeQuery/expr=changes(a_one[1d]),steps=100-16         1.12ms ± 1%    1.36ms ± 2%  +21.58%  (p=0.000 n=8+10)
    RangeQuery/expr=changes(a_one[1d]),steps=1000-16        7.83ms ± 1%    8.94ms ± 1%  +14.21%  (p=0.000 n=10+10)
    RangeQuery/expr=changes(a_ten[1d]),steps=1-16           2.98ms ± 0%    3.30ms ± 1%  +10.67%  (p=0.000 n=9+10)
    RangeQuery/expr=changes(a_ten[1d]),steps=10-16          3.66ms ± 1%    4.10ms ± 1%  +11.82%  (p=0.000 n=10+10)
    RangeQuery/expr=changes(a_ten[1d]),steps=100-16         10.5ms ± 0%    11.8ms ± 1%  +12.50%  (p=0.000 n=8+10)
    RangeQuery/expr=changes(a_ten[1d]),steps=1000-16        77.6ms ± 1%    87.4ms ± 1%  +12.63%  (p=0.000 n=9+9)
    RangeQuery/expr=changes(a_hundred[1d]),steps=1-16       30.4ms ± 2%    32.8ms ± 1%   +8.01%  (p=0.000 n=10+10)
    RangeQuery/expr=changes(a_hundred[1d]),steps=10-16      37.1ms ± 2%    40.6ms ± 2%   +9.64%  (p=0.000 n=10+10)
    RangeQuery/expr=changes(a_hundred[1d]),steps=100-16      105ms ± 1%     117ms ± 1%  +11.69%  (p=0.000 n=10+10)
    RangeQuery/expr=changes(a_hundred[1d]),steps=1000-16     783ms ± 3%     876ms ± 1%  +11.83%  (p=0.000 n=9+10)
    ```
    
    And then runtime v2.39 compared to after this commit:
    
    ```
    name                                                  old time/op    new time/op    delta
    RangeQuery/expr=changes(a_one[1d]),steps=1-16            391µs ± 2%     547µs ± 1%  +39.84%  (p=0.000 n=9+8)
    RangeQuery/expr=changes(a_one[1d]),steps=10-16           452µs ± 2%     616µs ± 2%  +36.15%  (p=0.000 n=10+10)
    RangeQuery/expr=changes(a_one[1d]),steps=100-16         1.12ms ± 1%    1.26ms ± 1%  +12.20%  (p=0.000 n=8+10)
    RangeQuery/expr=changes(a_one[1d]),steps=1000-16        7.83ms ± 1%    7.95ms ± 1%   +1.59%  (p=0.000 n=10+8)
    RangeQuery/expr=changes(a_ten[1d]),steps=1-16           2.98ms ± 0%    3.38ms ± 2%  +13.49%  (p=0.000 n=9+10)
    RangeQuery/expr=changes(a_ten[1d]),steps=10-16          3.66ms ± 1%    4.02ms ± 1%   +9.80%  (p=0.000 n=10+9)
    RangeQuery/expr=changes(a_ten[1d]),steps=100-16         10.5ms ± 0%    10.8ms ± 1%   +3.08%  (p=0.000 n=8+10)
    RangeQuery/expr=changes(a_ten[1d]),steps=1000-16        77.6ms ± 1%    78.1ms ± 1%   +0.58%  (p=0.035 n=9+10)
    RangeQuery/expr=changes(a_hundred[1d]),steps=1-16       30.4ms ± 2%    33.5ms ± 4%  +10.18%  (p=0.000 n=10+10)
    RangeQuery/expr=changes(a_hundred[1d]),steps=10-16      37.1ms ± 2%    40.0ms ± 1%   +7.98%  (p=0.000 n=10+10)
    RangeQuery/expr=changes(a_hundred[1d]),steps=100-16      105ms ± 1%     107ms ± 1%   +1.92%  (p=0.000 n=10+10)
    RangeQuery/expr=changes(a_hundred[1d]),steps=1000-16     783ms ± 3%     775ms ± 1%   -1.02%  (p=0.019 n=9+9)
    ```
    
    In summary, the runtime doesn't really improve with this change for
    queries with just a few steps. For queries with many steps, this
    commit essentially reinstates the old performance. This is good
    because the many-step queries are the one that matter most (longest
    absolute runtime).
    
    In terms of allocations, though, this commit doesn't make a dent at
    all (numbers not shown). The reason is that most of the allocations
    happen in the sampleRingIterator (in the storage package), which has
    to be addressed in a separate commit.
    
    Signed-off-by: beorn7 <[email protected]>
    beorn7 committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    c0879d6 View commit details
    Browse the repository at this point in the history
  4. storage: Use separate sample types for histogram vs. float

    Previously, we had one “polymorphous” `sample` type in the `storage`
    package. This commit breaks it up into `fSample`, `hSample`, and
    `fhSample`, each still implementing the `tsdbutil.Sample` interface.
    
    This reduces allocations in `sampleRing.Add` but inflicts the penalty
    of the interface wrapper, which makes things worse in total.
    
    This commit therefore just demonstrates the step taken. The next
    commit will tackle the interface overhead problem.
    
    Signed-off-by: beorn7 <[email protected]>
    beorn7 committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    630bcb4 View commit details
    Browse the repository at this point in the history
  5. storage: add specialized buffers to sampleRing

    This utilizes the fact that most sampleRings will only contain samples
    of one type. In this case, the generic interface is circumvented, and
    a bespoke buffer for the one actually occurring sample type is
    used. Should a sampleRing receive a sample of a different kind later,
    it will transparently switch to the generic behavior.
    
    Signed-off-by: beorn7 <[email protected]>
    beorn7 committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    462240b View commit details
    Browse the repository at this point in the history
  6. Name float values as "floats", not as "values"

    In the past, every sample value was a float, so it was fine to call a
    variable holding such a float "value" or "sample". With native
    histograms, a sample might have a histogram value. And a histogram
    value is still a value. Calling a float value just "value" or "sample"
    or "V" is therefore misleading. Over the last few commits, I already
    renamed many variables, but this cleans up a few more places where the
    changes are more invasive.
    
    Note that we do not to attempt naming in the JSON APIs or in the
    protobufs. That would be quite a disruption. However, internally, we
    can call variables as we want, and we should go with the option of
    avoiding misunderstandings.
    
    Signed-off-by: beorn7 <[email protected]>
    beorn7 committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    817a239 View commit details
    Browse the repository at this point in the history
  7. promql: Do not return nil slices to the pool

    Signed-off-by: beorn7 <[email protected]>
    beorn7 committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    551de03 View commit details
    Browse the repository at this point in the history
  8. storage: Manually expand genericAdd for specific types

    This commit is doing what I would have expected that Go generics do
    for me. However, the PromQL benchmarks show a significant runtime and
    allocation increase with `genericAdd`, so this replaces it with
    hand-coded non-generic versions of it.
    
    Signed-off-by: beorn7 <[email protected]>
    beorn7 committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    717a3f8 View commit details
    Browse the repository at this point in the history
  9. Merge pull request #11687 from prometheus/beorn7/histogram

    histograms: Optimize query performance
    beorn7 authored Apr 13, 2023
    Configuration menu
    Copy the full SHA
    6b8573a View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2023

  1. Merge pull request #12257 from alexqyle/block-populator-rename

    Rename PopulateBlockFunc to BlockPopulator
    codesome authored Apr 14, 2023
    Configuration menu
    Copy the full SHA
    7309ac2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1570114 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a537d6c View commit details
    Browse the repository at this point in the history
  4. Fix bugs from merge

    zenador committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    894f657 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2023

  1. Configuration menu
    Copy the full SHA
    c22b4ac View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8bf0d6f View commit details
    Browse the repository at this point in the history