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

Implement stats redis command #44

Merged
merged 1 commit into from
Sep 7, 2017
Merged

Implement stats redis command #44

merged 1 commit into from
Sep 7, 2017

Conversation

agis
Copy link
Contributor

@agis agis commented Sep 6, 2017

This allows users to monitor Rafka for errors that are not propagated to
the clients. Until now such errors were just being logged. It allows for
simple alerting rules (eg. alert when producer errors are more than 10).

We used the HGETALL Redis command, since the stats structure can be
considered a hash with stat names as keys and counters as values.

Part of #28

@agis agis added this to the 1.0 milestone Sep 6, 2017
stats.go Outdated
func (s *Stats) toSlice() []interface{} {
return []interface{}{
"producer.unflushed.messages",
strconv.FormatInt(atomic.LoadInt64(&s.producerUnflushed), 10),
Copy link
Member

Choose a reason for hiding this comment

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

Can we use an integer type as the value? the redisproto should support it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Package atomic has no int alias. We either have to use int32 or int64.

stats.go Outdated
producerErr int64
}

func (s *Stats) toSlice() []interface{} {
Copy link
Member

Choose a reason for hiding this comment

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

toRedis()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

This allows users to monitor Rafka for errors that are not propagated to
the clients. Until now such errors were just being logged. It allows for
simple alerting rules (eg. alert when producer errors are more than 10).

We used the HGETALL Redis command, since the stats structure can be
considered a hash with stat names as keys and counters as values.

Part of #28
@agis agis merged commit 04ac92c into master Sep 7, 2017
@agis agis deleted the prod-stats branch September 12, 2018 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants