-
Notifications
You must be signed in to change notification settings - Fork 9
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
Remove service instances, add labels to service #83
Conversation
After much discussion, we decided that we will keep global labels as they are for now, and eventually remove them when we have a replacement. The replacement is expected to be something along the lines of more explicit, user-configurable dimensions. Between now and then we may add more fields to the service aggregation key for common use cases, e.g. service namespace. The service instances concept does not align with that future, so we're reverting to aggregating by global labels at the service level. The implication is that global labels are expected to have low cardinality, and if they do not then users can expect a service with high cardinality global labels to interfere with the collection of metrics for other services (i.e. causing them to overflow.)
3ba56c1
to
50d683c
Compare
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.
LGTM! Just a minor comment, maybe something to investigate
@@ -122,6 +122,7 @@ func (k *serviceAggregationKey) ToProto() *aggregationpb.ServiceAggregationKey { | |||
pb.ServiceEnvironment = k.ServiceEnvironment | |||
pb.ServiceLanguageName = k.ServiceLanguageName | |||
pb.AgentName = k.AgentName | |||
pb.GlobalLabelsStr = []byte(k.GlobalLabelsStr) |
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.
I wonder if this and the below k.GlobalLabelsStr = string(pb.GlobalLabelsStr)
is continuously creating copies and we should store everything as strings or find an alternative.
Either way, this is not changing the previous behaviour so approving!
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 has to be a []byte
because the contents may not be valid UTF-8, which is required for protobuf strings.
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.
String must always contain UTF-8 as per proto requirements. Since we encode the global labels as proto I don't think it will hold true.
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.
Oops, missed axw's message 😅
After much discussion, we decided that we will keep global labels as they are for now, and eventually remove them when we have a replacement. The replacement is expected to be something along the lines of more explicit, user-configurable dimensions. Between now and then we may add more fields to the service aggregation key for common use cases, e.g. service namespace.
The service instances concept does not align with that future, so we're reverting to aggregating by global labels at the service level. The implication is that global labels are expected to have low cardinality, and if they do not then users can expect a service with high cardinality global labels to interfere with the collection of metrics for other services (i.e. causing them to overflow.)