Add analyze histograms command to promtool#12331
Conversation
0d02a8e to
97bc6aa
Compare
97bc6aa to
508abc2
Compare
There was a problem hiding this comment.
Finally I got to reviewing this.
There are a few low-level comments sprinkled in that I wrote on the fly, but this is not intended to be a code level review, more about the general approach.
My thoughts, starting from very high level to somewhat code structure specific in the end:
- First and foremost, a thought that just crossed my mind right now at the end of the review (when I got more or less the full picture): It now seems to me that you would like to look at the samples as they are spaced in the TSDB, and not necessarily with the spacing of the
stepparameter in the range query. (Which would also explain why you used the term "scrape interval", which was confusing to me until now, as you can see in the comments.) Should that assumption be correct, then how about this: Rather than a range query, you could run an instant query with a range selector, e.g. rather than a range query formy_histogram_bucketwith--startof x,--endof y, and--stepof z, you could run an instant query formy_histogram_bucket[<duration>], where<duration>is y-x and the time parameter of the instant query is y. You don't need the step anymore because the range selector will select all the samples with the timestamps as they are stored in TSDB. If that approach makes sense, then most of my comments so far have to be changed or disregarded… - I need to understand the point of the analysis. Counting changed buckets appears weird to me. As discussed elsewhere, there is the aspect of storage space needed, but that should better happen on the block level (maybe as a sub-command to
promtool tsdb analyze), but on the higher level of a query, I would probably just count buckets (maybe marking unpopulated classical buckets specially as they hint towards savings with native histograms – a general estimation how much more or less resources a move to native histograms is still very difficult because you will most likely have higher resolution with native histograms but fewer series, so maybe more data to churn through but less of the cost per series). - I don't think we should try to automatically detect all the histograms present on the Prometheus server. It's potentially too expensive and potentially not complete. Better use matchers, see comments for details.
- I think we should not have a top level
analyzecommand but rather a sub-command ofquery. Again see comments for details. - There is a lot of code for querying a Prometheus API endpoint already in main.go. The new code in this PR partially replicates that code. However, the current code in main.go is tailored for the use case of directly dumping the result of a query. Still I think there are many parts that can be re-used, maybe by creating a new file
query.gowith the common parts.
I'm aware that there are a lot of different thoughts on different levels in my review. I guess we should first resolve the high-level thoughts because everything else might change accordingly. We can chat directly about it if you prefer.
cmd/promtool/analyze.go
Outdated
| countBucketsChanged := 0 | ||
| for bIdx := range matrix { | ||
| if curr[bIdx] > prev[bIdx] { | ||
| countBucketsChanged++ |
There was a problem hiding this comment.
Why are you counting the buckets that have changed? (Also note that classical buckets are cumulative, i.e. if a low bucket changes, all bucket above it will change, too.) If we really wanted to see storage cost, we would need to simulate the XOR encoding between the two samples.
Maybe it would be interested to count buckets that are empty if you "de-cumulate" them, i.e. a zero difference to the next lower bucket. (Those buckets would have a much more reduced cost in native histograms.)
In general, the highest cost in classic histogram is the existence of a bucket itself (creates a series even if the bucket is never really used, i.e. would be unpopulated in non-cumulative representation).
But for better ideas, I first need to understand the goal of the analysis, which I probably have not yet.
There was a problem hiding this comment.
This code already takes into account the cumulative nature of classic buckets, notice how it is only the indexes that's used from the original matrix, but the absolute bucket values are used in the comparison.
As for the why: it is important to get an idea about how many buckets are in use and changed - not for the classic histograms as you say, but for making predictions/getting patterns for the native histograms.
There was a problem hiding this comment.
But what patterns are you looking for? What are you trying to predict? My guess is that it is about storage cost. The correlation between storage cost and bucket changes is, however, more complicated than just "the bucket has (not) changed" (which I tried to hint at above). But maybe you are up for something else, and that's what I need to understand first.
cmd/promtool/analyze.go
Outdated
|
|
||
| countBucketsChanged := 0 | ||
| for bIdx := range matrix { | ||
| if curr[bIdx] > prev[bIdx] { |
There was a problem hiding this comment.
In principle, the bucket layout of a classic histogram could change (something to be avoided, but can happen, usually after deciding to need a new layout and subsequent deployment of a differently instrumented binary). In that case, the results here would be off (or we could even exceed the slice size?). So maybe we should also analyze changes in the bucket layout (look at total number of buckets, but also le labels).
cmd/promtool/analyze.go
Outdated
| for bucket, currCount := range curr { | ||
| prevCount, ok := prev[bucket] | ||
| if !ok { | ||
| countBucketsChanged++ |
There was a problem hiding this comment.
Again, I don't think that counting changed buckets is a good indicator for resource cost.
Unpopulated buckets (which have a very small cost, ideally zero) are already not returned by the API. Just counting returned buckets should be a better indicator. (But note that a native histogram bucket is less costly than a classic histogram bucket. The former is just an additional piece of data in the complex sample structure while the latter is its own series.)
If you wanted to, you could try to guess if the bucket is encoded with XOR or with double-delta, and then estimate storage cost, but that gets really close into reimplementing the whole encoding of histograms. As already discussed separately, to go down that alley it would be better to analyze the histograms on the block level, where you can directly see how much storage they take.
f884b38 to
89808e0
Compare
beorn7
left a comment
There was a problem hiding this comment.
This isn't a complete review yet. I focused mostly on the query structure because that will change a lot of the other code. Please see my comments and let me know what you think.
|
The other high level point is what we want to analyze at all. I try to draw conclusions from our discussions so far and to describe the rough idea based on them: First of all, it seems pretty clear that a detailed analysis of storage size isn't feasible based on queries. If needed, we can add a So what is left to do here? I also think it's pretty clear that counting buckets that have changed isn't really getting us meaningful insights. What I would do for native histograms: Count the number of populated buckets for each sample. (I believe unpopulated buckets are not returned by the API anyway, so it boils down to just counting buckets.) For each histogram series, you could print out the min/max/avg number of buckets seen for a single sample and most importantly the total number of buckets, i.e. for each sample, add the number of buckets to a grand total. The latter should be a pretty good approximation of the cost of the histogram (exposition, scraping, encoding, storing), deliberately ignoring more subtle aspects (how often do I have to re-encode the chunk, how many 0-values do I have to add in the chunk because late in the chunk the histogram suddenly got way more buckets, ...). What I would do for classic histograms: The bucket count is kind of obvious because it is mostly static (with the rare exception of a change in bucket layout). But it would be interesting to see how many buckets are "unpopulated". So you could display the number of bucket series (maybe to min/max/avg just in case there is a change) and then display the same numbers, but this time leave out "unpopulated" buckets. Note that "unpopulated" means that the difference to the previous bucket "to the left" is zero because the classic buckets are cumulative. And then we could estimate the cost a classic histogram would have if converted to a native histogram. This would just be a "worst case" estimate, in the following way: The analysis is done for different resolutions (let's say schema 2, 3, and 4 by default, but the user could provide other resolutions). Then we need to map native buckets to the classic buckets. Usually, there will be many native buckets corresponding to one classic bucket. But the opposite is possible, too. (A high resolution classic histogram mapped into a very low resolution native histogram, with negative schema.) And of course, the boundaries with buckets generally won't coincide, so there will be native buckets overlapping with two (or more) neighboring classic buckets, and vice versa. In our first approach, we could map to the bucket with the largest overlap. Next step is to assume equal distribution of samples within the classic bucket and populate the native buckets accordingly. Which means, with many samples in the classic buckets, we'll just populate all native buckets overlapping with the classic bucket, but we should not populate more buckets than samples exist in the corresponding classic buckets. In the end, we get an idea how many native buckets will be populated (in the worst case, i.e. equal distribution) for different resolutions. The analysis in the last paragraph is the really sophisticated one. I would suggest to only implement the simple bucket counts described above. Then we can work on the more sophisticated analysis with all the other parts in place. WDYT? Happy to discuss this in more detail, here or in a call. (But I'm only back at work next Tuesday.) |
bea7683 to
318bc0d
Compare
262e28f to
7ab2743
Compare
|
Let me know when this is ready for the next round of review. |
beorn7
left a comment
There was a problem hiding this comment.
I have just commented on the "single query approach". I still think it is possible, even with classic histograms, see comments.
I assume you haven't processed my earlier comment about what statistics we actually want to track, so I haven't commented on the statistics part again.
|
Aren't the statistics already tracking what you want? We have the number of populated buckets for both native and classic histograms, see the examples in the first comment. |
Maybe. It's hard to figure out exactly because the code is collecting so many stats at the moment. I would like to start with stats for which we know that they are useful. Or at least we expect them to be useful. My lengthy earlier comment tried to find out and discuss what stats are useful. I'll be happily convinced that others are useful, too, but we cannot merge this with a lot of stats that are probably not useful. It will be confusing to our many users, while at the same time some users might start to rely on it (perhaps for bad reasons), and then it will be hard to retract the feature. It will be technically a breaking change in any case if we take anything back. That's why I would like to start with an MVP of which we are certain it works the way we want, and which we can merge, so that users can play with it. It's also very satisfying for us to get something smaller merged soon rather than trying to implement many things in the same PR and taking a long time to get everything ready for merging. |
|
I think @krajorama wanted the other stats though, WDYT? |
e642b81 to
4b26ef9
Compare
|
@krajorama is probably still on vacation. IIRC we discussed the stats with him, and we more or less agreed to start with the simple stats I'm proposing here. (It's always easy to resurrect the more complex stuff from your commit history.) |
|
Is this ready for another round of review? |
|
@zenador @beorn7 Related to the statistics to show suggestion: sounds reasonable for the public prometheus tool. The reason I wanted to see more statistics was because I don't know what were looking for exactly. But as discussed in real life we can make a more sophisticated version of the tool in a fork (e.g. zenador repo) to test things before pushing upstream. @zenador Related to the question of querying specific metric(s) in one go or all metrics by iterating through:
|
|
I think the use cases are totally valid, but the answers are really hard. First of all, a lot depends on the parameter you'd pick for the native histograms:
Since we cannot guess the shape of a distribution at higher resolution, and since we cannot know how the more partitioned histogram metric will look like, we simply cannot make those predictions, even if the user could tell us about their plans for partitioning and higher resolution. Looking at the number of empty buckets in a classic histogram gives you an idea how many buckets you will have to track (if you stay at a similar resolution and with the same partitioning, which is probably not a very common scenario). On top, we can probably come up with a factor how much cheaper a bucket within a native histogram is compared to a bucket within a classic histogram (which equals the effort of a whole series). However, for really hard numbers, you just have to try it out, and then you have to look at the actual storage needed on disk. The guesswork we can do from queries and prior to the actual conversion is IMHO very vague, and that's based on first principles. There is not much we can do. And tracking unpopulated buckets seems to be the best base to guess from. The next thing would probably be to mimic the native histogram compression algorithm. But that would be a lot of effort I'm not sure it's worth it. Just tracking the number of changing buckets alone would be too simplistic to yield meaningful results IMHO. |
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
Signed-off-by: Jeanette Tan <[email protected]>
6ae6bd4 to
806a6a6
Compare
Signed-off-by: Jeanette Tan <[email protected]>
|
Very nice. Than you very much for all the work. Let's see what people do with this feature. We can then revisit and see what other analyse tools we want to add. |
* consoles: exclude iowait and steal from CPU Utilisation 'iowait' and 'steal' indicate specific idle/wait states, which shouldn't be counted into CPU Utilisation. Also see prometheus-operator/kube-prometheus#796 and kubernetes-monitoring/kubernetes-mixin#667. Per the iostat man page: %idle Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request. %iowait Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request. %steal Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor. Signed-off-by: Julian Wiedmann <[email protected]> * tsdb: shrink txRing with smaller integers 4 billion active transactions ought to be enough for anyone. Signed-off-by: Bryan Boreham <[email protected]> * tsdb: create isolation transaction slice on demand When Prometheus restarts it creates every series read in from the WAL, but many of those series will be finished, and never receive any more samples. By defering allocation of the txRing slice to when it is first needed, we save 32 bytes per stale series. Signed-off-by: Bryan Boreham <[email protected]> * add cluster variable to Overview dashboard Signed-off-by: Erik Sommer <[email protected]> * promql: simplify Native Histogram arithmetics Signed-off-by: Linas Medziunas <[email protected]> * Cut 2.49.0-rc.0 (#13270) * Cut 2.49.0-rc.0 Signed-off-by: bwplotka <[email protected]> * Removed the duplicate. Signed-off-by: bwplotka <[email protected]> --------- Signed-off-by: bwplotka <[email protected]> * Add unit protobuf parser Signed-off-by: Arianna Vespri <[email protected]> * Go on adding protobuf parsing for unit Signed-off-by: Arianna Vespri <[email protected]> * ui: create a reproduction for #13292 Signed-off-by: machine424 <[email protected]> * Get conditional right Signed-off-by: Arianna Vespri <[email protected]> * Get VM Scale Set NIC (#13283) Calling `*armnetwork.InterfacesClient.Get()` doesn't work for Scale Set VM NIC, because these use a different Resource ID format. Use `*armnetwork.InterfacesClient.GetVirtualMachineScaleSetNetworkInterface()` instead. This needs both the scale set name and the instance ID, so add an `InstanceID` field to the `virtualMachine` struct. `InstanceID` is empty for a VM that isn't a ScaleSetVM. Signed-off-by: Daniel Nicholls <[email protected]> * Cut v2.49.0-rc.1 Signed-off-by: bwplotka <[email protected]> * Delete debugging lines, amend error message for unit Signed-off-by: Arianna Vespri <[email protected]> * Correct order in error message Signed-off-by: Arianna Vespri <[email protected]> * Consider storage.ErrTooOldSample as non-retryable Signed-off-by: Daniel Kerbel <[email protected]> * scrape_test.go: Increase scrape interval in TestScrapeLoopCache to reduce potential flakiness Signed-off-by: machine424 <[email protected]> * Avoid creating string for suffix, consider counters without _total suffix Signed-off-by: Arianna Vespri <[email protected]> * build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.17.0 to 1.18.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.17.0...v1.18.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump actions/setup-node from 3.8.1 to 4.0.1 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.8.1 to 4.0.1. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@5e21ff4...b39b52d) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * scripts: sort file list in embed directive Otherwise the resulting string depends on find, which afaict depends on the underlying filesystem. A stable file list make it easier to detect UI changes in downstreams that need to track UI assets. Signed-off-by: Jan Fajerski <[email protected]> * Fix DataTableProps['data'] for resultType string Signed-off-by: Kevin Mingtarja <[email protected]> * Fix handling of scalar and string in isHeatmapData Signed-off-by: Kevin Mingtarja <[email protected]> * build(deps): bump github.com/influxdata/influxdb Bumps [github.com/influxdata/influxdb](https://github.com/influxdata/influxdb) from 1.11.2 to 1.11.4. - [Release notes](https://github.com/influxdata/influxdb/releases) - [Commits](influxdata/influxdb@v1.11.2...v1.11.4) --- updated-dependencies: - dependency-name: github.com/influxdata/influxdb dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump github.com/prometheus/prometheus Bumps [github.com/prometheus/prometheus](https://github.com/prometheus/prometheus) from 0.48.0 to 0.48.1. - [Release notes](https://github.com/prometheus/prometheus/releases) - [Changelog](https://github.com/prometheus/prometheus/blob/main/CHANGELOG.md) - [Commits](v0.48.0...v0.48.1) --- updated-dependencies: - dependency-name: github.com/prometheus/prometheus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump client_golang to v1.18.0 (#13373) Signed-off-by: Paschalis Tsilias <[email protected]> * Drop old inmemory samples (#13002) * Drop old inmemory samples Co-authored-by: Paschalis Tsilias <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> * Avoid copying timeseries when the feature is disabled Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> * Run gofmt Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> * Clarify docs Signed-off-by: Marc Tuduri <[email protected]> * Add more logging info Signed-off-by: Marc Tuduri <[email protected]> * Remove loggers Signed-off-by: Marc Tuduri <[email protected]> * optimize function and add tests Signed-off-by: Marc Tuduri <[email protected]> * Simplify filter Signed-off-by: Marc Tuduri <[email protected]> * rename var Signed-off-by: Marc Tuduri <[email protected]> * Update help info from metrics Signed-off-by: Marc Tuduri <[email protected]> * use metrics to keep track of drop elements during buildWriteRequest Signed-off-by: Marc Tuduri <[email protected]> * rename var in tests Signed-off-by: Marc Tuduri <[email protected]> * pass time.Now as parameter Signed-off-by: Marc Tuduri <[email protected]> * Change buildwriterequest during retries Signed-off-by: Marc Tuduri <[email protected]> * Revert "Remove loggers" This reverts commit 54f91df. Signed-off-by: Marc Tuduri <[email protected]> * use log level debug for loggers Signed-off-by: Marc Tuduri <[email protected]> * Fix linter Signed-off-by: Paschalis Tsilias <[email protected]> * Remove noisy debug-level logs; add 'reason' label to drop metrics Signed-off-by: Paschalis Tsilias <[email protected]> * Remove accidentally committed files Signed-off-by: Paschalis Tsilias <[email protected]> * Propagate logger to buildWriteRequest to log dropped data Signed-off-by: Paschalis Tsilias <[email protected]> * Fix docs comment Signed-off-by: Paschalis Tsilias <[email protected]> * Make drop reason more specific Signed-off-by: Paschalis Tsilias <[email protected]> * Remove unnecessary pass of logger Signed-off-by: Paschalis Tsilias <[email protected]> * Use snake_case for reason label Signed-off-by: Paschalis Tsilias <[email protected]> * Fix dropped samples metric Signed-off-by: Paschalis Tsilias <[email protected]> --------- Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Co-authored-by: Paschalis Tsilias <[email protected]> Co-authored-by: Paschalis Tsilias <[email protected]> * fix(discovery): allow requireUpdate util to timeout in discovery/file/file_test.go. The loop ran indefinitely if the condition isn't met. Before, each iteration created a new timer channel which was always outpaced by the other timer channel with smaller duration. minor detail: There was a memory leak: resources of the ~10 previous timers were constantly kept. With the fix, we may keep the resources of one timer around for defaultWait but this isn't worth the changes to make it right. Signed-off-by: machine424 <[email protected]> * Merge pull request #13371 from kevinmingtarja/fix-isHeatmapData ui: fix handling of scalar and string in isHeatmapData * tsdb/{index,compact}: allow using custom postings encoding format (#13242) * tsdb/{index,compact}: allow using custom postings encoding format We would like to experiment with a different postings encoding format in Thanos so in this change I am proposing adding another argument to `NewWriter` which would allow users to change the format if needed. Also, wire the leveled compactor so that it would be possible to change the format there too. Signed-off-by: Giedrius Statkevičius <[email protected]> * tsdb/compact: use a struct for leveled compactor options As discussed on Slack, let's use a struct for the options in leveled compactor. Signed-off-by: Giedrius Statkevičius <[email protected]> * tsdb: make changes after Bryan's review - Make changes less intrusive - Turn the postings encoder type into a function - Add NewWriterWithEncoder() Signed-off-by: Giedrius Statkevičius <[email protected]> --------- Signed-off-by: Giedrius Statkevičius <[email protected]> * Cut 2.49.0-rc.2 Signed-off-by: bwplotka <[email protected]> * build(deps): bump actions/setup-go from 3.5.0 to 5.0.0 in /scripts (#13362) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.5.0 to 5.0.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@6edd440...0c52d54) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github/codeql-action from 2.22.8 to 3.22.12 (#13358) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.22.8 to 3.22.12. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@407ffaf...012739e) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * put @Nexucis has a release shepherd (#13383) Signed-off-by: Augustin Husson <[email protected]> * Add analyze histograms command to promtool (#12331) Add `query analyze` command to promtool This command analyzes the buckets of classic and native histograms, based on data queried from the Prometheus query API, i.e. it doesn't require direct access to the TSDB files. Signed-off-by: Jeanette Tan <[email protected]> --------- Signed-off-by: Jeanette Tan <[email protected]> * included instance in all necessary descriptions Signed-off-by: Erik Sommer <[email protected]> * tsdb/compact: fix passing merge func Fixing a very small logical problem I've introduced :(. Signed-off-by: Giedrius Statkevičius <[email protected]> * tsdb: add enable overlapping compaction This functionality is needed in downstream projects because they have a separate component that does compaction. Upstreaming https://github.com/grafana/mimir-prometheus/blob/7c8e9a2a76fc729e9078889782928b2fdfe240e9/tsdb/compact.go#L323-L325. Signed-off-by: Giedrius Statkevičius <[email protected]> * Cut 2.49.0 Signed-off-by: bwplotka <[email protected]> * promtool: allow setting multiple matchers to "promtool tsdb dump" command. (#13296) Conditions are ANDed inside the same matcher but matchers are ORed Including unit tests for "promtool tsdb dump". Refactor some matchers scraping utils. Signed-off-by: machine424 <[email protected]> * Fixed changelog Signed-off-by: bwplotka <[email protected]> * tsdb/main: wire "EnableOverlappingCompaction" to tsdb.Options (#13398) This added the #13393 "EnableOverlappingCompaction" parameter to the compactor code but not to the tsdb.Options. I forgot about that. Add it to `tsdb.Options` too and set it to `true` in Prometheus. Copy/paste the description from #13393 (comment) Signed-off-by: Giedrius Statkevičius <[email protected]> * Issue #13268: fix quality value in accept header Signed-off-by: Kumar Kalpadiptya Roy <[email protected]> * Cut 2.49.1 with scrape q= bugfix. Signed-off-by: bwplotka <[email protected]> * Cut 2.49.1 web package. Signed-off-by: bwplotka <[email protected]> * Restore more efficient version of NewPossibleNonCounterInfo annotation (#13022) Restore more efficient version of NewPossibleNonCounterInfo annotation Signed-off-by: Jeanette Tan <[email protected]> --------- Signed-off-by: Jeanette Tan <[email protected]> * Fix regressions introduced by #13242 Signed-off-by: Marco Pracucci <[email protected]> * fix slice copy in 1.20 (#13389) The slices package is added to the standard library in Go 1.21; we need to import from the exp area to maintain compatibility with Go 1.20. Signed-off-by: tyltr <[email protected]> * Docs: Query Basics: link to rate (#10538) Co-authored-by: Julien Pivotto <[email protected]> * chore(kubernetes): check preconditions earlier and avoid unnecessary checks or iterations Signed-off-by: machine424 <[email protected]> * Examples: link to `rate` for new users (#10535) * Examples: link to `rate` for new users Signed-off-by: Ted Robertson [email protected] Co-authored-by: Bryan Boreham <[email protected]> * promql: use natural sort in sort_by_label and sort_by_label_desc (#13411) These functions are intended for humans, as robots can already sort the results however they please. Humans like things sorted "naturally": * https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/ A similar thing has been done to Grafana, which is also used by humans: * grafana/grafana#78024 * grafana/grafana#78494 Signed-off-by: Ivan Babrou <[email protected]> * TestLabelValuesWithMatchers: Add test case Signed-off-by: Arve Knudsen <[email protected]> * remove obsolete build tag Signed-off-by: tyltr <[email protected]> * Upgrade some golang dependencies for resty 2.11 Signed-off-by: Israel Blancas <[email protected]> * Native Histograms: support `native_histogram_min_bucket_factor` in scrape_config (#13222) Native Histograms: support native_histogram_min_bucket_factor in scrape_config --------- Signed-off-by: Ziqi Zhao <[email protected]> Signed-off-by: Björn Rabenstein <[email protected]> Co-authored-by: George Krajcsovits <[email protected]> Co-authored-by: Björn Rabenstein <[email protected]> * Add warnings for histogramRate applied with isCounter not matching counter/gauge histogram (#13392) Add warnings for histogramRate applied with isCounter not matching counter/gauge histogram --------- Signed-off-by: Jeanette Tan <[email protected]> * Minor fixes to otlp vendor update script Signed-off-by: Goutham <[email protected]> * build(deps): bump github.com/hetznercloud/hcloud-go/v2 Bumps [github.com/hetznercloud/hcloud-go/v2](https://github.com/hetznercloud/hcloud-go) from 2.4.0 to 2.6.0. - [Release notes](https://github.com/hetznercloud/hcloud-go/releases) - [Changelog](https://github.com/hetznercloud/hcloud-go/blob/main/CHANGELOG.md) - [Commits](hetznercloud/hcloud-go@v2.4.0...v2.6.0) --- updated-dependencies: - dependency-name: github.com/hetznercloud/hcloud-go/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Enhanced visibility for `promtool test rules` with JSON colored formatting (#13342) * Added diff flag for unit test to improvise readability & debugging Signed-off-by: Rewanth Tammana <[email protected]> * Removed blank spaces Signed-off-by: Rewanth Tammana <[email protected]> * Fixed linting error Signed-off-by: Rewanth Tammana <[email protected]> * Added cli flags to documentation Signed-off-by: Rewanth Tammana <[email protected]> * Revert unrrelated linting fixes Signed-off-by: Rewanth Tammana <[email protected]> * Fixed review suggestions Signed-off-by: Rewanth Tammana <[email protected]> * Cleanup Signed-off-by: Rewanth Tammana <[email protected]> * Updated flag description Signed-off-by: Rewanth Tammana <[email protected]> * Updated flag description Signed-off-by: Rewanth Tammana <[email protected]> --------- Signed-off-by: Rewanth Tammana <[email protected]> * storage: skip merging when no remote storage configured Prometheus is hard-coded to use a fanout storage between TSDB and a remote storage which by default is empty. This change detects the empty storage and skips merging between result sets, which would make `Select()` sort results. Bottom line: we skip a sort unless there really is some remote storage configured. Signed-off-by: Bryan Boreham <[email protected]> * Remove csmarchbanks from remote write owners (#13432) I have not had the time to keep up with remote write and have no plans to work on it in the near future so I am withdrawing my maintainership of that part of the codebase. I continue to focus on client_python. Signed-off-by: Chris Marchbanks <[email protected]> * add more context cancellation check at evaluation time Signed-off-by: Ben Ye <[email protected]> * Optimize label values with matchers by taking shortcuts (#13426) Don't calculate postings beforehand: we may not need them. If all matchers are for the requested label, we can just filter its values. Also, if there are no values at all, no need to run any kind of logic. Also add more labelValuesWithMatchers benchmarks Signed-off-by: Oleg Zaytsev <[email protected]> * Add automatic memory limit handling Enable automatic detection of memory limits and configure GOMEMLIMIT to match. * Also includes a flag to allow controlling the reserved ratio. Signed-off-by: SuperQ <[email protected]> * Update OSSF badge link (#13433) Provide a more user friendly interface Signed-off-by: Matthieu MOREL <[email protected]> * SD Managers taking over responsibility for registration of debug metrics (#13375) SD Managers take over responsibility for SD metrics registration --------- Signed-off-by: Paulin Todev <[email protected]> Signed-off-by: Björn Rabenstein <[email protected]> Co-authored-by: Björn Rabenstein <[email protected]> * Optimize histogram iterators (#13340) Optimize histogram iterators Histogram iterators allocate new objects in the AtHistogram and AtFloatHistogram methods, which makes calculating rates over long ranges expensive. In #13215 we allowed an existing object to be reused when converting an integer histogram to a float histogram. This commit follows the same idea and allows injecting an existing object in the AtHistogram and AtFloatHistogram methods. When the injected value is nil, iterators allocate new histograms, otherwise they populate and return the injected object. The commit also adds a CopyTo method to Histogram and FloatHistogram which is used in the BufferedIterator to overwrite items in the ring instead of making new copies. Note that a specialized HPoint pool is needed for all of this to work (`matrixSelectorHPool`). --------- Signed-off-by: Filip Petkovski <[email protected]> Co-authored-by: George Krajcsovits <[email protected]> * doc: Mark `mad_over_time` as experimental (#13440) We forgot to do that in #13059 Signed-off-by: beorn7 <[email protected]> * Change metric label for Puppetdb from 'http' to 'puppetdb' Signed-off-by: Paulin Todev <[email protected]> * mirror metrics.proto change & generate code Signed-off-by: Ziqi Zhao <[email protected]> * TestHeadLabelValuesWithMatchers: Add test case (#13414) Add test case to TestHeadLabelValuesWithMatchers, while fixing a couple of typos in other test cases. Also enclosing some implicit sub-tests in a `t.Run` call to make them explicitly sub-tests. Signed-off-by: Arve Knudsen <[email protected]> * update all go dependencies (#13438) Signed-off-by: Augustin Husson <[email protected]> * build(deps): bump the k8s-io group with 2 updates (#13454) Bumps the k8s-io group with 2 updates: [k8s.io/api](https://github.com/kubernetes/api) and [k8s.io/client-go](https://github.com/kubernetes/client-go). Updates `k8s.io/api` from 0.28.4 to 0.29.1 - [Commits](kubernetes/api@v0.28.4...v0.29.1) Updates `k8s.io/client-go` from 0.28.4 to 0.29.1 - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](kubernetes/client-go@v0.28.4...v0.29.1) --- updated-dependencies: - dependency-name: k8s.io/api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: k8s-io - dependency-name: k8s.io/client-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: k8s-io ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump the go-opentelemetry-io group with 1 update (#13453) Bumps the go-opentelemetry-io group with 1 update: [go.opentelemetry.io/collector/semconv](https://github.com/open-telemetry/opentelemetry-collector). Updates `go.opentelemetry.io/collector/semconv` from 0.92.0 to 0.93.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-collector/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG-API.md) - [Commits](open-telemetry/opentelemetry-collector@v0.92.0...v0.93.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/collector/semconv dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-opentelemetry-io ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump actions/upload-artifact from 3.1.3 to 4.0.0 (#13355) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.3 to 4.0.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@a8a3f3a...c7d193f) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump bufbuild/buf-push-action (#13357) Bumps [bufbuild/buf-push-action](https://github.com/bufbuild/buf-push-action) from 342fc4cdcf29115a01cf12a2c6dd6aac68dc51e1 to a654ff18effe4641ebea4a4ce242c49800728459. - [Release notes](https://github.com/bufbuild/buf-push-action/releases) - [Commits](bufbuild/buf-push-action@342fc4c...a654ff1) --- updated-dependencies: - dependency-name: bufbuild/buf-push-action dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Labels: Add DropMetricName function, used in PromQL (#13446) This function is called very frequently when executing PromQL functions, and we can do it much more efficiently inside Labels. In the common case that `__name__` comes first in the labels, we simply re-point to start at the next label, which is nearly free. `DropMetricName` is now so cheap I removed the cache - benchmarks show everything still goes faster. Signed-off-by: Bryan Boreham <[email protected]> * tsdb: simplify internal series delete function (#13261) Lifting an optimisation from Agent code, `seriesHashmap.del` can use the unique series reference, doesn't need to check Labels. Also streamline the logic for deleting from `unique` and `conflicts` maps, and add some comments to help the next person. Signed-off-by: Bryan Boreham <[email protected]> * otlptranslator/update-copy.sh: Fix sed command lines Signed-off-by: Arve Knudsen <[email protected]> * Rollback k8s.io requirements (#13462) Rollback k8s.io Go modules to v0.28.6 to avoid forcing upgrade of Go to 1.21. This allows us to keep compatibility with the currently supported upstream Go releases. Signed-off-by: SuperQ <[email protected]> * Make update-copy.sh work for both OSX and GNU sed Signed-off-by: Arve Knudsen <[email protected]> * Name @beorn7 and @krajorama as maintainers for native histograms I have been the de-facto maintainer for native histograms from the beginning. So let's put this into MAINTAINERS.md. In addition, I hereby proposose George Krajcsovits AKA Krajo as a co-maintainer. He has contributed a lot of native histogram code, but more importantly, he has contributed substantially to reviewing other contributors' native histogram code, up to a point where I was merely rubberstamping the PRs he had already reviewed. I'm confident that he is ready to to be granted commit rights as outlined in the "Maintainers" section of the governance: https://prometheus.io/governance/#maintainers According to the same section of the governance, I will announce the proposed change on the developers mailing list and will give some time for lazy consensus before merging this PR. Signed-off-by: beorn7 <[email protected]> * ui/fix: correct url handling for stacked graphs (#13460) Signed-off-by: Yury Moladau <[email protected]> * tsdb: use cheaper Mutex on series Mutex is 8 bytes; RWMutex is 24 bytes and much more complicated. Since `RLock` is only used in two places, `UpdateMetadata` and `Delete`, neither of which are hotspots, we should use the cheaper one. Signed-off-by: Bryan Boreham <[email protected]> * Fix last_over_time for native histograms The last_over_time retains a histogram sample without making a copy. This sample is now coming from the buffered iterator used for windowing functions, and can be reused for reading subsequent samples as the iterator progresses. I would propose copying the sample in the last_over_time function, similar to how it is done for rate, sum_over_time and others. Signed-off-by: Filip Petkovski <[email protected]> * Implementation NOTE: Rebased from main after refactor in #13014 Signed-off-by: Danny Kopping <[email protected]> * Add feature flag Signed-off-by: Danny Kopping <[email protected]> * Refactor concurrency control Signed-off-by: Danny Kopping <[email protected]> * Optimising dependencies/dependents funcs to not produce new slices each request Signed-off-by: Danny Kopping <[email protected]> * Refactoring Signed-off-by: Danny Kopping <[email protected]> * Rename flag Signed-off-by: Danny Kopping <[email protected]> * Refactoring for performance, and to allow controller to be overridden Signed-off-by: Danny Kopping <[email protected]> * Block until all rules, both sync & async, have completed evaluating Updated & added tests Review feedback nits Return empty map if not indeterminate Use highWatermark to track inflight requests counter Appease the linter Clarify feature flag Signed-off-by: Danny Kopping <[email protected]> * Fix typo in CLI flag description Signed-off-by: Marco Pracucci <[email protected]> * Fixed auto-generated doc Signed-off-by: Marco Pracucci <[email protected]> * Improve doc Signed-off-by: Marco Pracucci <[email protected]> * Simplify the design to update concurrency controller once the rule evaluation has done Signed-off-by: Marco Pracucci <[email protected]> * Add more test cases to TestDependenciesEdgeCases Signed-off-by: Marco Pracucci <[email protected]> * Added more test cases to TestDependenciesEdgeCases Signed-off-by: Marco Pracucci <[email protected]> * Improved RuleConcurrencyController interface doc Signed-off-by: Marco Pracucci <[email protected]> * Introduced sequentialRuleEvalController Signed-off-by: Marco Pracucci <[email protected]> * Remove superfluous nil check in Group.metrics Signed-off-by: Marco Pracucci <[email protected]> * api: Serialize discovered and target labels into JSON directly (#13469) Converted maps into labels.Labels to avoid a lot of copying of data which leads to very high memory consumption while opening the /service-discovery endpoint in the Prometheus UI Signed-off-by: Leegin <[email protected]> * api: Serialize discovered labels into JSON directly in dropped targets (#13484) Converted maps into labels.Labels to avoid a lot of copying of data which leads to very high memory consumption while opening the /service-discovery endpoint in the Prometheus UI Signed-off-by: Leegin <[email protected]> * Add ShardedPostings() support to TSDB (#10421) This PR is a reference implementation of the proposal described in #10420. In addition to what described in #10420, in this PR I've introduced labels.StableHash(). The idea is to offer an hashing function which doesn't change over time, and that's used by query sharding in order to get a stable behaviour over time. The implementation of labels.StableHash() is the hashing function used by Prometheus before stringlabels, and what's used by Grafana Mimir for query sharding (because built before stringlabels was a thing). Follow up work As mentioned in #10420, if this PR is accepted I'm also open to upload another foundamental piece used by Grafana Mimir query sharding to accelerate the query execution: an optional, configurable and fast in-memory cache for the series hashes. Signed-off-by: Marco Pracucci <[email protected]> * storage/remote: document why two benchmarks are skipped One was silently doing nothing; one was doing something but the work didn't go up linearly with iteration count. Signed-off-by: Bryan Boreham <[email protected]> * Pod status changes not discovered by Kube Endpoints SD (#13337) * fix(discovery/kubernetes/endpoints): react to changes on Pods because some modifications can occur on them without triggering an update on the related Endpoints (The Pod phase changing from Pending to Running e.g.). --------- Signed-off-by: machine424 <[email protected]> Co-authored-by: Guillermo Sanchez Gavier <[email protected]> * Small improvements, add const, remove copypasta (#8106) Signed-off-by: Mikhail Fesenko <[email protected]> Signed-off-by: Jesus Vazquez <[email protected]> * Proposal to improve FPointSlice and HPointSlice allocation. (#13448) * Reusing points slice from previous series when the slice is under utilized * Adding comments on the bench test Signed-off-by: Alan Protasio <[email protected]> * lint Signed-off-by: Nicolás Pazos <[email protected]> * go mod tidy Signed-off-by: Nicolás Pazos <[email protected]> --------- Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: Bryan Boreham <[email protected]> Signed-off-by: Erik Sommer <[email protected]> Signed-off-by: Linas Medziunas <[email protected]> Signed-off-by: bwplotka <[email protected]> Signed-off-by: Arianna Vespri <[email protected]> Signed-off-by: machine424 <[email protected]> Signed-off-by: Daniel Nicholls <[email protected]> Signed-off-by: Daniel Kerbel <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Jan Fajerski <[email protected]> Signed-off-by: Kevin Mingtarja <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Giedrius Statkevičius <[email protected]> Signed-off-by: Augustin Husson <[email protected]> Signed-off-by: Jeanette Tan <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]> Signed-off-by: Kumar Kalpadiptya Roy <[email protected]> Signed-off-by: Marco Pracucci <[email protected]> Signed-off-by: tyltr <[email protected]> Signed-off-by: Ted Robertson [email protected] Signed-off-by: Ivan Babrou <[email protected]> Signed-off-by: Arve Knudsen <[email protected]> Signed-off-by: Israel Blancas <[email protected]> Signed-off-by: Ziqi Zhao <[email protected]> Signed-off-by: Björn Rabenstein <[email protected]> Signed-off-by: Goutham <[email protected]> Signed-off-by: Rewanth Tammana <[email protected]> Signed-off-by: Chris Marchbanks <[email protected]> Signed-off-by: Ben Ye <[email protected]> Signed-off-by: Oleg Zaytsev <[email protected]> Signed-off-by: SuperQ <[email protected]> Signed-off-by: Ben Kochie <[email protected]> Signed-off-by: Matthieu MOREL <[email protected]> Signed-off-by: Paulin Todev <[email protected]> Signed-off-by: Filip Petkovski <[email protected]> Signed-off-by: beorn7 <[email protected]> Signed-off-by: Augustin Husson <[email protected]> Signed-off-by: Yury Moladau <[email protected]> Signed-off-by: Danny Kopping <[email protected]> Signed-off-by: Leegin <[email protected]> Signed-off-by: Mikhail Fesenko <[email protected]> Signed-off-by: Jesus Vazquez <[email protected]> Signed-off-by: Alan Protasio <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> Co-authored-by: Julian Wiedmann <[email protected]> Co-authored-by: Bryan Boreham <[email protected]> Co-authored-by: Erik Sommer <[email protected]> Co-authored-by: Linas Medziunas <[email protected]> Co-authored-by: Bartlomiej Plotka <[email protected]> Co-authored-by: Arianna Vespri <[email protected]> Co-authored-by: machine424 <[email protected]> Co-authored-by: daniel-resdiary <[email protected]> Co-authored-by: Daniel Kerbel <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jan Fajerski <[email protected]> Co-authored-by: Kevin Mingtarja <[email protected]> Co-authored-by: Paschalis Tsilias <[email protected]> Co-authored-by: Marc Tudurí <[email protected]> Co-authored-by: Paschalis Tsilias <[email protected]> Co-authored-by: Giedrius Statkevičius <[email protected]> Co-authored-by: Augustin Husson <[email protected]> Co-authored-by: Björn Rabenstein <[email protected]> Co-authored-by: zenador <[email protected]> Co-authored-by: gotjosh <[email protected]> Co-authored-by: Ben Kochie <[email protected]> Co-authored-by: Kumar Kalpadiptya Roy <[email protected]> Co-authored-by: Marco Pracucci <[email protected]> Co-authored-by: tyltr <[email protected]> Co-authored-by: Ted Robertson <[email protected]> Co-authored-by: Julien Pivotto <[email protected]> Co-authored-by: Matthias Loibl <[email protected]> Co-authored-by: Ivan Babrou <[email protected]> Co-authored-by: Arve Knudsen <[email protected]> Co-authored-by: Israel Blancas <[email protected]> Co-authored-by: Ziqi Zhao <[email protected]> Co-authored-by: George Krajcsovits <[email protected]> Co-authored-by: Björn Rabenstein <[email protected]> Co-authored-by: Goutham <[email protected]> Co-authored-by: Rewanth Tammana <[email protected]> Co-authored-by: Chris Marchbanks <[email protected]> Co-authored-by: Ben Ye <[email protected]> Co-authored-by: Oleg Zaytsev <[email protected]> Co-authored-by: Matthieu MOREL <[email protected]> Co-authored-by: Paulin Todev <[email protected]> Co-authored-by: Filip Petkovski <[email protected]> Co-authored-by: Yury Molodov <[email protected]> Co-authored-by: Danny Kopping <[email protected]> Co-authored-by: Leegin <[email protected]> Co-authored-by: Guillermo Sanchez Gavier <[email protected]> Co-authored-by: Mikhail Fesenko <[email protected]> Co-authored-by: Alan Protasio <[email protected]>
…support + metadata in WAL) (#14395) * Remote Write 1.1: e2e benchmarks (#13102) * Remote Write e2e benchmarks Signed-off-by: Nicolás Pazos <[email protected]> * Prometheus ports automatically assigned Signed-off-by: Nicolás Pazos <[email protected]> * make dashboard editable + more modular to different job label values Signed-off-by: Callum Styan <[email protected]> * Dashboard improvements * memory stats * diffs look at counter increases Signed-off-by: Nicolás Pazos <[email protected]> * run script: absolute path for config templates Signed-off-by: Nicolás Pazos <[email protected]> * grafana dashboard improvements * show actual values of metrics * add memory stats and diff Signed-off-by: Nicolás Pazos <[email protected]> * dashboard changes Signed-off-by: Callum Styan <[email protected]> --------- Signed-off-by: Nicolás Pazos <[email protected]> Signed-off-by: Callum Styan <[email protected]> Co-authored-by: Callum Styan <[email protected]> * replace snappy encoding library Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * add new proto types Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * add decode function for new write request proto Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * add lookup table struct that is used to build the symbol table in new write request format Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * Implement code paths for new proto format Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * update example server to include handler for new format Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * Add new test client Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * tests and new -> original proto mapping util Signed-off-by: Nicolás Pazos <[email protected]> * add new proto support on receiver end Signed-off-by: Nicolás Pazos <[email protected]> * Fix test Signed-off-by: Nicolás Pazos <[email protected]> * no-brainer copypaste but more performance write support Signed-off-by: Nicolás Pazos <[email protected]> * remove some comented code Signed-off-by: Nicolás Pazos <[email protected]> * fix mocks and fixture Signed-off-by: Nicolás Pazos <[email protected]> * add basic reduce remote write handler benchmark Signed-off-by: Nicolás Pazos <[email protected]> * refactor out common code between write methods Signed-off-by: Nicolás Pazos <[email protected]> * fix: queue manager to include float histograms in new requests Signed-off-by: Nicolás Pazos <[email protected]> * add sender-side tests and fix failing ones Signed-off-by: Nicolás Pazos <[email protected]> * refactor queue manager code to remove some duplication Signed-off-by: Nicolás Pazos <[email protected]> * fix build Signed-off-by: Nicolás Pazos <[email protected]> * Improve sender benchmarks and some allocations Signed-off-by: Nicolás Pazos <[email protected]> * Use github.com/golang/snappy Signed-off-by: Nicolás Pazos <[email protected]> * cleanup: remove hardcoded fake url for testing Signed-off-by: Nicolás Pazos <[email protected]> * Add 1.1 version handling code Signed-off-by: Nicolás Pazos <[email protected]> * Remove config, update proto Signed-off-by: Nicolás Pazos <[email protected]> * gofmt Signed-off-by: Nicolás Pazos <[email protected]> * fix NewWriteClient and change new flags wording Signed-off-by: Nicolás Pazos <[email protected]> * fields rewording in handler Signed-off-by: Nicolás Pazos <[email protected]> * remote write handler to checks version header Signed-off-by: Nicolás Pazos <[email protected]> * fix typo in log Signed-off-by: Nicolás Pazos <[email protected]> * lint Signed-off-by: Nicolás Pazos <[email protected]> * Add minmized remote write proto format Co-authored-by: Marco Pracucci <[email protected]> Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * add functions for translating between new proto formats symbol table and actual prometheus labels Co-authored-by: Marco Pracucci <[email protected]> Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * add functionality for new minimized remote write request format Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * fix minor things Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * Make LabelSymbols a fixed32 Signed-off-by: Nicolás Pazos <[email protected]> * remove unused proto type Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * update tests Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * fix build for stringlabels tag Signed-off-by: Nicolás Pazos <[email protected]> * Use two uint32 to encode (offset,leng) Signed-off-by: Nicolás Pazos <[email protected]> * manually optimize varint marshaling Signed-off-by: Nicolás Pazos <[email protected]> * Use unsafe []byte->string cast to reuse buffer Signed-off-by: Nicolás Pazos <[email protected]> * fix writeRequestMinimizedFixture Signed-off-by: Nicolás Pazos <[email protected]> * remove all code from previous interning approach the 'minimized' version is now the only v1.1 version Signed-off-by: Nicolás Pazos <[email protected]> * minimally-tested exemplar support for rw 1.1 Signed-off-by: Nicolás Pazos <[email protected]> * refactor new version flag to make it easier to pick a specific format instead of having multiple flags, plus add new formats for testing Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * use exp slices for backwards compat. to go 1.20 plus add copyright header to test file Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * fix label ranging Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * Add bytes slice (instead of slice of 32bit vars) format for testing Co-authored-by: Nicolás Pazos <[email protected]> Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * test additional len and lenbytes formats Co-authored-by: Nicolás Pazos <[email protected]> Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * remove mistaken package lock changes Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * remove formats we've decided not to use Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * remove more format types we probably won't use Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * More cleanup Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * use require instead of assert in custom marshal test Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * cleanup; remove some unused functions Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * more cleanup, mostly linting fixes Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * remove package-lock.json change again Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * more cleanup, address review comments Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * fix test panic Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * fix minor lint issue + use labels Range function since it looks like the tests fail to do `range labels.Labels` on CI Signed-off-by: Callum Styan <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * new interning format based on []string indeces Co-authored-by: bwplotka <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * remove all new rw formats but the []string one also adapt tests to the new format Signed-off-by: Nicolás Pazos <[email protected]> * cleanup rwSymbolTable Signed-off-by: Nicolás Pazos <[email protected]> * add some TODOs for later Signed-off-by: Nicolás Pazos <[email protected]> * don't reserve field 3 for new proto and add TODO Signed-off-by: Nicolás Pazos <[email protected]> * fix custom marshaling Signed-off-by: Nicolás Pazos <[email protected]> * lint Signed-off-by: Nicolás Pazos <[email protected]> * additional merge fixes Signed-off-by: Nicolás Pazos <[email protected]> * lint fixes Signed-off-by: Nicolás Pazos <[email protected]> * fix server example Signed-off-by: Nicolás Pazos <[email protected]> * revert package-lock.json changes Signed-off-by: Nicolás Pazos <[email protected]> * update example prometheus version Signed-off-by: Nicolás Pazos <[email protected]> * define separate proto types for remote write 2.0 Signed-off-by: Nicolás Pazos <[email protected]> * lint Signed-off-by: Nicolás Pazos <[email protected]> * rename new proto types and move to separate pkg Signed-off-by: Nicolás Pazos <[email protected]> * update prometheus version for example Signed-off-by: Nicolás Pazos <[email protected]> * make proto Signed-off-by: Nicolás Pazos <[email protected]> * make Metadata not nullable Signed-off-by: Nicolás Pazos <[email protected]> * remove old MinSample proto message Signed-off-by: Nicolás Pazos <[email protected]> * change enum names to fit buf build recommend enum naming and lint rules Signed-off-by: Callum Styan <[email protected]> * remote: Added test for classic histogram grouping when sending rw; Fixed queue manager test delay. (#13421) Signed-off-by: bwplotka <[email protected]> * Remote write v2: metadata support in every write request (#13394) * Approach bundling metadata along with samples and exemplars Signed-off-by: Paschalis Tsilias <[email protected]> * Add first test; rebase with main Signed-off-by: Paschalis Tsilias <[email protected]> * Alternative approach: bundle metadata in TimeSeries protobuf Signed-off-by: Paschalis Tsilias <[email protected]> * update go mod to match main branch Signed-off-by: Callum Styan <[email protected]> * fix after rebase Signed-off-by: Callum Styan <[email protected]> * we're not going to modify the 1.X format anymore Signed-off-by: Callum Styan <[email protected]> * Modify AppendMetadata based on the fact that we be putting metadata into timeseries Signed-off-by: Callum Styan <[email protected]> * Rename enums for remote write versions to something that makes more sense + remove the added `sendMetadata` flag. Signed-off-by: Callum Styan <[email protected]> * rename flag that enables writing of metadata records to the WAL Signed-off-by: Callum Styan <[email protected]> * additional clean up Signed-off-by: Callum Styan <[email protected]> * lint Signed-off-by: Callum Styan <[email protected]> * fix usage of require.Len Signed-off-by: Callum Styan <[email protected]> * some clean up from review comments Signed-off-by: Callum Styan <[email protected]> * more review fixes Signed-off-by: Callum Styan <[email protected]> --------- Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Callum Styan <[email protected]> Co-authored-by: Paschalis Tsilias <[email protected]> * remote write 2.0: sync with `main` branch (#13510) * consoles: exclude iowait and steal from CPU Utilisation 'iowait' and 'steal' indicate specific idle/wait states, which shouldn't be counted into CPU Utilisation. Also see https://github.com/prometheus-operator/kube-prometheus/pull/796 and https://github.com/kubernetes-monitoring/kubernetes-mixin/pull/667. Per the iostat man page: %idle Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request. %iowait Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request. %steal Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor. Signed-off-by: Julian Wiedmann <[email protected]> * tsdb: shrink txRing with smaller integers 4 billion active transactions ought to be enough for anyone. Signed-off-by: Bryan Boreham <[email protected]> * tsdb: create isolation transaction slice on demand When Prometheus restarts it creates every series read in from the WAL, but many of those series will be finished, and never receive any more samples. By defering allocation of the txRing slice to when it is first needed, we save 32 bytes per stale series. Signed-off-by: Bryan Boreham <[email protected]> * add cluster variable to Overview dashboard Signed-off-by: Erik Sommer <[email protected]> * promql: simplify Native Histogram arithmetics Signed-off-by: Linas Medziunas <[email protected]> * Cut 2.49.0-rc.0 (#13270) * Cut 2.49.0-rc.0 Signed-off-by: bwplotka <[email protected]> * Removed the duplicate. Signed-off-by: bwplotka <[email protected]> --------- Signed-off-by: bwplotka <[email protected]> * Add unit protobuf parser Signed-off-by: Arianna Vespri <[email protected]> * Go on adding protobuf parsing for unit Signed-off-by: Arianna Vespri <[email protected]> * ui: create a reproduction for https://github.com/prometheus/prometheus/issues/13292 Signed-off-by: machine424 <[email protected]> * Get conditional right Signed-off-by: Arianna Vespri <[email protected]> * Get VM Scale Set NIC (#13283) Calling `*armnetwork.InterfacesClient.Get()` doesn't work for Scale Set VM NIC, because these use a different Resource ID format. Use `*armnetwork.InterfacesClient.GetVirtualMachineScaleSetNetworkInterface()` instead. This needs both the scale set name and the instance ID, so add an `InstanceID` field to the `virtualMachine` struct. `InstanceID` is empty for a VM that isn't a ScaleSetVM. Signed-off-by: Daniel Nicholls <[email protected]> * Cut v2.49.0-rc.1 Signed-off-by: bwplotka <[email protected]> * Delete debugging lines, amend error message for unit Signed-off-by: Arianna Vespri <[email protected]> * Correct order in error message Signed-off-by: Arianna Vespri <[email protected]> * Consider storage.ErrTooOldSample as non-retryable Signed-off-by: Daniel Kerbel <[email protected]> * scrape_test.go: Increase scrape interval in TestScrapeLoopCache to reduce potential flakiness Signed-off-by: machine424 <[email protected]> * Avoid creating string for suffix, consider counters without _total suffix Signed-off-by: Arianna Vespri <[email protected]> * build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.17.0 to 1.18.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.17.0...v1.18.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump actions/setup-node from 3.8.1 to 4.0.1 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.8.1 to 4.0.1. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d...b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * scripts: sort file list in embed directive Otherwise the resulting string depends on find, which afaict depends on the underlying filesystem. A stable file list make it easier to detect UI changes in downstreams that need to track UI assets. Signed-off-by: Jan Fajerski <[email protected]> * Fix DataTableProps['data'] for resultType string Signed-off-by: Kevin Mingtarja <[email protected]> * Fix handling of scalar and string in isHeatmapData Signed-off-by: Kevin Mingtarja <[email protected]> * build(deps): bump github.com/influxdata/influxdb Bumps [github.com/influxdata/influxdb](https://github.com/influxdata/influxdb) from 1.11.2 to 1.11.4. - [Release notes](https://github.com/influxdata/influxdb/releases) - [Commits](https://github.com/influxdata/influxdb/compare/v1.11.2...v1.11.4) --- updated-dependencies: - dependency-name: github.com/influxdata/influxdb dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump github.com/prometheus/prometheus Bumps [github.com/prometheus/prometheus](https://github.com/prometheus/prometheus) from 0.48.0 to 0.48.1. - [Release notes](https://github.com/prometheus/prometheus/releases) - [Changelog](https://github.com/prometheus/prometheus/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/prometheus/compare/v0.48.0...v0.48.1) --- updated-dependencies: - dependency-name: github.com/prometheus/prometheus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Bump client_golang to v1.18.0 (#13373) Signed-off-by: Paschalis Tsilias <[email protected]> * Drop old inmemory samples (#13002) * Drop old inmemory samples Co-authored-by: Paschalis Tsilias <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> * Avoid copying timeseries when the feature is disabled Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> * Run gofmt Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> * Clarify docs Signed-off-by: Marc Tuduri <[email protected]> * Add more logging info Signed-off-by: Marc Tuduri <[email protected]> * Remove loggers Signed-off-by: Marc Tuduri <[email protected]> * optimize function and add tests Signed-off-by: Marc Tuduri <[email protected]> * Simplify filter Signed-off-by: Marc Tuduri <[email protected]> * rename var Signed-off-by: Marc Tuduri <[email protected]> * Update help info from metrics Signed-off-by: Marc Tuduri <[email protected]> * use metrics to keep track of drop elements during buildWriteRequest Signed-off-by: Marc Tuduri <[email protected]> * rename var in tests Signed-off-by: Marc Tuduri <[email protected]> * pass time.Now as parameter Signed-off-by: Marc Tuduri <[email protected]> * Change buildwriterequest during retries Signed-off-by: Marc Tuduri <[email protected]> * Revert "Remove loggers" This reverts commit 54f91dfcae20488944162335ab4ad8be459df1ab. Signed-off-by: Marc Tuduri <[email protected]> * use log level debug for loggers Signed-off-by: Marc Tuduri <[email protected]> * Fix linter Signed-off-by: Paschalis Tsilias <[email protected]> * Remove noisy debug-level logs; add 'reason' label to drop metrics Signed-off-by: Paschalis Tsilias <[email protected]> * Remove accidentally committed files Signed-off-by: Paschalis Tsilias <[email protected]> * Propagate logger to buildWriteRequest to log dropped data Signed-off-by: Paschalis Tsilias <[email protected]> * Fix docs comment Signed-off-by: Paschalis Tsilias <[email protected]> * Make drop reason more specific Signed-off-by: Paschalis Tsilias <[email protected]> * Remove unnecessary pass of logger Signed-off-by: Paschalis Tsilias <[email protected]> * Use snake_case for reason label Signed-off-by: Paschalis Tsilias <[email protected]> * Fix dropped samples metric Signed-off-by: Paschalis Tsilias <[email protected]> --------- Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Co-authored-by: Paschalis Tsilias <[email protected]> Co-authored-by: Paschalis Tsilias <[email protected]> * fix(discovery): allow requireUpdate util to timeout in discovery/file/file_test.go. The loop ran indefinitely if the condition isn't met. Before, each iteration created a new timer channel which was always outpaced by the other timer channel with smaller duration. minor detail: There was a memory leak: resources of the ~10 previous timers were constantly kept. With the fix, we may keep the resources of one timer around for defaultWait but this isn't worth the changes to make it right. Signed-off-by: machine424 <[email protected]> * Merge pull request #13371 from kevinmingtarja/fix-isHeatmapData ui: fix handling of scalar and string in isHeatmapData * tsdb/{index,compact}: allow using custom postings encoding format (#13242) * tsdb/{index,compact}: allow using custom postings encoding format We would like to experiment with a different postings encoding format in Thanos so in this change I am proposing adding another argument to `NewWriter` which would allow users to change the format if needed. Also, wire the leveled compactor so that it would be possible to change the format there too. Signed-off-by: Giedrius Statkevičius <[email protected]> * tsdb/compact: use a struct for leveled compactor options As discussed on Slack, let's use a struct for the options in leveled compactor. Signed-off-by: Giedrius Statkevičius <[email protected]> * tsdb: make changes after Bryan's review - Make changes less intrusive - Turn the postings encoder type into a function - Add NewWriterWithEncoder() Signed-off-by: Giedrius Statkevičius <[email protected]> --------- Signed-off-by: Giedrius Statkevičius <[email protected]> * Cut 2.49.0-rc.2 Signed-off-by: bwplotka <[email protected]> * build(deps): bump actions/setup-go from 3.5.0 to 5.0.0 in /scripts (#13362) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.5.0 to 5.0.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/6edd4406fa81c3da01a34fa6f6343087c207a568...0c52d547c9bc32b1aa3301fd7a9cb496313a4491) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github/codeql-action from 2.22.8 to 3.22.12 (#13358) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.22.8 to 3.22.12. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/407ffafae6a767df3e0230c3df91b6443ae8df75...012739e5082ff0c22ca6d6ab32e07c36df03c4a4) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * put @nexucis has a release shepherd (#13383) Signed-off-by: Augustin Husson <[email protected]> * Add analyze histograms command to promtool (#12331) Add `query analyze` command to promtool This command analyzes the buckets of classic and native histograms, based on data queried from the Prometheus query API, i.e. it doesn't require direct access to the TSDB files. Signed-off-by: Jeanette Tan <[email protected]> --------- Signed-off-by: Jeanette Tan <[email protected]> * included instance in all necessary descriptions Signed-off-by: Erik Sommer <[email protected]> * tsdb/compact: fix passing merge func Fixing a very small logical problem I've introduced :(. Signed-off-by: Giedrius Statkevičius <[email protected]> * tsdb: add enable overlapping compaction This functionality is needed in downstream projects because they have a separate component that does compaction. Upstreaming https://github.com/grafana/mimir-prometheus/blob/7c8e9a2a76fc729e9078889782928b2fdfe240e9/tsdb/compact.go#L323-L325. Signed-off-by: Giedrius Statkevičius <[email protected]> * Cut 2.49.0 Signed-off-by: bwplotka <[email protected]> * promtool: allow setting multiple matchers to "promtool tsdb dump" command. (#13296) Conditions are ANDed inside the same matcher but matchers are ORed Including unit tests for "promtool tsdb dump". Refactor some matchers scraping utils. Signed-off-by: machine424 <[email protected]> * Fixed changelog Signed-off-by: bwplotka <[email protected]> * tsdb/main: wire "EnableOverlappingCompaction" to tsdb.Options (#13398) This added the https://github.com/prometheus/prometheus/pull/13393 "EnableOverlappingCompaction" parameter to the compactor code but not to the tsdb.Options. I forgot about that. Add it to `tsdb.Options` too and set it to `true` in Prometheus. Copy/paste the description from https://github.com/prometheus/prometheus/pull/13393#issuecomment-1891787986 Signed-off-by: Giedrius Statkevičius <[email protected]> * Issue #13268: fix quality value in accept header Signed-off-by: Kumar Kalpadiptya Roy <[email protected]> * Cut 2.49.1 with scrape q= bugfix. Signed-off-by: bwplotka <[email protected]> * Cut 2.49.1 web package. Signed-off-by: bwplotka <[email protected]> * Restore more efficient version of NewPossibleNonCounterInfo annotation (#13022) Restore more efficient version of NewPossibleNonCounterInfo annotation Signed-off-by: Jeanette Tan <[email protected]> --------- Signed-off-by: Jeanette Tan <[email protected]> * Fix regressions introduced by #13242 Signed-off-by: Marco Pracucci <[email protected]> * fix slice copy in 1.20 (#13389) The slices package is added to the standard library in Go 1.21; we need to import from the exp area to maintain compatibility with Go 1.20. Signed-off-by: tyltr <[email protected]> * Docs: Query Basics: link to rate (#10538) Co-authored-by: Julien Pivotto <[email protected]> * chore(kubernetes): check preconditions earlier and avoid unnecessary checks or iterations Signed-off-by: machine424 <[email protected]> * Examples: link to `rate` for new users (#10535) * Examples: link to `rate` for new users Signed-off-by: Ted Robertson [email protected] Co-authored-by: Bryan Boreham <[email protected]> * promql: use natural sort in sort_by_label and sort_by_label_desc (#13411) These functions are intended for humans, as robots can already sort the results however they please. Humans like things sorted "naturally": * https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/ A similar thing has been done to Grafana, which is also used by humans: * https://github.com/grafana/grafana/pull/78024 * https://github.com/grafana/grafana/pull/78494 Signed-off-by: Ivan Babrou <[email protected]> * TestLabelValuesWithMatchers: Add test case Signed-off-by: Arve Knudsen <[email protected]> * remove obsolete build tag Signed-off-by: tyltr <[email protected]> * Upgrade some golang dependencies for resty 2.11 Signed-off-by: Israel Blancas <[email protected]> * Native Histograms: support `native_histogram_min_bucket_factor` in scrape_config (#13222) Native Histograms: support native_histogram_min_bucket_factor in scrape_config --------- Signed-off-by: Ziqi Zhao <[email protected]> Signed-off-by: Björn Rabenstein <[email protected]> Co-authored-by: George Krajcsovits <[email protected]> Co-authored-by: Björn Rabenstein <[email protected]> * Add warnings for histogramRate applied with isCounter not matching counter/gauge histogram (#13392) Add warnings for histogramRate applied with isCounter not matching counter/gauge histogram --------- Signed-off-by: Jeanette Tan <[email protected]> * Minor fixes to otlp vendor update script Signed-off-by: Goutham <[email protected]> * build(deps): bump github.com/hetznercloud/hcloud-go/v2 Bumps [github.com/hetznercloud/hcloud-go/v2](https://github.com/hetznercloud/hcloud-go) from 2.4.0 to 2.6.0. - [Release notes](https://github.com/hetznercloud/hcloud-go/releases) - [Changelog](https://github.com/hetznercloud/hcloud-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/hetznercloud/hcloud-go/compare/v2.4.0...v2.6.0) --- updated-dependencies: - dependency-name: github.com/hetznercloud/hcloud-go/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Enhanced visibility for `promtool test rules` with JSON colored formatting (#13342) * Added diff flag for unit test to improvise readability & debugging Signed-off-by: Rewanth Tammana <[email protected]> * Removed blank spaces Signed-off-by: Rewanth Tammana <[email protected]> * Fixed linting error Signed-off-by: Rewanth Tammana <[email protected]> * Added cli flags to documentation Signed-off-by: Rewanth Tammana <[email protected]> * Revert unrrelated linting fixes Signed-off-by: Rewanth Tammana <[email protected]> * Fixed review suggestions Signed-off-by: Rewanth Tammana <[email protected]> * Cleanup Signed-off-by: Rewanth Tammana <[email protected]> * Updated flag description Signed-off-by: Rewanth Tammana <[email protected]> * Updated flag description Signed-off-by: Rewanth Tammana <[email protected]> --------- Signed-off-by: Rewanth Tammana <[email protected]> * storage: skip merging when no remote storage configured Prometheus is hard-coded to use a fanout storage between TSDB and a remote storage which by default is empty. This change detects the empty storage and skips merging between result sets, which would make `Select()` sort results. Bottom line: we skip a sort unless there really is some remote storage configured. Signed-off-by: Bryan Boreham <[email protected]> * Remove csmarchbanks from remote write owners (#13432) I have not had the time to keep up with remote write and have no plans to work on it in the near future so I am withdrawing my maintainership of that part of the codebase. I continue to focus on client_python. Signed-off-by: Chris Marchbanks <[email protected]> * add more context cancellation check at evaluation time Signed-off-by: Ben Ye <[email protected]> * Optimize label values with matchers by taking shortcuts (#13426) Don't calculate postings beforehand: we may not need them. If all matchers are for the requested label, we can just filter its values. Also, if there are no values at all, no need to run any kind of logic. Also add more labelValuesWithMatchers benchmarks Signed-off-by: Oleg Zaytsev <[email protected]> * Add automatic memory limit handling Enable automatic detection of memory limits and configure GOMEMLIMIT to match. * Also includes a flag to allow controlling the reserved ratio. Signed-off-by: SuperQ <[email protected]> * Update OSSF badge link (#13433) Provide a more user friendly interface Signed-off-by: Matthieu MOREL <[email protected]> * SD Managers taking over responsibility for registration of debug metrics (#13375) SD Managers take over responsibility for SD metrics registration --------- Signed-off-by: Paulin Todev <[email protected]> Signed-off-by: Björn Rabenstein <[email protected]> Co-authored-by: Björn Rabenstein <[email protected]> * Optimize histogram iterators (#13340) Optimize histogram iterators Histogram iterators allocate new objects in the AtHistogram and AtFloatHistogram methods, which makes calculating rates over long ranges expensive. In #13215 we allowed an existing object to be reused when converting an integer histogram to a float histogram. This commit follows the same idea and allows injecting an existing object in the AtHistogram and AtFloatHistogram methods. When the injected value is nil, iterators allocate new histograms, otherwise they populate and return the injected object. The commit also adds a CopyTo method to Histogram and FloatHistogram which is used in the BufferedIterator to overwrite items in the ring instead of making new copies. Note that a specialized HPoint pool is needed for all of this to work (`matrixSelectorHPool`). --------- Signed-off-by: Filip Petkovski <[email protected]> Co-authored-by: George Krajcsovits <[email protected]> * doc: Mark `mad_over_time` as experimental (#13440) We forgot to do that in https://github.com/prometheus/prometheus/pull/13059 Signed-off-by: beorn7 <[email protected]> * Change metric label for Puppetdb from 'http' to 'puppetdb' Signed-off-by: Paulin Todev <[email protected]> * mirror metrics.proto change & generate code Signed-off-by: Ziqi Zhao <[email protected]> * TestHeadLabelValuesWithMatchers: Add test case (#13414) Add test case to TestHeadLabelValuesWithMatchers, while fixing a couple of typos in other test cases. Also enclosing some implicit sub-tests in a `t.Run` call to make them explicitly sub-tests. Signed-off-by: Arve Knudsen <[email protected]> * update all go dependencies (#13438) Signed-off-by: Augustin Husson <[email protected]> * build(deps): bump the k8s-io group with 2 updates (#13454) Bumps the k8s-io group with 2 updates: [k8s.io/api](https://github.com/kubernetes/api) and [k8s.io/client-go](https://github.com/kubernetes/client-go). Updates `k8s.io/api` from 0.28.4 to 0.29.1 - [Commits](https://github.com/kubernetes/api/compare/v0.28.4...v0.29.1) Updates `k8s.io/client-go` from 0.28.4 to 0.29.1 - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes/client-go/compare/v0.28.4...v0.29.1) --- updated-dependencies: - dependency-name: k8s.io/api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: k8s-io - dependency-name: k8s.io/client-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: k8s-io ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump the go-opentelemetry-io group with 1 update (#13453) Bumps the go-opentelemetry-io group with 1 update: [go.opentelemetry.io/collector/semconv](https://github.com/open-telemetry/opentelemetry-collector). Updates `go.opentelemetry.io/collector/semconv` from 0.92.0 to 0.93.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-collector/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG-API.md) - [Commits](https://github.com/open-telemetry/opentelemetry-collector/compare/v0.92.0...v0.93.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/collector/semconv dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-opentelemetry-io ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump actions/upload-artifact from 3.1.3 to 4.0.0 (#13355) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.3 to 4.0.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/a8a3f3ad30e3422c9c7b888a15615d19a852ae32...c7d193f32edcb7bfad88892161225aeda64e9392) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump bufbuild/buf-push-action (#13357) Bumps [bufbuild/buf-push-action](https://github.com/bufbuild/buf-push-action) from 342fc4cdcf29115a01cf12a2c6dd6aac68dc51e1 to a654ff18effe4641ebea4a4ce242c49800728459. - [Release notes](https://github.com/bufbuild/buf-push-action/releases) - [Commits](https://github.com/bufbuild/buf-push-action/compare/342fc4cdcf29115a01cf12a2c6dd6aac68dc51e1...a654ff18effe4641ebea4a4ce242c49800728459) --- updated-dependencies: - dependency-name: bufbuild/buf-push-action dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Labels: Add DropMetricName function, used in PromQL (#13446) This function is called very frequently when executing PromQL functions, and we can do it much more efficiently inside Labels. In the common case that `__name__` comes first in the labels, we simply re-point to start at the next label, which is nearly free. `DropMetricName` is now so cheap I removed the cache - benchmarks show everything still goes faster. Signed-off-by: Bryan Boreham <[email protected]> * tsdb: simplify internal series delete function (#13261) Lifting an optimisation from Agent code, `seriesHashmap.del` can use the unique series reference, doesn't need to check Labels. Also streamline the logic for deleting from `unique` and `conflicts` maps, and add some comments to help the next person. Signed-off-by: Bryan Boreham <[email protected]> * otlptranslator/update-copy.sh: Fix sed command lines Signed-off-by: Arve Knudsen <[email protected]> * Rollback k8s.io requirements (#13462) Rollback k8s.io Go modules to v0.28.6 to avoid forcing upgrade of Go to 1.21. This allows us to keep compatibility with the currently supported upstream Go releases. Signed-off-by: SuperQ <[email protected]> * Make update-copy.sh work for both OSX and GNU sed Signed-off-by: Arve Knudsen <[email protected]> * Name @beorn7 and @krajorama as maintainers for native histograms I have been the de-facto maintainer for native histograms from the beginning. So let's put this into MAINTAINERS.md. In addition, I hereby proposose George Krajcsovits AKA Krajo as a co-maintainer. He has contributed a lot of native histogram code, but more importantly, he has contributed substantially to reviewing other contributors' native histogram code, up to a point where I was merely rubberstamping the PRs he had already reviewed. I'm confident that he is ready to to be granted commit rights as outlined in the "Maintainers" section of the governance: https://prometheus.io/governance/#maintainers According to the same section of the governance, I will announce the proposed change on the developers mailing list and will give some time for lazy consensus before merging this PR. Signed-off-by: beorn7 <[email protected]> * ui/fix: correct url handling for stacked graphs (#13460) Signed-off-by: Yury Moladau <[email protected]> * tsdb: use cheaper Mutex on series Mutex is 8 bytes; RWMutex is 24 bytes and much more complicated. Since `RLock` is only used in two places, `UpdateMetadata` and `Delete`, neither of which are hotspots, we should use the cheaper one. Signed-off-by: Bryan Boreham <[email protected]> * Fix last_over_time for native histograms The last_over_time retains a histogram sample without making a copy. This sample is now coming from the buffered iterator used for windowing functions, and can be reused for reading subsequent samples as the iterator progresses. I would propose copying the sample in the last_over_time function, similar to how it is done for rate, sum_over_time and others. Signed-off-by: Filip Petkovski <[email protected]> * Implementation NOTE: Rebased from main after refactor in #13014 Signed-off-by: Danny Kopping <[email protected]> * Add feature flag Signed-off-by: Danny Kopping <[email protected]> * Refactor concurrency control Signed-off-by: Danny Kopping <[email protected]> * Optimising dependencies/dependents funcs to not produce new slices each request Signed-off-by: Danny Kopping <[email protected]> * Refactoring Signed-off-by: Danny Kopping <[email protected]> * Rename flag Signed-off-by: Danny Kopping <[email protected]> * Refactoring for performance, and to allow controller to be overridden Signed-off-by: Danny Kopping <[email protected]> * Block until all rules, both sync & async, have completed evaluating Updated & added tests Review feedback nits Return empty map if not indeterminate Use highWatermark to track inflight requests counter Appease the linter Clarify feature flag Signed-off-by: Danny Kopping <[email protected]> * Fix typo in CLI flag description Signed-off-by: Marco Pracucci <[email protected]> * Fixed auto-generated doc Signed-off-by: Marco Pracucci <[email protected]> * Improve doc Signed-off-by: Marco Pracucci <[email protected]> * Simplify the design to update concurrency controller once the rule evaluation has done Signed-off-by: Marco Pracucci <[email protected]> * Add more test cases to TestDependenciesEdgeCases Signed-off-by: Marco Pracucci <[email protected]> * Added more test cases to TestDependenciesEdgeCases Signed-off-by: Marco Pracucci <[email protected]> * Improved RuleConcurrencyController interface doc Signed-off-by: Marco Pracucci <[email protected]> * Introduced sequentialRuleEvalController Signed-off-by: Marco Pracucci <[email protected]> * Remove superfluous nil check in Group.metrics Signed-off-by: Marco Pracucci <[email protected]> * api: Serialize discovered and target labels into JSON directly (#13469) Converted maps into labels.Labels to avoid a lot of copying of data which leads to very high memory consumption while opening the /service-discovery endpoint in the Prometheus UI Signed-off-by: Leegin <[email protected]> * api: Serialize discovered labels into JSON directly in dropped targets (#13484) Converted maps into labels.Labels to avoid a lot of copying of data which leads to very high memory consumption while opening the /service-discovery endpoint in the Prometheus UI Signed-off-by: Leegin <[email protected]> * Add ShardedPostings() support to TSDB (#10421) This PR is a reference implementation of the proposal described in #10420. In addition to what described in #10420, in this PR I've introduced labels.StableHash(). The idea is to offer an hashing function which doesn't change over time, and that's used by query sharding in order to get a stable behaviour over time. The implementation of labels.StableHash() is the hashing function used by Prometheus before stringlabels, and what's used by Grafana Mimir for query sharding (because built before stringlabels was a thing). Follow up work As mentioned in #10420, if this PR is accepted I'm also open to upload another foundamental piece used by Grafana Mimir query sharding to accelerate the query execution: an optional, configurable and fast in-memory cache for the series hashes. Signed-off-by: Marco Pracucci <[email protected]> * storage/remote: document why two benchmarks are skipped One was silently doing nothing; one was doing something but the work didn't go up linearly with iteration count. Signed-off-by: Bryan Boreham <[email protected]> * Pod status changes not discovered by Kube Endpoints SD (#13337) * fix(discovery/kubernetes/endpoints): react to changes on Pods because some modifications can occur on them without triggering an update on the related Endpoints (The Pod phase changing from Pending to Running e.g.). --------- Signed-off-by: machine424 <[email protected]> Co-authored-by: Guillermo Sanchez Gavier <[email protected]> * Small improvements, add const, remove copypasta (#8106) Signed-off-by: Mikhail Fesenko <[email protected]> Signed-off-by: Jesus Vazquez <[email protected]> * Proposal to improve FPointSlice and HPointSlice allocation. (#13448) * Reusing points slice from previous series when the slice is under utilized * Adding comments on the bench test Signed-off-by: Alan Protasio <[email protected]> * lint Signed-off-by: Nicolás Pazos <[email protected]> * go mod tidy Signed-off-by: Nicolás Pazos <[email protected]> --------- Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: Bryan Boreham <[email protected]> Signed-off-by: Erik Sommer <[email protected]> Signed-off-by: Linas Medziunas <[email protected]> Signed-off-by: bwplotka <[email protected]> Signed-off-by: Arianna Vespri <[email protected]> Signed-off-by: machine424 <[email protected]> Signed-off-by: Daniel Nicholls <[email protected]> Signed-off-by: Daniel Kerbel <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Jan Fajerski <[email protected]> Signed-off-by: Kevin Mingtarja <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Giedrius Statkevičius <[email protected]> Signed-off-by: Augustin Husson <[email protected]> Signed-off-by: Jeanette Tan <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]> Signed-off-by: Kumar Kalpadiptya Roy <[email protected]> Signed-off-by: Marco Pracucci <[email protected]> Signed-off-by: tyltr <[email protected]> Signed-off-by: Ted Robertson [email protected] Signed-off-by: Ivan Babrou <[email protected]> Signed-off-by: Arve Knudsen <[email protected]> Signed-off-by: Israel Blancas <[email protected]> Signed-off-by: Ziqi Zhao <[email protected]> Signed-off-by: Björn Rabenstein <[email protected]> Signed-off-by: Goutham <[email protected]> Signed-off-by: Rewanth Tammana <[email protected]> Signed-off-by: Chris Marchbanks <[email protected]> Signed-off-by: Ben Ye <[email protected]> Signed-off-by: Oleg Zaytsev <[email protected]> Signed-off-by: SuperQ <[email protected]> Signed-off-by: Ben Kochie <[email protected]> Signed-off-by: Matthieu MOREL <[email protected]> Signed-off-by: Paulin Todev <[email protected]> Signed-off-by: Filip Petkovski <[email protected]> Signed-off-by: beorn7 <[email protected]> Signed-off-by: Augustin Husson <[email protected]> Signed-off-by: Yury Moladau <[email protected]> Signed-off-by: Danny Kopping <[email protected]> Signed-off-by: Leegin <[email protected]> Signed-off-by: Mikhail Fesenko <[email protected]> Signed-off-by: Jesus Vazquez <[email protected]> Signed-off-by: Alan Protasio <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> Co-authored-by: Julian Wiedmann <[email protected]> Co-authored-by: Bryan Boreham <[email protected]> Co-authored-by: Erik Sommer <[email protected]> Co-authored-by: Linas Medziunas <[email protected]> Co-authored-by: Bartlomiej Plotka <[email protected]> Co-authored-by: Arianna Vespri <[email protected]> Co-authored-by: machine424 <[email protected]> Co-authored-by: daniel-resdiary <[email protected]> Co-authored-by: Daniel Kerbel <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jan Fajerski <[email protected]> Co-authored-by: Kevin Mingtarja <[email protected]> Co-authored-by: Paschalis Tsilias <[email protected]> Co-authored-by: Marc Tudurí <[email protected]> Co-authored-by: Paschalis Tsilias <[email protected]> Co-authored-by: Giedrius Statkevičius <[email protected]> Co-authored-by: Augustin Husson <[email protected]> Co-authored-by: Björn Rabenstein <[email protected]> Co-authored-by: zenador <[email protected]> Co-authored-by: gotjosh <[email protected]> Co-authored-by: Ben Kochie <[email protected]> Co-authored-by: Kumar Kalpadiptya Roy <[email protected]> Co-authored-by: Marco Pracucci <[email protected]> Co-authored-by: tyltr <[email protected]> Co-authored-by: Ted Robertson <[email protected]> Co-authored-by: Julien Pivotto <[email protected]> Co-authored-by: Matthias Loibl <[email protected]> Co-authored-by: Ivan Babrou <[email protected]> Co-authored-by: Arve Knudsen <[email protected]> Co-authored-by: Israel Blancas <[email protected]> Co-authored-by: Ziqi Zhao <[email protected]> Co-authored-by: George Krajcsovits <[email protected]> Co-authored-by: Björn Rabenstein <[email protected]> Co-authored-by: Goutham <[email protected]> Co-authored-by: Rewanth Tammana <[email protected]> Co-authored-by: Chris Marchbanks <[email protected]> Co-authored-by: Ben Ye <[email protected]> Co-authored-by: Oleg Zaytsev <[email protected]> Co-authored-by: Matthieu MOREL <[email protected]> Co-authored-by: Paulin Todev <[email protected]> Co-authored-by: Filip Petkovski <[email protected]> Co-authored-by: Yury Molodov <[email protected]> Co-authored-by: Danny Kopping <[email protected]> Co-authored-by: Leegin <[email protected]> Co-authored-by: Guillermo Sanchez Gavier <[email protected]> Co-authored-by: Mikhail Fesenko <[email protected]> Co-authored-by: Alan Protasio <[email protected]> * remote write 2.0 - follow up improvements (#13478) * move remote write proto version config from a remote storage config to a per remote write configuration option Signed-off-by: Callum Styan <[email protected]> * rename scrape config for metadata, fix 2.0 header var name/value (was 1.1), and more clean up Signed-off-by: Callum Styan <[email protected]> * address review comments, mostly lint fixes Signed-off-by: Callum Styan <[email protected]> * another lint fix Signed-off-by: Callum Styan <[email protected]> * lint imports Signed-off-by: Callum Styan <[email protected]> --------- Signed-off-by: Callum Styan <[email protected]> * go mod tidy Signed-off-by: Nicolás Pazos <[email protected]> * Added commmentary to RW 2.0 protocol for easier adoption and explicit semantics. (#13502) * Added commmentary to RW 2.0 protocol for easier adoption and explicit semantics. Signed-off-by: bwplotka <[email protected]> * Apply suggestions from code review Co-authored-by: Nico Pazos <[email protected]> Signed-off-by: Callum Styan <[email protected]> --------- Signed-off-by: bwplotka <[email protected]> Signed-off-by: Callum Styan <[email protected]> Co-authored-by: Callum Styan <[email protected]> Co-authored-by: Nico Pazos <[email protected]> * prw2.0: Added support for "custom" layouts for native histogram proto (#13558) * prw2.0: Added support for "custom" layouts for native histogram. Result of the discussions: * https://github.com/prometheus/prometheus/issues/13475#issuecomment-1931496924 * https://cloud-native.slack.com/archives/C02KR205UMU/p1707301006347199 Signed-off-by: bwplotka <[email protected]> * prw2.0: Added support for "custom" layouts for native histogram. Result of the discussions: * https://github.com/prometheus/prometheus/issues/13475#issuecomment-1931496924 * https://cloud-native.slack.com/archives/C02KR205UMU/p1707301006347199 Signed-off-by: bwplotka <[email protected]> # Conflicts: # prompb/write/v2/types.pb.go * Update prompb/write/v2/types.proto Co-authored-by: George Krajcsovits <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]> * Addressed comments, fixed test. Signed-off-by: bwplotka <[email protected]> --------- Signed-off-by: bwplotka <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]> Co-authored-by: George Krajcsovits <[email protected]> * first draft of content negotiation Signed-off-by: Alex Greenbank <[email protected]> * Lint Signed-off-by: Alex Greenbank <[email protected]> * Fix race in test Signed-off-by: Alex Greenbank <[email protected]> * Fix another test race Signed-off-by: Alex Greenbank <[email protected]> * Almost done with lint Signed-off-by: Alex Greenbank <[email protected]> * Fix todos around 405 HEAD handling Signed-off-by: Alex Greenbank <[email protected]> * Changes based on review comments Signed-off-by: Alex Greenbank <[email protected]> * Update storage/remote/client.go Co-authored-by: Bartlomiej Plotka <[email protected]> Signed-off-by: Alex Greenbank <[email protected]> * Latest updates to review comments Signed-off-by: Alex Greenbank <[email protected]> * latest tweaks Signed-off-by: Alex Greenbank <[email protected]> * remote write 2.0 - content negotiation remediation (#13921) * Consolidate renegotiation error into one, fix tests Signed-off-by: Alex Greenbank <[email protected]> * fix metric name and actuall increment counter Signed-off-by: Alex Greenbank <[email protected]> --------- Signed-off-by: Alex Greenbank <[email protected]> * Fixes after main sync. Signed-off-by: bwplotka <[email protected]> * [PRW 2.0] Moved rw2 proto to the full path (both package name and placement) (#13973) undefined * [PRW2.0] Remove benchmark scripts (#13949) See rationales on https://docs.google.com/document/d/1Bpf7mYjrHUhPHkie0qlnZFxzgqf_L32kM8ZOknSdJrU/edit Signed-off-by: bwplotka <[email protected]> * rw20: Update prw commentary after Callum spec review (#14136) * rw20: Update prw commentary after Callum spec review Signed-off-by: Bartlomiej Plotka <[email protected]> * Update types.proto Signed-off-by: Bartlomiej Plotka <[email protected]> --------- Signed-off-by: Bartlomiej Plotka <[email protected]> * [PRW 2.0] Updated spec proto (2.0-rc.1); deterministic v1 interop; to be sympathetic with implementation. (#14330) * [PRW 2.0] Updated spec proto (2.0-rc.1); deterministic v1 interop; to be sympathetic with implementation. Signed-off-by: bwplotka <[email protected]> * update custom marshalling Signed-off-by: bwplotka <[email protected]> * Removed confusing comments. Signed-off-by: bwplotka <[email protected]> --------- Signed-off-by: bwplotka <[email protected]> * [PRW-2.0] (chain1) New Remote Write 2.0 Config options for 2.0-rc.1 spec. (#14335) NOTE: For simple review this change does not touch remote/ packages, only main and configs. Spec: https://prometheus.io/docs/specs/remote_write_spec_2_0 Supersedes https://github.com/prometheus/prometheus/pull/13968 Signed-off-by: bwplotka <[email protected]> * [PRW-2.0] (part 2) Removed automatic negotiation, updates for the latest spec semantics in remote pkg (#14329) * [PRW-2.0] (part2) Moved to latest basic negotiation & spec semantics. Spec: https://github.com/prometheus/docs/pull/2462 Supersedes https://github.com/prometheus/prometheus/pull/13968 Signed-off-by: bwplotka <[email protected]> # Conflicts: # config/config.go # docs/configuration/configuration.md # storage/remote/queue_manager_test.go # storage/remote/write.go # web/api/v1/api.go * Addressed comments. Signed-off-by: bwplotka <[email protected]> --------- Signed-off-by: bwplotka <[email protected]> * lint Signed-off-by: Nicolás Pazos <[email protected]> * storage/remote tests: refactor: extract function newTestQueueManager To reduce repetition. Signed-off-by: Bryan Boreham <[email protected]> Signed-off-by: Nicolás Pazos <[email protected]> * use newTestQueueManager for test Signed-off-by: Nicolás Pazos <[email protected]> * go mod tidy Signed-off-by: Nicolás Pazos <[email protected]> * [PRW 2.0] (part3) moved type specific conversions to prompb and writev2 codecs. Signed-off-by: bwplotka <[email protected]> * Added test for rwProtoMsgFlagParser; fixed TODO comment. Signed-off-by: bwplotka <[email protected]> * Renamed DecodeV2WriteRequestStr to DecodeWriteV2Request (with tests). Signed-off-by: bwplotka <[email protected]> * Addressed comments on remote_storage example, updated it for 2.0 Signed-off-by: bwplotka <[email protected]> * Fixed `--enable-feature=metadata-wal-records` docs and error when using PRW 2.0 without it. Signed-off-by: bwplotka <[email protected]> * Addressed Callum comments on custom*.go Signed-off-by: bwplotka <[email protected]> * Added TODO to genproto. Signed-off-by: bwplotka <[email protected]> * Addressed Callum comments in remote pkg. Signed-off-by: bwplotka <[email protected]> * Added metadata validation to write handler test; fixed ToMetadata. Signed-off-by: bwplotka <[email protected]> * Addressed rest of Callum comments. Signed-off-by: bwplotka <[email protected]> * Fixed writev2.FromMetadataType (was wrongly using prompb). Signed-off-by: bwplotka <[email protected]> * fix a few import whitespaces Signed-off-by: Callum Styan <[email protected]> * add a default case with an error to the example RW receiver Signed-off-by: Callum Styan <[email protected]> * more minor import whitespace chagnes Signed-off-by: Callum Styan <[email protected]> * Apply suggestions from code review Signed-off-by: Bartlomiej Plotka <[email protected]> * Update storage/remote/queue_manager_test.go Signed-off-by: Bartlomiej Plotka <[email protected]> --------- Signed-off-by: Nicolás Pazos <[email protected]> Signed-off-by: Callum Styan <[email protected]> Signed-off-by: bwplotka <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: Bryan Boreham <[email protected]> Signed-off-by: Erik Sommer <[email protected]> Signed-off-by: Linas Medziunas <[email protected]> Signed-off-by: Arianna Vespri <[email protected]> Signed-off-by: machine424 <[email protected]> Signed-off-by: Daniel Nicholls <[email protected]> Signed-off-by: Daniel Kerbel <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Jan Fajerski <[email protected]> Signed-off-by: Kevin Mingtarja <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Marc Tuduri <[email protected]> Signed-off-by: Paschalis Tsilias <[email protected]> Signed-off-by: Giedrius Statkevičius <[email protected]> Signed-off-by: Augustin Husson <[email protected]> Signed-off-by: Jeanette Tan <[email protected]> Signed-off-by: Bartlomiej Plotka <[email protected]> Signed-off-by: Kumar Kalpadiptya Roy <[email protected]> Signed-off-by: Marco Pracucci <[email protected]> Signed-off-by: tyltr <[email protected]> Signed-off-by: Ted Robertson [email protected] Signed-off-by: Ivan Babrou <[email protected]> Signed-off-by: Arve Knudsen <[email protected]> Signed-off-by: Israel Blancas <[email protected]> Signed-off-by: Ziqi Zhao <[email protected]> Signed-off-by: Björn Rabenstein <[email protected]> Signed-off-by: Goutham <[email protected]> Signed-off-by: Rewanth Tammana <[email protected]> Signed-off-by: Chris Marchbanks <[email protected]> Signed-off-by: Ben Ye <[email protected]> Signed-off-by: Oleg Zaytsev <[email protected]> Signed-off-by: SuperQ <[email protected]> Signed-off-by: Ben Kochie <[email protected]> Signed-off-by: Matthieu MOREL <[email protected]> Signed-off-by: Paulin Todev <[email protected]> Signed-off-by: Filip Petkovski <[email protected]> Signed-off-by: beorn7 <[email protected]> Signed-off-by: Augustin Husson <[email protected]> Signed-off-by: Yury Moladau <[email protected]> Signed-off-by: Danny Kopping <[email protected]> Signed-off-by: Leegin <[email protected]> Signed-off-by: Mikhail Fesenko <[email protected]> Signed-off-by: Jesus Vazquez <[email protected]> Signed-off-by: Alan Protasio <[email protected]> Signed-off-by: Alex Greenbank <[email protected]> Co-authored-by: Nicolás Pazos <[email protected]> Co-authored-by: Callum Styan <[email protected]> Co-authored-by: Nicolás Pazos <[email protected]> Co-authored-by: alexgreenbank <[email protected]> Co-authored-by: Marco Pracucci <[email protected]> Co-authored-by: Paschalis Tsilias <[email protected]> Co-authored-by: Julian Wiedmann <[email protected]> Co-authored-by: Bryan Boreham <[email protected]> Co-authored-by: Erik Sommer <[email protected]> Co-authored-by: Linas Medziunas <[email protected]> Co-authored-by: Arianna Vespri <[email protected]> Co-authored-by: machine424 <[email protected]> Co-authored-by: daniel-resdiary <[email protected]> Co-authored-by: Daniel Kerbel <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot…
Add `query analyze` command to promtool This command analyzes the buckets of classic and native histograms, based on data queried from the Prometheus query API, i.e. it doesn't require direct access to the TSDB files. Signed-off-by: Jeanette Tan <[email protected]> --------- Signed-off-by: Jeanette Tan <[email protected]>
Porting grafana/mimir#4837 from mimirtool to promtool, which adds a command to retrieve basic statistics for recent usage of classic and native histograms.
Purpose: to get some insight into classic/native histograms bucket utilization with the goal of predicting cost increase/saving when switching from/to native histograms. This is just an estimate for the case when the actual blocks are not available.
Example command for classic histograms (metric name must end in
_sum):promtool query analyze --server=https://<TENANT>:<API_KEY>@<URL>/api/prom --type=classichistograms --duration=1h --match="{__name__=~\".*_sum\"}"Example result line for classic histograms:
cortex_request_duration_seconds_bucket{cluster="dev-us-central-0",container="store-gateway",instance="store-gateway-zone-a-0:store-gateway:http-metrics",prometheus_job="nativehistogram",route="metrics",job="mimir-dev-12/store-gateway-zone-a",method="GET",namespace="mimir-dev-12",pod="store-gateway-zone-a-0",status_code="200",ws="false"}[1h0m0s]=Bucket stats (min/avg/max) - number of buckets changed: 1/1.891/3 total delta of changed buckets: 3/3.996/4 number of populated buckets: 4/4.000/4. total number of buckets: 15Example command for native histograms:
promtool query analyze --server=https://<TENANT>:<API_KEY>@<URL>/api/prom --type=nativehistograms --duration=1h --match="{__name__=~\"cortex_request_.*\"}"Example result line for native histograms:
cortex_request_duration_seconds{container="store-gateway",instance="store-gateway-zone-c-0:store-gateway:http-metrics",method="GET",namespace="mimir-dev-12",status_code="200",cluster="dev-us-central-0",job="mimir-dev-12/store-gateway-zone-c",pod="store-gateway-zone-c-0",prometheus_job="nativehistogram",route="metrics",ws="false"}[1h0m0s]=Bucket stats (min/avg/max) - number of buckets changed: 2/3.347/4 total delta of changed buckets: 3/3.987/4 number of populated buckets: 12/16.301/17. total number of buckets: 17Example summary for classic histograms:
Example summary for native histograms:
Just from these overall stats, we can see a pattern of native histograms having higher resolution (more buckets), and higher efficiency (fewer unpopulated buckets).
Update:
New command:
promtool query analyze --server=https://<TENANT>:<API_KEY>@<URL>/api/prom --type=histogram --duration=1h --match="{__name__=~\"cortex_request_.*\"}"Aggregated results: