10 Commits

Author SHA1 Message Date
1e8d8a93d9 feat(query-tee): improvements to skip samples outside comparison window (#15794) 2025-01-22 10:47:09 +05:30
b5462b6639 chore: remove copied loop vars (#14383) 2024-10-04 10:38:36 -06:00
fb6f6d2e2f Stop using global logger in modules (#11051)
**What this PR does / why we need it**:
Refactors Loki to inject logger from the constructors instead of using
global logger variable. It is generally considered a good practice.

**Which issue(s) this PR fixes**:
[Fixes #<issue
number>](https://github.com/grafana/loki-private/issues/810)

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e3ec)
- [ ] If the change is deprecating or removing a configuration option,
update the `deprecated-config.yaml` and `deleted-config.yaml` files
respectively in the `tools/deprecated-config-checker` directory. <!--
TODO(salvacorts): Add example PR -->
2023-11-01 19:25:30 +05:30
364226108a chore: fix flaky querytee proxy test (#10367)
**What this PR does / why we need it**:
`Test_ProxyEndpoint_SummaryMetrics` does not wait for `compareResponses`
call to finish which causes the test to fail as the expected metric
response does not match

this pr updates the test to wait for `responses_compared_total` to be
set to 1 before asserting `missingMetrics`

**Which issue(s) this PR fixes**:
Fixes #<issue number>

**Special notes for your reviewer**:

**Checklist**
- [X] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [x] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e3ec)
2023-08-28 15:33:02 +05:30
5ba154a6de Report missing metrics in querytee. (#10304)
**What this PR does / why we need it**:
Sometimes we want to not just fail a querytee but also report results on
the comparison between expected and actual results. That's why querytee
is extended with special metrics to give more insights into the
differences.

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [x] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e3ec)
2023-08-24 12:59:47 +02:00
e2842c69c5 Replace deprecated io/ioutil with io and os packages (#7212)
The `io/ioutil` package has been deprecated in Go 1.16 (See
https://pkg.go.dev/io/ioutil). This PR replaces the existing `io/ioutil`
functions with their new definitions in `io` and `os` packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-09-23 15:26:15 +01:00
ba5d218e3e detects issuer via useragent in querytee reqs (#6914)
Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
2022-08-15 12:14:58 -04:00
2e95a64cb4 query-tee: support for multi backend response comparison and disabling query proxy for select backends (#6736)
* add support for comparing responses with multiple secondary backends

* allow disabling read proxy for select secondary backends

* Update tools/querytee/proxy.go

Co-authored-by: Salva Corts <salva.corts@grafana.com>

Co-authored-by: Salva Corts <salva.corts@grafana.com>
2022-07-28 14:29:42 +02:00
a2dd731586 Chore: Add pkg/util/log package (#5187)
* Chore: Add pkg/util/log package

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

* Add changelog entry

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

* Fix documentation of loki_log_messages_total

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2022-01-20 12:53:16 -05:00
66bf9f6474 Copy cortex/tools/querytee package dependency into Loki (#5165)
* Fork Cortex `tools/querytee`.

* Use forked querytee instead of Cortex one.

* Add `loki/tools` to list of possible paths.

* Add opts to querytee proxy.
2022-01-19 14:56:48 +05:30