Commit Graph

16002 Commits

Author SHA1 Message Date
György Krajcsovits 7268ac6d78
Do not use custom labels implementation
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-11 09:16:12 +02:00
György Krajcsovits eb3f40260b
Merge branch 'main' into otlp-to-appender 2025-08-08 13:45:51 +02:00
George Krajcsovits 929bd787ec
fix(ci): run linter with all build tags (#17027)
Fix up lint errors that were not previously checked.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-08 09:43:41 +00:00
Joe Adams 1e4144a496
Merge pull request #16950 from sysadmind/aws-sdk-go-v2
chore(deps): Upgrade AWS SDK to v2
2025-08-07 22:34:55 -04:00
Joe Adams 60cf922f89
Fix merge formatting
Signed-off-by: Joe Adams <github@joeadams.io>
2025-08-07 21:17:21 -04:00
György Krajcsovits 8da268d5a9
do not benchmark setup bits
Baseline does not have metrics or logger.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-07 22:53:51 +02:00
György Krajcsovits bd2f7f2d57
remove unused fields and allocations
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-07 22:33:34 +02:00
György Krajcsovits 3cea333835
Merge branch 'main' into otlp-to-appender
# Conflicts:
#	storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw_test.go
2025-08-07 21:54:09 +02:00
George Krajcsovits 8f6a71e188
fix(otlp): benchmark assert makes no sense (#17023)
convert.Timeseries() and converter.Metadata() is never nil, because
they are always initialized. It's better to assert on whether they are
empty or not.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-07 17:04:21 +00:00
Arve Knudsen ae85827e3a
storage/remote.writeHandler.ServeHTTP: Return upon receiving bad message type (#16997)
Modify storage/remote.writeHandler.ServeHTTP to return after responding
with an error due to receiving an unrecognized protobuf message type.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-08-07 19:01:03 +02:00
György Krajcsovits 1f7d957969
BenchmarkPrometheusConverter_FromMetrics: have the same testcases as base
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-07 18:30:38 +02:00
György Krajcsovits c5b6c6df39
more realistic benchmark, include real combinedAppender
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-07 16:43:43 +02:00
György Krajcsovits 84e9295a8f
Merge remote-tracking branch 'origin/main' into otlp-to-appender
# Conflicts:
#	storage/remote/otlptranslator/prometheusremotewrite/helper.go
#	storage/remote/otlptranslator/prometheusremotewrite/helper_test.go
#	storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw.go
#	storage/remote/otlptranslator/prometheusremotewrite/number_data_points.go
#	storage/remote/otlptranslator/prometheusremotewrite/number_data_points_test.go
2025-08-07 15:43:55 +02:00
György Krajcsovits ec5cbf63b9
do not ignore CT or metadata changes
Also add many new unit tests.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-07 13:42:48 +02:00
Arthur Silva Sens 208187eaa1
Remove unused feature from prw translator (#17014)
* Remove unused feature from prw translator

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2025-08-06 14:05:47 -03:00
Joe Adams 8350c23e76
Merge branch 'main' into aws-sdk-go-v2
Signed-off-by: Joe Adams <github@joeadams.io>
2025-08-06 10:53:49 -04:00
György Krajcsovits b331e9b7a2
fix typo
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 16:21:29 +02:00
György Krajcsovits 2e6f4453f2
revert style change
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 16:19:29 +02:00
György Krajcsovits e9e3467c20
fix timeSeriesIsNew
Docstring was wrong and the logic as well.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 13:57:29 +02:00
György Krajcsovits 4742e01181
follow up merge from main
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 13:45:23 +02:00
Bryan Boreham 7512d13e00
Merge pull request #17002 from bboreham/reduce-promql-benchmark
[TESTS] PromQL: shrink work done in BenchmarkRangeQuery
2025-08-06 12:07:49 +01:00
Bryan Boreham ba2a8aba8c
Merge pull request #17000 from bboreham/clarify-intersect
[REFACTOR] TSDB: Clarify intersectPostings
2025-08-06 12:07:10 +01:00
György Krajcsovits 5f8329df67
Merge remote-tracking branch 'origin/main' into otlp-to-appender 2025-08-06 12:21:04 +02:00
György Krajcsovits 86a2f4bcb4
remove extra Commit interface and make tests more realistic
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 12:05:53 +02:00
Bartlomiej Plotka 5df982538f
Merge pull request #16994 from mmorel-35/unused-parameters
chore: enable unused-receiver rule from revive
2025-08-06 10:46:28 +01:00
Bartlomiej Plotka 3fc87f40e8
Merge pull request #16998 from mmorel-35/govet/enable-all
chore: enable-all rule from govet
2025-08-06 10:44:44 +01:00
Bartlomiej Plotka b2ccc8d4b7
Merge pull request #16999 from mmorel-35/context
chore: enable fatcontext linter
2025-08-06 10:43:42 +01:00
Bartlomiej Plotka 291e2ae090
Merge pull request #17006 from sujalshah-bit/fix_wal_dir_bug
wal: ignore os.ErrNotExist errors in DirSize during WAL size calculation
2025-08-06 10:40:02 +01:00
György Krajcsovits bc978deb4f
fix metadata handling and tests
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 11:11:23 +02:00
György Krajcsovits 2de7ec60d7
linter fix, remove unused field
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 10:59:44 +02:00
György Krajcsovits 85079f4b5f
simplify otel_scope_ conversion
Return to direct variable init.
No need to check if outer error is nil as the iteration stops on
returning false by contract.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 10:47:45 +02:00
György Krajcsovits aff16e2d09
use Warn level for metadata and CT problems
Also indicate sample type in the message where relevant.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 10:42:26 +02:00
György Krajcsovits 10a4d15b65
refactor metrics for combinedAppender
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 10:35:35 +02:00
György Krajcsovits e44f51ca59
fix double registering metrics
This is just a quick fix, I'm refactoring to be better.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 10:23:46 +02:00
György Krajcsovits 7ac683236e
refactor for DRY
AppendSample and AppendHistogram had a lot in common

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 09:55:36 +02:00
György Krajcsovits db3470d013
Fix docstring mistakes
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 09:10:16 +02:00
György Krajcsovits 73afc92cb6
dry: reuse NewFromSorted function
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-06 09:01:11 +02:00
György Krajcsovits 8c46c60771
Merge branch 'main' into otlp-to-appender 2025-08-06 08:49:29 +02:00
Ganesh Vernekar 64808d4f56
Merge pull request #16968 from pipiland2612/Remove_label_index
tsdb: Remove writing Label Index and Label Offset Table in the index
2025-08-05 15:12:44 -07:00
Sujal Shah 17c58f5fce wal: ignore os.ErrNotExist errors in DirSize during WAL size calculation
This change updates `DirSize` to ignore `os.ErrNotExist` errors,
since they are expected during normal WAL cleanup. All other errors
continue to propagate.

Fixes: #17005
Signed-off-by: Sujal Shah <sujalshah28092004@gmail.com>
2025-08-05 22:41:46 +05:30
György Krajcsovits 358410fbf6
fix interworking with real TSDB
Appending metadata and exemplars need non zero series reference to work.

Add test with some simple test cases for appending samples and
histograms and exemplars.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-05 18:56:06 +02:00
Bryan Boreham 31eb3b286d [TESTS] PromQL: shrink work done in BenchmarkRangeQuery
Previously, BenchmarkRangeQuery would run each case with three data sizes
(1, 10, 100) and three range lengths (1, 100, 1000) for nine variations.

With 36 cases, running with `-count=6` to get dependable results, would
take 40-50 minutes in total.

This PR removes the middle option in both dimensions, thus shrinking to
four variations and about 20 minutes to run everything.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-08-05 14:21:23 +01:00
György Krajcsovits 7a82d77c4c
Add docstring to labels_common.go Contains function
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-05 15:18:58 +02:00
György Krajcsovits a821f0df45
fix linter, check error
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-05 15:15:55 +02:00
György Krajcsovits 96199f90a2
remove stray TODO
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-05 14:58:43 +02:00
György Krajcsovits 84f97d9d14
Merge branch 'main' into otlp-to-appender
# Conflicts:
#	storage/remote/otlptranslator/prometheusremotewrite/helper.go
#	storage/remote/otlptranslator/prometheusremotewrite/helper_test.go
#	storage/remote/otlptranslator/prometheusremotewrite/histograms.go
#	storage/remote/otlptranslator/prometheusremotewrite/histograms_test.go
#	storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw.go
#	storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw_test.go
#	storage/remote/otlptranslator/prometheusremotewrite/number_data_points.go
2025-08-05 14:57:00 +02:00
Bryan Boreham e068c7332d [REFACTOR] TSDB: Clarify intersectPostings
This is intended to make `intersectPostings` easier to follow.

Instead of cryptic `arr` and `cur`, name the members `postings` and
`current`.

Instead of updating `cur` to intermediate values encountered during
operations, introduce a local variable `target` meaning the ref we might
expect to find next, and only update `current` when an intersection is
found.

Name the function which implements seeking `Seek` instead of `doNext`.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-08-05 13:09:29 +01:00
Alan Protasio 25aee26a57
Improving "Sparse postings" intersection (#13971)
Lets take the given example:

P1: [2, 5, 9, 18, 21]
P2: [3, 7, 14, 19, 21]
P3: [1, 21]

Currently, we would only advance through P1 and P2 until discovering
an intersection and then checking P3. In essence, the traversal order
was: 2, 3, 5, 7, 9, 14, 18, 19, 21 (intersection found).

With the proposed change, P3 is also examined even if P1 and P2
haven't found an intersection yet. This adjustment allows for the
possibility of skipping some iterations.

Post-change, the traversal order becomes: 2, 3, 21 (3 iterations instead of 9).

Signed-off-by: alanprot <alanprot@gmail.com>
2025-08-05 12:22:54 +01:00
George Krajcsovits 457a2381f9
fix(parser): revert pr 16041 and 16754 (#16996)
* fix(parser): revert pr 16041 and 16754

Fix for https://github.com/prometheus/prometheus/issues/16053
turned out to be too complicated and lead to more errors than it solved.
See https://github.com/prometheus/prometheus/pull/16875.

* add TODOs to wrong end positions
* restore test and fix initialization bug

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-08-05 10:48:08 +02:00
Owen Williams 74610b7c89
config: address edge case where local config specifies validation mode only (#16923)
This check ensures that local ScrapeConfigs that only specify Legacy validation do not inherit the default global AllowUTF8 escaping setting, which is an invalid combination of settings.

---------

Signed-off-by: Owen Williams <owen.williams@grafana.com>
2025-08-04 13:53:50 -04:00