Commit graph

10947 commits

Author SHA1 Message Date
Charles Korn 38c1930f48
Merge branch 'main' into api-response-format-extension-point
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2023-03-09 12:06:26 +11:00
Charles Korn 46a28899a0
Implement fully-featured content negotiation for API requests, and allow overriding the default API codec.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2023-03-09 12:02:45 +11:00
Arve Knudsen 435b500de7
remote: Convert to RecoverableError using errors.As (#12103)
In storage/remote, try converting to RecoverableError using errors.As,
instead of through direct casting.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2023-03-08 13:58:09 -07:00
Julien Pivotto 9afbb23d4a
Merge pull request #12100 from prometheus/bump-otel-1-14
Bump Otel and dependencies from 1.11.2 to 1.14.0
2023-03-08 20:59:14 +01:00
Julien Pivotto f2e3c9f98c
Merge pull request #12098 from roidelapluie/update-our-deps
Update our own dependencies, support proxy from env
2023-03-08 20:58:36 +01:00
Julien Pivotto 1fd59791e1 Update tests
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-03-08 16:32:39 +01:00
Charles Korn 3db98d7dde
Avoid unnecessary allocations in recording rule evaluation (#11812)
Re-use the Builder each time round the loop.
2023-03-08 12:57:19 +00:00
Bryan Boreham 57d8037f2c Bump Otel and dependencies from 1.11.2 to 1.14.0
Direct imports:
	go.opentelemetry.io/otel v1.14.0
	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0
	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0
	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0
	go.opentelemetry.io/otel/sdk v1.14.0
	go.opentelemetry.io/otel/trace v1.14.0

These seem to correspond:
	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.39.0

Other direct dependencies required to update by Otel:
	github.com/stretchr/testify v1.8.2
	google.golang.org/grpc v1.53.0

Indirect dependencies required to update by Otel:
	cloud.google.com/go/compute v1.15.1
	github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b
	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0
	go.opentelemetry.io/otel/metric v0.36.0

Also the import of go.opentelemetry.io/otel/semconv had to be updated
to v1.17.0 to match 60f7d42d1e/sdk/resource/process.go (L25)

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-03-08 11:35:14 +00:00
Julien Pivotto 0c56e5d014 Update our own dependencies, support proxy from env
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-03-08 12:00:17 +01:00
Julien Pivotto 80cf90b080
Merge pull request #12097 from roidelapluie/shepherd
Add roidelapluie as 2.43 Release Shepherd
2023-03-08 11:55:17 +01:00
Julien Pivotto 7989bc4f55 Add roidelapluie as 2.43 Release Shepherd
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-03-08 11:26:03 +01:00
tyltr 24a9678dcc
typo 'efficcient' (#12090)
Signed-off-by: tylitianrui <tylitianrui@126.com>
2023-03-08 09:59:08 +00:00
Julien Pivotto 58d3f148bf
Merge pull request #12088 from roidelapluie/ld-per-query
Add support for lookbackdelta per query via the API
2023-03-08 09:00:13 +01:00
Julien Pivotto db2d759b81 Add support for lookbackdelta per query via the API
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-03-08 00:30:05 +01:00
Julien Pivotto c4da9cd92f
Merge pull request #12019 from roidelapluie/scrape-config-files
Add include scrape configs
2023-03-07 22:45:38 +01:00
Đurica Yuri Nikolić c9b85afd93
Making the number of CPUs used for WAL replay configurable (#12066)
Adds `WALReplayConcurrency` as an option on tsdb `Options` and `HeadOptions`.
If it is not set or set <=0, then `GOMAXPROCS` is used, which matches the previous behaviour.

Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
2023-03-07 16:41:33 +00:00
Bryan Boreham ff993b279a
Merge pull request #12073 from bboreham/slices-sort2
labels: use slices.Sort for better performance
2023-03-07 09:31:50 +00:00
Bryan Boreham 99b3961907
Merge pull request #12072 from bboreham/stringlabels-builder-size
labels-as-strings: size buffer for added labels
2023-03-07 09:27:56 +00:00
Julien Pivotto 599b70a05d Add include scrape configs
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-03-06 23:35:39 +01:00
Bryan Boreham 38c6d3da9f labels: use slices.Sort for better performance
The difference is modest, but we've used `slices.Sort` in lots of other
places so why not here.

name     old time/op    new time/op    delta
Builder    1.04µs ± 3%    0.95µs ± 3%   -8.27%  (p=0.008 n=5+5)

name     old alloc/op   new alloc/op   delta
Builder      312B ± 0%      288B ± 0%   -7.69%  (p=0.008 n=5+5)

name     old allocs/op  new allocs/op  delta
Builder      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-03-06 18:22:49 +00:00
Bryan Boreham a07a0be024 Add benchmark for labels.Builder
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-03-06 18:21:58 +00:00
Bryan Boreham 30297f0d9b stringlabels: size buffer for added labels
This makes the buffer the correct size for the common case that labels
have only been added. It will be too large for the case that labels are
changed, but the current buffer resize logic in `appendLabelTo` doubles
the buffer, so a small over-estimate is better.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-03-06 16:29:21 +00:00
Julien Pivotto d437f0bb6b
Merge pull request #12039 from prometheus/dependabot/go_modules/go.uber.org/goleak-1.2.1
build(deps): bump go.uber.org/goleak from 1.2.0 to 1.2.1
2023-03-06 15:33:16 +01:00
Julien Pivotto ac9b52db91
Merge pull request #12043 from prometheus/dependabot/go_modules/documentation/examples/remote_storage/github.com/stretchr/testify-1.8.2
build(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /documentation/examples/remote_storage
2023-03-06 15:32:37 +01:00
Julien Pivotto f35ac7929d
Merge pull request #12002 from hanjm/fix/jimmiehan-fix-scrape_pool_target_limit-metric
scrape: fix prometheus_target_scrape_pool_target_limit metric not set on creating scrape pool
2023-03-06 14:41:20 +01:00
Julien Pivotto 64f07cb887
Merge pull request #12065 from roidelapluie/svg-logo-direct
Directly include SVG logo in the page.
2023-03-06 13:20:48 +01:00
Julien Pivotto 631c2e9381
Merge pull request #12057 from hdost/add-parser-documentation
promql: Add a Makefile target for goyacc
2023-03-06 11:58:41 +01:00
Harold Dost ba1918b6d3 promql: Add a Makefile target for goyacc
* Add documentation for goyacc as relevant
* Ignore the y.output since it's not needed for build process.

Signed-off-by: Harold Dost <h.dost@criteo.com>
2023-03-06 11:01:23 +01:00
Julien Pivotto d2f5fdd17e
Merge pull request #12058 from Dup4/fix-typo
chore: fix ignore file_name
2023-03-06 00:49:32 +01:00
Julien Pivotto aeb44cd15a
Merge pull request #11984 from jonatan-ivanov/exemplars-for-all-time-series
Add Exemplars support for all time series
2023-03-05 23:14:07 +01:00
Dup4 adac7bcd1e
chore: fix ignore file_name
Signed-off-by: Dup4 <lyuzhi.pan@gmail.com>
2023-03-05 23:04:28 +08:00
Jonatan Ivanov 9225d118dc
Add Exemplars support for all time series
This change removes restrictions to allow adding exemplars
to all time series. It also contains some improvements in test values
so that it is easier to track what is tested.
The advantage of doing this is having a little less error-prone tests:
"yy" is not really descriptive but "counter-test" can give people
a better idea about what is tested so it is harder to make mistakes.

Closes gh-11982

Signed-off-by: Jonatan Ivanov <jonatan.ivanov@gmail.com>
2023-03-03 17:09:17 -08:00
Julien Pivotto 8e4350dd59 Directly include SVG logo in the page.
Use HTML <svg> element to include Prometheus logo in the status page.

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2023-03-04 00:36:07 +01:00
ansalamdaniel c1c444504e
Feat: metrics for head_chunks & wal folders (#12013)
Signed-off-by: ansalamdaniel <ansalam.daniel@infracloud.io>
2023-03-02 15:25:56 +05:30
dependabot[bot] 59cc7389fa
build(deps): bump github.com/stretchr/testify
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.1...v1.8.2)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-02 00:00:04 +00:00
dependabot[bot] e1a6e6faa6
build(deps): bump go.uber.org/goleak from 1.2.0 to 1.2.1
Bumps [go.uber.org/goleak](https://github.com/uber-go/goleak) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/uber-go/goleak/releases)
- [Changelog](https://github.com/uber-go/goleak/blob/master/CHANGELOG.md)
- [Commits](https://github.com/uber-go/goleak/compare/v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: go.uber.org/goleak
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 23:58:57 +00:00
Rens Groothuijsen d33eb3ab17
Automatically remove incorrect snapshot with index that is ahead of WAL (#11859)
Signed-off-by: Rens Groothuijsen <l.groothuijsen@alumni.maastrichtuniversity.nl>
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2023-03-01 17:51:02 +05:30
Renning Bruns 5ec1b4baaf
make hashmod a lot easier to read and a little faster (#11551)
Previous code was effectively doing BigEndian.Uint64, so call that and save time.
An md5.Sum result is always 16 bytes. The first 8 are not used in the result, just as before.

Signed-off-by: Renning Bruns <ren@renmail.net>
2023-02-28 17:36:58 +00:00
dependabot[bot] 53bb046d21
build(deps): bump github.com/aws/aws-sdk-go from 1.44.187 to 1.44.207 (#12015)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.187 to 1.44.207.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.187...v1.44.207)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-28 16:34:24 +01:00
Bartlomiej Plotka 8f3b2fc9ae
Merge pull request #12020 from amrmahdi/amrh/GHSA-vvpx-j8f3-3w6h
Update golang.org/x/net to v0.7.0 ato address GHSA-vvpx-j8f3-3w6h
2023-02-25 17:21:11 +01:00
Amr Hanafi (MAHDI)) 4126985908 Update golang.org/x/net to v0.7.0 ato address GHSA-vvpx-j8f3-3w6h
https://github.com/advisories/GHSA-vvpx-j8f3-3w6h
Signed-off-by: Amr Hanafi (MAHDI)) <amrh@microsoft.com>
2023-02-24 09:35:09 -08:00
Bryan Boreham 35026fb26d
Merge pull request #11746 from prometheus/remove-microbenchmarks
These benchmarks were testing things related to what Prometheus does, but not testing actual Prometheus code. 
Moved the label-copying benchmark into the labels package.
2023-02-23 12:33:24 +01:00
Julien Pivotto 475f9984d0
Merge pull request #11787 from damnever/perf/avoid-alloc-if-no-externallabels
Avoid allocation during remote write if external labels is empty
2023-02-22 23:38:21 +01:00
Julien Pivotto 46f9c34d90
Merge pull request #11770 from prometheus/nexucis/fix-bump-ui-version
fix ui bump version on mac
2023-02-22 23:37:08 +01:00
Levi Harrison 64ff6bece6
Merge pull request #11682 from dgrisonnet/parsing-errors
Improve the Prometheus parser error outputs to be more comprehensive
2023-02-22 17:35:27 -05:00
Julien Pivotto 666f61a4d5
Merge pull request #10991 from bboreham/labels-as-string
labels.Labels: reduce memory by storing as a single string
2023-02-22 21:01:20 +01:00
Bryan Boreham f03b8d0968 Add benchmark copying labels
Taken from previous tsdb/test/BenchmarkLabelsClone.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-02-22 16:36:45 +00:00
Bryan Boreham f34b2cede3 Remove microbenchmarks
These benchmarks are all testing things related to what Prometheus does,
so perhaps have some historical interest, but we should not retain them
in the main repo.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-02-22 16:36:45 +00:00
Damien Grisonnet 0fee615719 model/textparse: improve openmetrics error outputs
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2023-02-22 17:19:01 +01:00
Bryan Boreham 4a49ec3a25 CI: additionally run tests with 'stringlabel' tag
This checks that no code is assuming things about `labels.Labels` which
don't work with the alternate implementation.

Co-authored-by: Julien Pivotto <roidelapluie@o11y.eu>
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-02-22 15:34:23 +00:00