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>
2 years ago
Bryan Boreham
6136ae67e0
labels: shrink by making internals a single string
...
This commit adds an alternate implementation for `labels.Labels`, behind
a build tag `stringlabels`.
Instead of storing label names and values as individual strings, they
are all concatenated into one string in this format:
[len][name0][len][value0][len][name1][len][value1]...
The lengths are varint encoded so usually a single byte.
The previous `[]string` had 24 bytes of overhead for the slice and 16
for each label name and value; this one has 16 bytes overhead plus 1
for each name and value.
In `ScratchBuilder.Overwrite` and `Labels.Hash` we use an unsafe
conversion from string to byte slice. `Overwrite` is explicitly unsafe,
but for `Hash` this is a pure performance hack.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2 years ago
Bryan Boreham
3f7ba22bde
rules: two places need to call EmptyLabels
...
Can't assume nil is a valid value.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2 years ago
Ganesh Vernekar
66da1d51fd
Merge pull request #12003 from codesome/redundant-chunk-access
...
Remove unnecessary chunk fetch in Head queries
2 years ago
Ganesh Vernekar
d504c950a2
Remove unnecessary chunk fetch in Head queries
...
`safeChunk` is only obtained from the `headChunkReader.Chunk` call where
the chunk is already fetched and stored with the `safeChunk`. So, when
getting the iterator for the `safeChunk`, we don't need to get the chunk again.
Also removed a couple of unnecessary fields from `safeChunk` as a part of this.
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2 years ago
Ganesh Vernekar
bfcf69b4a4
Merge pull request #12004 from vishalnad/main
...
Observe delta in seconds prometheus_tsdb_sample_ooo_delta
2 years ago
Vishal N
96ba6831ae
Observe delta in seconds prometheus_tsdb_sample_ooo_delta
...
Signed-off-by: Vishal Nadagouda <vishalmn1996@gmail.com>
2 years ago
Jimmie Han
a13249a98f
scrape: fix prometheus_target_scrape_pool_target_limit metric not set on creating scrape pool ( #12001 )
...
Signed-off-by: Jimmie Han <hanjinming@outlook.com>
2 years ago
Ben Kochie
86d3d5fec6
Merge pull request #11993 from prometheus/superq/bump_golangci-lint
...
Update golangci-lint
2 years ago
SuperQ
65e743719c
Update golangci-lint
...
Update to the latest release, supports Go 1.20.
Signed-off-by: SuperQ <superq@gmail.com>
2 years ago
Shan Aminzadeh
3f6f5d3357
Scope GroupBy labels to metric ( #11914 )
...
Signed-off-by: Shan Aminzadeh <shan.aminzadeh@chronosphere.io>
2 years ago
dependabot[bot]
2d588725c1
build(deps): bump bufbuild/buf-setup-action from 1.12.0 to 1.13.1 ( #11922 )
...
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action ) from 1.12.0 to 1.13.1.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases )
- [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.12.0...v1.13.1 )
---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
dependabot[bot]
94e0801f9f
build(deps): bump actions/cache from 3.2.3 to 3.2.4 ( #11920 )
...
Bumps [actions/cache](https://github.com/actions/cache ) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/actions/cache/releases )
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md )
- [Commits](https://github.com/actions/cache/compare/v3.2.3...v3.2.4 )
---
updated-dependencies:
- dependency-name: actions/cache
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>
2 years ago
dependabot[bot]
bb18bb3d1f
build(deps): bump golangci/golangci-lint-action from 3.3.1 to 3.4.0 ( #11921 )
...
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action ) from 3.3.1 to 3.4.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases )
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v3.3.1...v3.4.0 )
---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years ago
Julien Pivotto
259bb5c692
Merge pull request #11826 from dannykopping/dannykopping/rule-eval
...
Pass rule details in evaluation context
2 years ago
Julien Pivotto
e1679a80f3
Merge pull request #11936 from kelnage/sanitize-labels-edge-cases
...
Fix SanitizeLabelName for certain edge case invalid labels
2 years ago
Julien Pivotto
8a8f594b16
Merge pull request #11487 from FUSAKLA/fus-promtool-http-config
...
Promtool: add http config support to query commands
2 years ago
Martin Chodur
f1de2cec3d
fix: set the http round tripper fro promtool import command
...
Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
2 years ago
Julien Pivotto
dfd2b5340e
Merge pull request #11951 from Fish-pro/chore/httpvar
...
Use http constants instead of string
2 years ago
Martin Chodur
3ebe4b48db
feat: add promtool http config support
...
Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
2 years ago
Justin Lei
af1d9e01c7
Refactor tsdbutil for tests/native histograms ( #11948 )
...
* Add float histograms to ChunkFromSamplesGeneric
Signed-off-by: Justin Lei <justin.lei@grafana.com>
* Add Generate*Samples functions to tsdbutil
Signed-off-by: Justin Lei <justin.lei@grafana.com>
* PR responses
Signed-off-by: Justin Lei <justin.lei@grafana.com>
---------
Signed-off-by: Justin Lei <justin.lei@grafana.com>
2 years ago
Fish-pro
43d77f7c41
Use http constants instead of string
...
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
2 years ago
Ganesh Vernekar
36b04efc7b
Merge pull request #11947 from prometheus/beorn7/protobuf
...
protobuf: Mark repeated fields as non-nullable
2 years ago
Ganesh Vernekar
ebc2b419ca
Merge pull request #11935 from charleskorn/non-nullable-bucketspans
...
Mark `Histogram.positive_spans` and `negative_spans` as non-nullable.
2 years ago
beorn7
1dd53843b6
protobuf: Mark repeated fields as non-nullable
...
Inspired by #11935 , we can do it here, too.
Also, clean up indentation.
Signed-off-by: beorn7 <beorn@grafana.com>
2 years ago
Damien Grisonnet
e3b5416d05
model/textparse: improve error outputs
...
Parsing errors in the Prometheus HTTP format parser are very hard to
investigate since they only approximately indicate what is going wrong
in the parser and don't provide any information about the incorrect
input. As such it is very hard to tell what is wrong in the format
exposed by the application.
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2 years ago
Nick Moore
c05ebef306
Implement SanitizeLabelName and Full variant
...
Rather than removing the previous implementation of SanitizeLabelName,
offer another version named SanitizeFullLabelName that achieved the
desired requirements, without breaking existing Prometheus code.
Update testing to validate correctness of new variant.
Signed-off-by: Nick Moore <nicholas.moore@grafana.com>
2 years ago
Nick Moore
758914e1fb
Fix SanitizeLabelName for certain invalid labels
...
SanitizeLabelName was not correctly sanitizing label names that:
1. Started with a digit (0-9)
2. Were empty
This commit changes the santization code to catch both of these edge
cases and adds new tests to validate it works correctly in them both. In
the first case, a leading digit will be replaced with an underscore, and
in the latter, the function will return a single underscore.
Signed-off-by: Nick Moore <nicholas.moore@grafana.com>
2 years ago
Charles Korn
0a1de58f7e
Mark Histogram.(Positive|Negative)Spans as non-nullable.
...
As far as I understand it, we'd never expect to receive a nil span,
and remote.spansProtoToSpans would panic if we received a nil span.
Marking the fields as non-nullable also means the generated Golang
code doesn't use pointers for these fields, reducing allocations.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2 years ago
Julien Pivotto
c70d85baed
Merge pull request #11916 from prometheus/release-2.42
...
Merge 2.42 to main
2 years ago
George Krajcsovits
1f0cc09579
Export single ith test histogram generation functions ( #11911 )
...
* Export single ith test histogram generation functions
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
* Do not set counter reset hint for non-gauge histograms individually
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
* Apply suggestions from code review
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
---------
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
2 years ago
Kemal Akkoyun
225c61122d
Cut v2.42.0 ( #11912 )
...
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2 years ago
Kemal Akkoyun
aee2ea4713
Update changelog for 2.42 ( #11909 )
...
* Update changelog
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
* Reorder entries
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
---------
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2 years ago
Charles Korn
e023d896f2
Correct statement in docs about query results returning either floats or histograms but not both. ( #11880 )
...
* Correct statement in docs about query results returning either floats or histograms but not both.
* Move documentation for range and instant vectors under their corresponding headings.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2 years ago
Ganesh Vernekar
8e8b718365
Merge pull request #11858 from fayzal-g/fix-chunks-metrics
...
tsdb: when reading WAL, correctly update chunksRemoved and chunks metrics
2 years ago
Kemal Akkoyun
7b9cc7eea3
Cut v2.42.0-rc.0 ( #11902 )
...
* Cut v2.42.0-rc.0
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
* Add missing log items
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2 years ago
Bartlomiej Plotka
6dcfb71740
Merge pull request #11897 from pracucci/propose-to-change-query-canceled-status-code
...
API: change HTTP status code from 503/422 to 499 if a request is canceled
2 years ago
Marco Pracucci
3db77b4491
API: change HTTP status code tracked in metrics form 503/422 to 499 if a request is canceled
...
Signed-off-by: Marco Pracucci <marco@pracucci.com>
2 years ago
Kemal Akkoyun
068b6189d8
Merge pull request #11899 from prometheus/dependabot/go_modules/github.com/aws/aws-sdk-go-1.44.187
...
build(deps): bump github.com/aws/aws-sdk-go from 1.44.186 to 1.44.187
2 years ago
Kemal Akkoyun
0945628a55
Merge pull request #11901 from prometheus/dependabot/github_actions/actions/cache-3.2.3
...
build(deps): bump actions/cache from 3.2.2 to 3.2.3
2 years ago
Danny Kopping
98c70e1817
Correcting NewAlertingRule args
...
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
2 years ago
Danny Kopping
df078e0a84
Merge branch 'main' into dannykopping/rule-eval
...
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
2 years ago
Björn Rabenstein
60d763282e
Merge pull request #11864 from prometheus/beorn7/histogram2
...
histograms: Return actually useful counter reset hints
2 years ago
Bartlomiej Plotka
aee77bc790
Merge pull request #11895 from kakkoyun/upgrade_ui_deps
...
Upgrade UI dependencies
2 years ago
dependabot[bot]
ad25842b0b
build(deps): bump actions/cache from 3.2.2 to 3.2.3
...
Bumps [actions/cache](https://github.com/actions/cache ) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/actions/cache/releases )
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md )
- [Commits](https://github.com/actions/cache/compare/v3.2.2...v3.2.3 )
---
updated-dependencies:
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2 years ago
Kemal Akkoyun
c3b358d203
Merge pull request #11893 from kakkoyun/upgrade_several_dependencies
...
Upgrade several CI dependencies
2 years ago
dependabot[bot]
787e50550b
build(deps): bump github.com/aws/aws-sdk-go from 1.44.186 to 1.44.187
...
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go ) from 1.44.186 to 1.44.187.
- [Release notes](https://github.com/aws/aws-sdk-go/releases )
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.186...v1.44.187 )
---
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>
2 years ago
Kemal Akkoyun
441e1df0ee
Update dependencies for 2.42 ( #11891 )
...
* Update dependencies
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
* Revert azure sdk upgrade
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2 years ago
dependabot[bot]
104b07511d
build(deps): bump bufbuild/buf-setup-action from 1.9.0 to 1.12.0
...
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action ) from 1.9.0 to 1.12.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases )
- [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.9.0...v1.12.0 )
---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2 years ago
dependabot[bot]
b508ae6318
Bump dessant/lock-threads from 3 to 4
...
Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads ) from 3 to 4.
- [Release notes](https://github.com/dessant/lock-threads/releases )
- [Changelog](https://github.com/dessant/lock-threads/blob/master/CHANGELOG.md )
- [Commits](https://github.com/dessant/lock-threads/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: dessant/lock-threads
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2 years ago