Skip to content

Commit

Permalink
Add service.id to service key; remove instances
Browse files Browse the repository at this point in the history
`service.id` uniquely identifies a cluster or
deployment of a service; all nodes of the service
are expected to share the same `service.id`.
This is added to the service key.

For now, we set `service.id` as a hash of global labels.
 - We will not perform this `service.id` calculation
   for RUM, as RUM global labels have historically
   had high cardinality.
 - In the long run we should stop doing
   that, and require users to specify a value
   explicitly, if they wish to isolate time series
   for two service clusters/deployments.

Instead of including global labels in the aggregation
key, we now add them to the service metrics struct.
When merging metrics, we merge the labels. We assume
there will be a negligible chance of hash collisions
in the `service.id` calculation, so the only time this
should occur is for RUM. To protect against high-
cardinality labels, we place a limit on the number
of label keys and values that may be merged.
  • Loading branch information
axw committed Jul 20, 2023
1 parent bee4200 commit 72bf3c8
Show file tree
Hide file tree
Showing 10 changed files with 939 additions and 1,672 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ PROTOC_OUT?=.
gen-proto: $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_VTPROTO) $(PROTOC)
$(eval STRUCTS := $(shell grep '^message' proto/*.proto | cut -d ' ' -f2))
$(eval PROTOC_VT_STRUCTS := $(shell for s in $(STRUCTS); do echo --go-vtproto_opt=pool=./aggregationpb.$$s ;done))
$(PROTOC) -I . --go_out=$(PROTOC_OUT) --plugin protoc-gen-go="$(PROTOC_GEN_GO)" \
$(PROTOC) -I proto --go_out=$(PROTOC_OUT) --plugin protoc-gen-go="$(PROTOC_GEN_GO)" \
--go-vtproto_out=$(PROTOC_OUT) --plugin protoc-gen-go-vtproto="$(PROTOC_GEN_GO_VTPROTO)" \
--go-vtproto_opt=features=marshal+unmarshal+size+pool \
$(PROTOC_VT_STRUCTS) \
Expand Down
1,016 changes: 411 additions & 605 deletions aggregationpb/aggregation.pb.go

Large diffs are not rendered by default.

Loading

0 comments on commit 72bf3c8

Please sign in to comment.