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

Honor enabled resource attributes #22105

Closed

Conversation

hughesjj
Copy link
Contributor

Description:
Enables the resource_attribute flag in redis

Link to tracking Issue: Enables 22044

Testing: integration test in goland

@hughesjj hughesjj requested a review from a team May 19, 2023 17:06
@hughesjj hughesjj requested a review from dmitryax as a code owner May 19, 2023 17:06
@github-actions github-actions bot added the receiver/redis Redis related issues label May 19, 2023
Comment on lines +99 to +101
if rs.cfg.MetricsBuilderConfig.ResourceAttributes.RedisVersion.Enabled {
resourceMetricOptions = append(resourceMetricOptions, metadata.WithRedisVersion(rs.getRedisVersion(inf)))
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe this is needed. Its a responsibility of the metrics builder and should be handled by WithRedisVersion. If it's not working for any reason, let's fix the metrics builder

@@ -33,6 +33,8 @@ func TestRedisRunnable(t *testing.T) {
ilm := rm.ScopeMetrics().At(0)
il := ilm.Scope()
assert.Equal(t, "otelcol/redisreceiver", il.Name())
// Only version should be enabled by default at this moment
assert.Equal(t, 1, rm.Resource().Attributes().Len())
Copy link
Contributor

Choose a reason for hiding this comment

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

We can add this assertion to the test as a chore PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants