[go: up one dir, main page]

Skip to content

Extend metrics support for Redis cache calls

Proposal

We want to extend metrics support for all Redis cache calls. Metrics were introduced in !96382 (merged), but there are used only for a specific methods.

We can provide labels to existing Rails.cache calls to automatically collect metrics.

# Labels define default settings
Rails.cache.fetch('cache-key', labels: { cache_identifier: 'Class#cache_key', backing_resource: :gitaly }) do
  'do work'
end

Goals

Add an interface that allows to provide feature_category, backing_resource and cache_identifier to each Redis call

Edited by Vasilii Iakliushin