Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embedded cache: update metric namespace and remove duplicate metrics #10693

Merged
merged 5 commits into from Sep 29, 2023

Conversation

ashwanthgoli
Copy link
Contributor

@ashwanthgoli ashwanthgoli commented Sep 25, 2023

What this PR does / why we need it:

Removes the following embedded cache metrics since loki_cache_request_duration_seconds (which instruments requests made to all the caches) already covers them:

  • querier_cache_added_total
  • querier_cache_gets_total
  • querier_cache_misses_total

Updates the namespace and subsystem for the following metrics

  • querier_cache_added_new_total is renamed to loki_embeddedcache_added_new_total
  • querier_cache_evicted_total is renamed to loki_embeddedcache_evicted_total
  • querier_cache_entries is renamed to loki_embeddedcache_entries
  • querier_cache_memory_bytes is renamed to loki_embeddedcache_memory_bytes

Removes already deprecated metric querier_cache_stale_gets_total

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • 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

@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Sep 25, 2023
@pull-request-size pull-request-size bot added size/L and removed size/M labels Sep 28, 2023
@ashwanthgoli ashwanthgoli marked this pull request as ready for review September 28, 2023 12:32
@ashwanthgoli ashwanthgoli requested a review from a team as a code owner September 28, 2023 12:32
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@JStickler JStickler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[docs team] LGTM. Just one suggestion (but only if it makes sense given the change).

Comment on lines +74 to +77
- The following embedded cache metrics are removed. Instead use `loki_cache_fetched_keys`, `loki_cache_hits`, `loki_cache_request_duration_seconds` which instruments requests made to the configured cache (`embeddedcache`, `memcached` or `redis`).
- `querier_cache_added_total`
- `querier_cache_gets_total`
- `querier_cache_misses_total`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are a one-to-one replacement, to avoid confusion I'd list them next to the parameter they're replacing. (If they aren't a one-to-one replacement, then ignore this suggestion!)

Suggested change
- The following embedded cache metrics are removed. Instead use `loki_cache_fetched_keys`, `loki_cache_hits`, `loki_cache_request_duration_seconds` which instruments requests made to the configured cache (`embeddedcache`, `memcached` or `redis`).
- `querier_cache_added_total`
- `querier_cache_gets_total`
- `querier_cache_misses_total`
- The following embedded cache metrics are removed. Instead use the new metrics, which instrument requests made to the configured cache (`embeddedcache`, `memcached` or `redis`).
- `querier_cache_added_total` instead use `loki_cache_fetched_keys`
- `querier_cache_gets_total` instead use `loki_cache_hits`
- `querier_cache_misses_total` instead use `loki_cache_request_duration_seconds`

@ashwanthgoli ashwanthgoli merged commit fcdd55b into main Sep 29, 2023
7 checks passed
@ashwanthgoli ashwanthgoli deleted the ashwanth/rename-embeddedcache-metrics branch September 29, 2023 05:23
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
…rafana#10693)

**What this PR does / why we need it**:

Removes the following embedded cache metrics since
`loki_cache_request_duration_seconds` (which instruments requests made
to all the caches) [already covers
them](https://github.com/grafana/loki/blob/6a07988491124c91d4acb1cbbf2ee2a4d7dc8900/pkg/storage/chunk/cache/cache.go#L110):
- `querier_cache_added_total`
- `querier_cache_gets_total`
- `querier_cache_misses_total`

Updates the namespace and subsystem for the following metrics
- `querier_cache_added_new_total` is renamed to
`loki_embeddedcache_added_new_total`
- `querier_cache_evicted_total` is renamed to
`loki_embeddedcache_evicted_total`
- `querier_cache_entries` is renamed to `loki_embeddedcache_entries`
- `querier_cache_memory_bytes` is renamed to
`loki_embeddedcache_memory_bytes`

Removes already deprecated metric `querier_cache_stale_gets_total`


**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**)
- [x] Documentation added
- [x] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [x] 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](grafana@d10549e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants