-
Notifications
You must be signed in to change notification settings - Fork 346
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
User-defined metric cardinality #604
User-defined metric cardinality #604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
type Metrics struct { | ||
metricsLevel int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to define a 2nd enum for internal use instead of ints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might, but that’s definitely a hack around some layout problems. But there probably aren’t any half-measures there, save an awkward new package, so I guess that’s a ticket for another day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One option could be to make the consts be strings instead of integers, and then have internal
do a switch on these. Then at least the hard-coded values would have more meaning than inscrutable integer values. Like
type MetricsCardinality string
const (
MetricsCardinalityNone MetricsCardinality = `none`
MetricsCardinalityTenant MetricsCardinality = `tenant`
MetricsCardinalityNamespace MetricsCardinality = `namespace`
MetricsCardinalityTopic MetricsCardinality = `topic`
)
Signed-off-by: xiaolongran <xiaolongran@tencent.com>
Draft
WIP, no test exercise yet, but passes docker-ci.sh tests. Feedback welcome.
I am a bit dissatisfied with the use of the const/iota enum in the public package and the integers in
internal,
but it's necessary to avoid import cycles. Otherwise the enum needs to be moved out ofpulsar
and placed into another package, or the enum needs to be mirrored ininternal
Fixes #500
Motivation
Allow selective metrics cardinality configuration
Modifications
Allow log cardinality level to be set to none, tenant, namespace or topic.