Skip to content

Remove metrics with empty data#3638

Merged
ndyakov merged 2 commits into
redis:masterfrom
fengve:master
Dec 3, 2025
Merged

Remove metrics with empty data#3638
ndyakov merged 2 commits into
redis:masterfrom
fengve:master

Conversation

@fengve

@fengve fengve commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Because empty data cannot be considered an error.

Because empty data cannot be considered an error.
@jit-ci

jit-ci Bot commented Dec 3, 2025

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@ndyakov

ndyakov commented Dec 3, 2025

Copy link
Copy Markdown
Member

@fengve thank you for contributing, do you think it makes sense to have this as a separate status - nil?

@fengve

fengve commented Dec 3, 2025

Copy link
Copy Markdown
Contributor Author

@ndyakov

Generally, we consider an empty value to be a correct state because it is not an error in the Redis protocol.

When we use Redis for caching(pseudocode):

data, err := redis.Get(key)
if err != nil && err != redis.ErrNil {
	return nil, err
}

data = getData()

redis.Set(key,data)

@ndyakov

ndyakov commented Dec 3, 2025

Copy link
Copy Markdown
Member

@fengve i agree with you that redis.Nil should not be considered an error response here, but what i would like to discuss is - if it should be attribute.String("status", "nil") instead of attribute.String("status", "ok"), since even in your case it shows cache miss and not a cache hit.

Better differentiation between values, null values, and errors.
@fengve

fengve commented Dec 3, 2025

Copy link
Copy Markdown
Contributor Author

@ndyakov

You're right, this makes it easier to distinguish states. I've added the nil state.

@ndyakov ndyakov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i do think this looks better, thank you

@ndyakov ndyakov merged commit e2153f5 into redis:master Dec 3, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants