Commit Graph

1581 Commits

Author SHA1 Message Date
zenador
40a27ce875
Make translatorMetricFromOtelMetric public (#16683)
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2025-06-03 12:39:21 +02:00
Arthur Silva Sens
24057883a1
Update otlptranslator with new API (#16626)
* Update otlptranslator with new API

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

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2025-05-29 09:24:02 -03:00
Antonio Jimenez
2834a665ed
Add support for promoting all OTel resource attributes (#16426)
Add support for promoting all OTel resource attributes via `promote_all_resource_attributes`,
except for those ignored using 'ignore_resource_attributes'.

---------

Signed-off-by: Antonio Jimenez <antonjim@thousandEyes.com>
Signed-off-by: Antonio Jimenez <123171955+antonjim-te@users.noreply.github.com>
2025-05-26 18:15:01 +02:00
bragi92
14fc57e4cf
remote_write azure auth : allow empty client_id to suppport system assigned managed identity (#16421)
* squash (#1)

* remote-write: allow empty azure client_id to support system assigned managed identity

* add blank line for tests

* remote-write: allow empty azure client_id to support system assigned managed identity

Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>

* add blank line for tests

Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>

---------

Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>

* treat empty client_id as system-assigned identity; this is a valid case

Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>

* rename file 

Signed-off-by: bragi92 <kadubey@microsoft.com>

---------

Signed-off-by: Kaveesh Dubey <kadubey@microsoft.com>
Signed-off-by: bragi92 <kadubey@microsoft.com>
2025-05-24 15:01:49 +02:00
Arthur Silva Sens
5a98246f50
Fix flakiness in TestOTLPWriteHandler (#16608) 2025-05-17 05:35:26 -03:00
Arve Knudsen
e7e3ab2824
Fix linting issues found by golangci-lint v2.0.2 (#16368)
* Fix linting issues found by golangci-lint v2.0.2

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-05-03 19:05:13 +02:00
zenador
d73b0f34e3
Strip newline in error when reading from remote client (#16487)
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2025-04-27 13:59:33 +00:00
SungJin1212
b594733a07
Fix PRW2 data diff error message typo (#16481)
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
2025-04-25 09:27:22 +02:00
Fiona Liao
7ec63b1fa1
Add primitive support for ingesting OTLP delta metrics as-is (#16360)
* Add simple delta support

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Rename delta2cumulative part

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Whoops bad refactor

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add example yml

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Feature flag instead and histogram hint handling

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Delete otel_delta.yml - outdated

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Renaming to native delta support

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add more explanatory comments

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add more explanation to histograms

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Correct comment on d2c consumer

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add tests for counters and fix bug

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add histogram tests

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add docs

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Sort series to make test deterministic

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* More formatting

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Change flag name to ingestion

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Explain where rate calculation can go wrong

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add warning about duplicate timestamps

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Update docs/feature_flags.md

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Fix tests

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Remove unnecessary if

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Add warning to d2c section

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Make unknown type error when getting temporality

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Correct type comment - not planning to add delta metric metadata type

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Remove unused param for empty type

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Rewrite temporality logic to be clearer

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Change spurious to unnecessary - better description

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

---------

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
2025-04-23 09:58:02 -03:00
Arthur Silva Sens
d9c0ad1e61
feat: Support 'NoTranslation' mode in OTLP endpoint (#16441)
* feat: Support 'NoTranslation' mode in OTLP endpoint

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

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2025-04-22 13:13:30 -03:00
Jeanette Tan
b91c66cdf9 Move newline to inside the expected error
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2025-04-16 17:58:19 +08:00
Jeanette Tan
ab2d17d7a0 Move unit test to existing suite
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2025-04-16 03:57:42 +08:00
Jeanette Tan
f1b6694837 Add unit test
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2025-04-16 03:57:42 +08:00
Jeanette Tan
88bf1b1a68 Allow unwrapping of errors when reading from remote client
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2025-04-16 03:57:42 +08:00
György Krajcsovits
1cdc956d27 test(rw2): add nhcb testcases to remote write 2.0
Ref: https://github.com/prometheus/prometheus/issues/15021

Also modified spansToSpansProto to not allocate empty bucket spans array
when converting internal model to remote write model.
Otherwise the test TestDecodeWriteV2Request fails since empty array
is marshaled/unmarshaled as nil so we don't get back the exact same
thing.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-04-08 15:45:56 +02:00
Oleg Zaytsev
c5b92f71d4
fix: storage/remote.pool interned refs count and flaky test (#16335)
* Fix storage/remote.pool interned refs count and flaky test

I saw TestIntern_MultiRef_Concurrent failing on a different PR saying 'expected refs to be 1 but it was 2'.

I took a look, and it definitely can be racy, especially with a time.Sleep() of just 1ms.

I'm fixing that by explicitly waiting until it has been released, and by repeating that 1000 times, otherwise it's just a recipe for a future flaky test.

OTOH, I also took a look at the implementation and saw that we were not holding the RLock() when increasing the references count, so when releasing there was a race condition for the cleanup, I fixed that by holding RLock() while increasing the references count.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>

* s/Equalf/Equal/

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>

---------

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2025-03-27 21:04:30 +01:00
Jeanette Tan
3c865c6649 Allow NewReadClient to take in more config options
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2025-03-26 00:09:15 +08:00
Matthieu MOREL
5fa1146e21
chore: enable gci linter (#16245)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-03-22 15:46:13 +00:00
Arve Knudsen
f5f22e7201
Remove golangci-lint exclusions for OTLP code (#16250)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-03-20 18:43:22 +01:00
Carrie Edwards
c90b387d89
Optionally translate OTel histograms to NHCB (#15850)
* Optionally translate OTEL histograms to NHCB

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Add tests for explicit histogram to NHCB translation

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Linting

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Add test for translation with flag

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Refactor to re-use bucket conversion function

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Update prompb

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Add comment explaining explicit bounds and use defined CustomBucketSchema

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Add TODO for limiting max bucket count

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Fix imports and remove extra blank line

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Update configuration docs and CHANGELOG

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Update CHANGELOG

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

* Use otlptranslator package

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>

---------

Signed-off-by: Carrie Edwards <edwrdscarrie@gmail.com>
2025-03-20 09:18:51 -07:00
Arthur Silva Sens
b39672736a
Migrate otlptranslator package to prometheus/otlptranslator (#16240)
* Migrate otlptranslator package to prometheus/otlp-prometheus-translator

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2025-03-20 16:13:26 +01:00
Patryk Prus
ebeeb1c823
Fix flaky TestReadClient/timeout test
Signed-off-by: Patryk Prus <p@trykpr.us>
2025-03-18 13:35:40 -04:00
Fiona Liao
37c2ebb5fd
Make out-of-order native histograms flag a no-op and always enable (#16207)
* Remove experimental out-of-order native histogram flag

This feature has been available in Prometheus since September 2024,
and has no known issues. Therefore proposing to remove the flag
entirely and always have it on. Note that there are still two
settings that need to be configured (out-of-order time window > 0
and native histograms enabled) for this feature to work.

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Update CHANGELOG

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Keep feature flag with warning

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Update CHANGELOG

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

* Update tsdb/head_append.go

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Fiona Liao <fiona.y.liao@gmail.com>

* Update CHANGELOG.md

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Fiona Liao <fiona.y.liao@gmail.com>

* Update tsdb/head_append.go

Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
Signed-off-by: Fiona Liao <fiona.y.liao@gmail.com>

* Additional cleanup of comments and test names

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>

---------

Signed-off-by: Fiona Liao <fiona.liao@grafana.com>
Signed-off-by: Fiona Liao <fiona.y.liao@gmail.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2025-03-18 10:59:02 +00:00
zenador
6a439bdffa
remote read: Use more informative error msg for timeouts (#16157)
* Use more informative error msg for timeouts on remote read

Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
2025-03-18 08:42:28 +01:00
Owen Williams
94b43c5d4c utf8: Remove support for legacy global validation setting
Global and Data Source configurations can specify legacy mode, but Prometheus now requires that the overall validation mode be set to UTF-8

Signed-off-by: Owen Williams <owen.williams@grafana.com>
2025-03-13 10:47:24 -04:00
Bartlomiej Plotka
7a7bc65237
Add util/compression package to consolidate snappy/zstd use in Prometheus. (#16156)
# Conflicts:
#	tsdb/db_test.go

Apply suggestions from code review




tmp



Addressed comments.



Update util/compression/buffers.go

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
2025-03-10 10:36:26 +00:00
dependabot[bot]
da0412a519
chore(deps): bump the go-opentelemetry-io group across 1 directory with 14 updates (#16181)
* chore(deps): bump the go-opentelemetry-io group across 1 directory with 14 updates

Bumps the go-opentelemetry-io group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [go.opentelemetry.io/collector/component](https://github.com/open-telemetry/opentelemetry-collector) | `0.118.0` | `1.27.0` |
| [go.opentelemetry.io/collector/consumer](https://github.com/open-telemetry/opentelemetry-collector) | `1.24.0` | `1.27.0` |
| [go.opentelemetry.io/collector/processor](https://github.com/open-telemetry/opentelemetry-collector) | `0.118.0` | `0.121.0` |
| [go.opentelemetry.io/collector/semconv](https://github.com/open-telemetry/opentelemetry-collector) | `0.118.0` | `0.121.0` |
| [go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace](https://github.com/open-telemetry/opentelemetry-go-contrib) | `0.59.0` | `0.60.0` |
| [go.opentelemetry.io/otel/exporters/otlp/otlptrace](https://github.com/open-telemetry/opentelemetry-go) | `1.34.0` | `1.35.0` |
| [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) | `1.34.0` | `1.35.0` |
| [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp](https://github.com/open-telemetry/opentelemetry-go) | `1.34.0` | `1.35.0` |

Updates `go.opentelemetry.io/collector/component` from 0.118.0 to 1.27.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.118.0...pdata/v1.27.0)

Updates `go.opentelemetry.io/collector/consumer` from 1.24.0 to 1.27.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/pdata/v1.24.0...pdata/v1.27.0)

Updates `go.opentelemetry.io/collector/pdata` from 1.24.0 to 1.27.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/pdata/v1.24.0...pdata/v1.27.0)

Updates `go.opentelemetry.io/collector/processor` from 0.118.0 to 0.121.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.118.0...v0.121.0)

Updates `go.opentelemetry.io/collector/semconv` from 0.118.0 to 0.121.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.118.0...v0.121.0)

Updates `go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace` from 0.59.0 to 0.60.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.59.0...zpages/v0.60.0)

Updates `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` from 0.59.0 to 0.60.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.59.0...zpages/v0.60.0)

Updates `go.opentelemetry.io/otel` from 1.34.0 to 1.35.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.34.0...v1.35.0)

Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace` from 1.34.0 to 1.35.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.34.0...v1.35.0)

Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc` from 1.34.0 to 1.35.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.34.0...v1.35.0)

Updates `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp` from 1.34.0 to 1.35.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.34.0...v1.35.0)

Updates `go.opentelemetry.io/otel/metric` from 1.34.0 to 1.35.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.34.0...v1.35.0)

Updates `go.opentelemetry.io/otel/sdk` from 1.34.0 to 1.35.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.34.0...v1.35.0)

Updates `go.opentelemetry.io/otel/trace` from 1.34.0 to 1.35.0
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.34.0...v1.35.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/collector/component
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/collector/consumer
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/collector/pdata
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/collector/processor
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/collector/semconv
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/otel
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/otel/metric
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/otel/sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
- dependency-name: go.opentelemetry.io/otel/trace
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-opentelemetry-io
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix creating of metrics processor

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-03-07 18:05:32 +01:00
co63oc
0e4e5a71bd
Fix typos (#16076)
Signed-off-by: co63oc <co63oc@users.noreply.github.com>
2025-02-28 11:24:25 +11:00
Matthieu MOREL
c7d4b53ec1 chore: enable unused-parameter from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-19 19:50:28 +01:00
Bartlomiej Plotka
de23a9667c
prw2: Split PRW2.0 from metadata-wal-records feature (#16030)
Rationales:

* metadata-wal-records might be deprecated and replaced going forward: https://github.com/prometheus/prometheus/issues/15911
* PRW 2.0 works without metadata just fine (although it sends untyped metrics as expected).

Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-02-13 12:16:33 +00:00
Matthieu MOREL
b472ce7010 chore: enable early-return from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-02-10 22:08:43 +01:00
Matthieu MOREL
dd5ab743ea chore(deps): use version.PrometheusUserAgent
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-01-22 07:31:02 +01:00
Bartlomiej Plotka
a3c7f72ad0
Merge pull request #15541 from machine424/wellwellwell
fix(remote): rename some remote read related metrics for better clarity and consistency
2025-01-16 15:25:45 +01:00
Bartlomiej Plotka
de2dfe00f4
Merge pull request #15832 from prometheus/metadatafix
scrape: Fix metadata in WAL not working for histograms and summaries.
2025-01-16 15:06:40 +01:00
George Krajcsovits
5ed0edd3ab
Update storage/remote/queue_manager.go
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
2025-01-16 08:12:33 +01:00
bwplotka
9385f31147 scrape: Fix metadata in WAL not working for histograms and summaries.
The was a bug (due to confusion?) on the local metadata cache that is cached
by metric family not the series metric name. The fix is to NOT use that local cache
at all (it's still needed for current metadata API implementation, added TODO
on how we can get rid of it).

I went ahead and also rename Metric field in metadata structs to MetricFamily to make
clear it's not always __name__.

Signed-off-by: bwplotka <bwplotka@gmail.com>
2025-01-15 20:12:38 +00:00
György Krajcsovits
482a7fd890 fix(remotewrite2): do not send uninitialized garbage if there's no metadata
Found during testing for
https://github.com/grafana/mimir/issues/9072

Debug printout showed:
KRAJO: seriesName=cortex_request_duration_seconds_bucket,
metricFamily=cortex_request_duration_seconds_bucket,
type=GAUGE,
help=cortex_bucket_index_load_duration_seconds_sum,
unit=

which is nonsense.

I can imagine more cases where this is the case and makes actual sense.
Some targets might miss metadata and if there's a pipeline that loses it.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-01-15 12:42:52 +01:00
Bartlomiej Plotka
c12f963997
Merge pull request #15825 from prometheus/krajo/fix-metadata-enqueueing
fix(remotewrite2): do not overwrite help text with unit in enqueue
2025-01-15 08:24:12 +01:00
György Krajcsovits
594b882e8b fix(remotewrite2): do not overwrite help text with unit in enqueue
While testing POC for https://github.com/grafana/mimir/issues/9072
I saw no unit or help metadata. Our test env:
https://github.com/grafana/mimir/tree/main/development/mimir-monolithic-mode
doesn't have units, so that was empty and cleared the help due to this bug.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-01-14 18:44:00 +01:00
sh0rez
5303e515af
remote/otlp: convert delta to cumulative (#15165)
What

Adds support for OTLP delta temporality to the OTLP endpoint.
This is done by calling the deltatocumulative processor from the OpenTelemetry collector during OTLP conversion.

Why

Delta conversion is a naturally stateful process, which requires careful request routing when operated inside a collector.
Prometheus is already stateful and doing the conversion in-server reduces the operational burden on the ingest architecture by only having one stateful component.

How

deltatocumulative is a OTel collector component that works as follows:

* pmetric.Metrics come from a receiver or in this case from the HTTP client
* It operates as an in-place update loop:
    * for each sample, if not delta, leave unmodified
    * if delta, do:
      * state += sample, where state is the in-memory sum of all previous samples
      * sample = state, sample value is now cumulative
    * this is supported for sums (counters), gauges, histograms (old histograms) and exponential histograms (native histograms)
If a series receives no new samples for 5m, its state is removed from memory


Performance

Delta performance is a stateful operation and the OTel code is not highly optimized yet, e.g. it locks the entire processor for each request. Nonetheless, care has been taken to mitigate those effects:

delta conversion is behind a feature flag. If disabled, no conversion code is ever invoked
if enabled, conversion is not invoked if request not actually contains delta samples. This leads to no measureable performance difference between default-cumulative to convert-cumulative (only cumulative, feature on/off)

Signed-off-by: sh0rez <me@shorez.de>
2025-01-14 11:33:31 -03:00
Arve Knudsen
f030894c2c
Fix issues raised by staticcheck (#15722)
Fix issues raised by staticcheck

We are not enabling staticcheck explicitly, though, because it has too many false positives.

---------

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-01-09 17:51:26 +01:00
Arthur Silva Sens
5fdec31401
otlp/translator: Use separate function for metric names with UTF8 characters (#15664)
BuildCompliantName was renamed to BuildCompliantMetricName, and it no longer takes UTF8 support into consideration. It focuses on building a metric name that follows Prometheus conventions.

A new function, BuildMetricName, was added to optionally add unit and type suffixes to OTLP metric names without translating any characters to underscores(_).
2025-01-06 11:30:39 -03:00
Arve Knudsen
f37b5adfef
OTLP receiver: Optimize by initializing regexps at program start (#15733)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-12-31 11:12:21 +01:00
Bartlomiej Plotka
30967330ca
Merge pull request #14755 from prometheus/arthursens/appendct-prwv2
Append CT as zero sample from PRWv2
2024-12-27 12:44:54 +01:00
Arve Knudsen
475b7ff256 OTLP receiver: Allow colons in non-standard units
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-12-21 18:53:14 +01:00
Arve Knudsen
5e7f804eeb
otlptranslator: Remove unused function TrimPromSuffixes (#15709)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2024-12-21 18:51:40 +01:00
Arthur Silva Sens
b7a5e280df
Inline conditionals and CT handling
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2024-12-20 10:48:46 -03:00
Arthur Silva Sens
3380809b68
fix linter
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2024-12-20 10:48:46 -03:00
Arthur Silva Sens
3ffc3bf6a3
handle histogram CT
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2024-12-20 10:48:46 -03:00
Arthur Silva Sens
6571d97e70
Handle histogram's created timestamp
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
2024-12-20 10:48:46 -03:00