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

Remove service instances, add labels to service #83

Merged
merged 1 commit into from
Aug 14, 2023
Merged

Conversation

axw
Copy link
Member

@axw axw commented Aug 13, 2023

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.)

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.)
@axw axw force-pushed the rm-service-instance branch from 3ba56c1 to 50d683c Compare August 13, 2023 10:43
@axw axw marked this pull request as ready for review August 13, 2023 23:35
@axw axw requested a review from a team as a code owner August 13, 2023 23:35
Copy link
Member

@kruskall kruskall left a 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)
Copy link
Member

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!

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

https://protobuf.dev/programming-guides/proto3/#scalar

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.

Copy link
Contributor

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 😅

@axw axw requested a review from lahsivjar August 14, 2023 02:56
@axw axw merged commit fa6b81b into main Aug 14, 2023
@axw axw deleted the rm-service-instance branch August 14, 2023 03:11
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