Commit Graph

14081 Commits (357e64dbe97964f02d8850c4005b8fa55166de40)

Author SHA1 Message Date
Björn Rabenstein 5fd2717aec
Merge pull request #14715 from prometheus/beorn7/lint
lint: Revamp our linting rules, mostly around doc comments
2024-08-22 17:56:40 +02:00
beorn7 0f760f63dd lint: Revamp our linting rules, mostly around doc comments
Several things done here:

- Set `max-issues-per-linter` to 0 so that we actually see all linter
  warnings and not just 50 per linter. (As we also set
  `max-same-issues` to 0, I assume this was the intention from the
  beginning.)

- Stop using the golangci-lint default excludes (by setting
  `exclude-use-default: false`. Those are too generous and don't match
  our style conventions. (I have re-added some of the excludes
  explicitly in this commit. See below.)

- Re-add the `errcheck` exclusion we have used so far via the
  defaults.

- Exclude the signature requirement `govet` has for `Seek` methods
  because we use non-standard `Seek` methods a lot. (But we keep other
  requirements, while the default excludes completely disabled the
  check for common method segnatures.)

- Exclude warnings about missing doc comments on exported symbols. (We
  used to be pretty adamant about doc comments, but stopped that at
  some point in the past. By now, we have about 500 missing doc
  comments. We may consider reintroducing this check, but that's
  outside of the scope of this commit. The default excludes of
  golangci-lint essentially ignore doc comments completely.)

- By stop using the default excludes, we now get warnings back on
  malformed doc comments. That's the most impactful change in this
  commit. It does not enforce doc comments (again), but _if_ there is
  a doc comment, it has to have the recommended form. (Most of the
  changes in this commit are fixing this form.)

- Improve wording/spelling of some comments in .golangci.yml, and
  remove an outdated comment.

- Leave `package-comments` inactive, but add a TODO asking if we
  should change that.

- Add a new sub-linter `comment-spacings` (and fix corresponding
  comments), which avoids missing spaces after the leading `//`.

Signed-off-by: beorn7 <beorn@grafana.com>
2024-08-22 17:36:11 +02:00
Bryan Boreham 95b3c49836
[TESTS] remote-write: fix slice init length (#14702)
fix: fix slice init length
2024-08-22 12:53:45 +01:00
Björn Rabenstein 0a00d21cff
Merge pull request #14673 from machine424/docdoccc
docs(configuration.md): clarify the explanations about some temp labe…
2024-08-22 12:31:46 +02:00
Arve Knudsen a36d1a8a92
Merge pull request #14707 from aknuds1/arve/upgradegolangci-lint
Upgrade golangci-lint to v1.60.2
2024-08-22 10:58:42 +02:00
Arve Knudsen fbcd50f32c Upgrade golangci-lint to v1.60.2
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-08-21 18:57:17 +02:00
Arve Knudsen 7cfe0b1567
Merge pull request #14706 from aknuds1/arve/otlp-invalid-histograms
OTLP receiver: Warn when encountering invalid exponential histograms
2024-08-21 18:07:45 +02:00
Julius Volz 4efd47741e Correctly encode/decode new resolution states in URL
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2024-08-21 18:06:38 +02:00
Arve Knudsen b50c5d42fe OTLP receiver: Warn when encountering invalid exponential histograms
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-08-21 16:43:16 +02:00
Bryan Boreham 9a74d53935
[BUGFIX] TSDB: Fix query overlapping in-order and ooo head (#14693)
* tsdb: Unit test query overlapping in order and ooo head

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>

* TSDB: Merge overlapping head chunk

The basic idea is that getOOOSeriesChunks can populate Meta.Chunk, but since
it only returns one Meta per overlapping time-slot, that pointer may end up in a
Meta with a head-chunk ID. So we need HeadAndOOOChunkReader.ChunkOrIterable()
to call mergedChunks in that case.

Previously, mergedChunks was checking that meta.Ref was a valid OOO chunk reference,
but it never actually uses that reference; it just finds all chunks overlapping in time.
So we can delete that code.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2024-08-21 14:24:20 +01:00
Björn Rabenstein b860327989
Merge pull request #14703 from jan--f/3.0-main-sync-24-08-21
3.0 main sync 24-08-21
2024-08-21 13:54:22 +02:00
Jan Fajerski 7c8c748399 promql tests: adjust range query intervals
Some test queries need their interval adjusted to account for
https://github.com/prometheus/prometheus/pull/13904. Otherwise the
queries don't return enough samples.
promql/engine_test.go:TestHistogramCopyFromIteratorRegression needed the
same, but also the result needed a fix since `increase` interpolates
over the full range.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
2024-08-21 12:33:52 +02:00
Björn Rabenstein 7fad1ec8ee
Merge pull request #14655 from suntala/suntala/sort-by-label-enhancement
promql: Fall back to full label sets when sorting by label
2024-08-21 12:28:55 +02:00
cuishuang 2110661121 fix: fix slice init length
Signed-off-by: cuishuang <imcusg@gmail.com>
2024-08-21 18:15:25 +08:00
Jan Fajerski 5138922b0d Merge branch 'main' into 3.0-main-sync-24-08-21 2024-08-21 09:09:36 +02:00
shandongzhejiang b2712ff284 chore: fix some function names
Signed-off-by: shandongzhejiang <shandongzhejiang@icloud.com>
2024-08-21 11:09:37 +08:00
Ziqi Zhao 8f828d45c1 convert TestNativeHistogram_Sum_Count_Add_AvgOperator into testing framework
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
2024-08-21 09:24:50 +08:00
suntala 8e82ac8d2b Add comments to the sort by label functions
Signed-off-by: suntala <arati.rana@grafana.com>
2024-08-20 20:41:55 +02:00
Ben Kochie 1435c8ae4a
Include test CA text info (#14699)
Use `openssl x509 -text -in <file>` to include the text version of the
certificate in order to make it easier to see the diff when applying
changes to the cert.

Signed-off-by: SuperQ <superq@gmail.com>
2024-08-20 19:41:02 +02:00
Björn Rabenstein 60366a8a05
Merge pull request #14526 from pawarpranav83/release-3.0
remove deprecated and replaced remote-write-receiver flag from enable-feature
2024-08-20 19:30:46 +02:00
Julien f9f39a4411
Extend testing CA certificates (#14696)
Signed-off-by: Julien <roidelapluie@o11y.eu>
2024-08-20 17:09:07 +02:00
machine424 88cac6fb49
docs(configuration.md): clarify the explanations about some temp labels and format for better visibility.
Signed-off-by: machine424 <ayoubmrini424@gmail.com>
2024-08-20 15:44:39 +02:00
Julien 481d718539
Merge pull request #14661 from prymitive/TestHangingNotifier
tests: increase TestHangingNotifier timeout
2024-08-20 14:37:16 +02:00
Julien cf41a431c4
Merge pull request #14666 from jan--f/v3-publish
add v3 tags to action conditions
2024-08-20 14:12:54 +02:00
Julien Pivotto 9b5e7623f4 Add support for multiple listening addresses
Fixes #9105

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
Signed-off-by: Julien <roidelapluie@o11y.eu>
2024-08-20 13:09:16 +02:00
Julien 82c4599ebe
Merge pull request #14690 from harshitasao/fix-vulnerability
fix: fixed the vulnerability
2024-08-20 13:06:51 +02:00
Bryan Boreham 414d529568
Merge pull request #14625 from prometheus/backport-pr14605-to-2.54
Fix histogram pool poisoning bug chunkenc.Iterator
2024-08-19 16:14:07 +01:00
Bryan Boreham 2eb24bf8ae
Merge pull request #14654 from DrAuYueng/docker-network-mode-match
[BUGFIX] Docker SD: fix the issue of failing to match the first network when the container is reconnected to a new network
2024-08-19 16:11:48 +01:00
ouyang1204@gmail.com 89dee48cc8 fix the issue of failing to match the first network when the container is reconnected to a new network
Signed-off-by: ouyang1204@gmail.com <ouyang1204@gmail.com>
2024-08-19 21:26:25 +08:00
Arve Knudsen b914a9b580
Merge pull request #14691 from aknuds1/arve/upgrade-golangci-lint
Upgrade golangci-lint to v1.60.1
2024-08-19 13:51:29 +02:00
Bryan Boreham 144470c7b0
[BUGFIX] Scraping: allow multiple samples on same series (#14685)
So long as they specify timestamps. We don't check that the timestamps
are different.

Extend test, and use client_golang/prometheus/testutil to simplify metric check.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2024-08-19 10:58:35 +01:00
Arve Knudsen 250aa5031d Remove empty line
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-08-19 10:50:27 +02:00
Arve Knudsen ee47150646
Update web/web.go
Co-authored-by: Julien <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-08-19 10:43:17 +02:00
Arve Knudsen 4023c2405a
Update web/web.go
Co-authored-by: Julien <291750+roidelapluie@users.noreply.github.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-08-19 10:43:05 +02:00
Arve Knudsen 3a78e76282 Upgrade golangci-lint to v1.60.1
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-08-18 12:13:25 +02:00
harshitasao 3b0a386c62 fix: fixed the vulnerability
Signed-off-by: harshitasao <harshitasao@gmail.com>
2024-08-18 13:15:28 +05:30
Ganesh Vernekar e86e4ed87f
Merge pull request #14490 from ywwg/owilliams/utf8-02-upstream
feat(utf8): utf-8 content negotiation and flags
2024-08-16 17:23:42 -04:00
Owen Williams 9e7308de38 feat(utf8): utf8 content negotation and flags
Signed-off-by: Owen Williams <owen.williams@grafana.com>
2024-08-16 16:41:27 -04:00
Julius Volz 2c972dba26 Implement stacked graphs (dirty) and improve React wrapping
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2024-08-16 20:41:18 +02:00
Julien 20a5f742e8
Merge pull request #14643 from roidelapluie/removestorage.tsdb.retention
Remove deprecated storage.tsdb.retention flag
2024-08-16 16:13:37 +02:00
Jan Fajerski 0f79e5e289 add scripts/get_module_version.sh
This script consumes a Prometheus version (or version tag) and prints
the appropriate module version.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
2024-08-16 14:23:27 +02:00
Julien Pivotto 7711cd5ab5 Remove deprecated storage.tsdb.retention flag
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
Signed-off-by: Julien <roidelapluie@o11y.eu>
2024-08-16 13:53:09 +02:00
Bryan Boreham 87dccb1d1b
Merge pull request #14649 from machine424/ftest
fix(tsdb/db_test.go): close the corrupted chunk after creating it to satisfy Windows FS
2024-08-16 11:57:54 +01:00
Arve Knudsen 66388f706a
Merge pull request #14042 from aknuds1/arve/wlog-histograms
tsdb/wlog: Only treat unknown record types as failure
2024-08-16 12:00:49 +02:00
Julien 8a5193d0e2
Merge pull request #14640 from roidelapluie/unusedflags
Remove unused flags
2024-08-16 11:00:49 +02:00
Charles Korn 6548421f61
promqltest: improve error messages when unexpected type is returned, and fix inverted expected and actual values in error message when scalar value does not match expected
Signed-off-by: Charles Korn <charles.korn@grafana.com>
2024-08-16 13:37:05 +10:00
Björn Rabenstein 1daf7cdd62
Merge pull request #14626 from cuiweiyuan/main
chore: fix some function names
2024-08-15 11:46:21 +02:00
cuiweiyuan 1800af54f0 chore: fix some function names
Signed-off-by: cuiweiyuan <cuiweiyuan@aliyun.com>
2024-08-15 13:57:21 +08:00
Arve Knudsen b5d13a1ab5 Merge remote-tracking branch 'prometheus/main' into arve/wlog-histograms
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-08-14 19:04:53 +01:00
Bryan Boreham 26977b5c1e
Merge pull request #14624 from prometheus/backport-pr14538-to-2.54
Use CopyTo when resetting histogram in stats iterator
2024-08-14 15:19:46 +01:00