From 27e570a5b851ffa71999ae4156b546badf6f64c2 Mon Sep 17 00:00:00 2001 From: Patrick Huie Date: Mon, 6 Jul 2026 14:50:32 -0400 Subject: [PATCH 1/2] refactoring some naming + adding tenantID --- metering/go/identity.pb.go | 154 ++++++++++++++++++++-------- metering/go/meter_record.pb.go | 2 +- metering/go/snapshot.pb.go | 2 +- metering/go/utilization.pb.go | 2 +- metering/metering/v1/identity.proto | 40 +++++--- 5 files changed, 137 insertions(+), 63 deletions(-) diff --git a/metering/go/identity.pb.go b/metering/go/identity.pb.go index f89527d9..86d5df91 100644 --- a/metering/go/identity.pb.go +++ b/metering/go/identity.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.11 // protoc v5.29.3 // source: metering/v1/identity.proto @@ -97,24 +97,20 @@ func (MeterAction) EnumDescriptor() ([]byte, []int) { // carrying values out-of-band on telemetry. type ResourceIdentity struct { state protoimpl.MessageState `protogen:"open.v1"` - // Deployment product, e.g. "cre-mainline". One of the deployment+DON+node + // Deployment product, e.g. "cre". One of the deployment+DON+node // dimensions used for coarse billing rollup. Product string `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"` + // Deployment tenant name, e.g. "mainline" or "enterprise". This is the + // human-readable tenant label (not the numeric tenant ID). + Tenant string `protobuf:"bytes,2,opt,name=tenant,proto3" json:"tenant,omitempty"` // Deployment environment, e.g. "production", "staging". A coarse // billing-rollup dimension. - Environment string `protobuf:"bytes,2,opt,name=environment,proto3" json:"environment,omitempty"` + Environment string `protobuf:"bytes,3,opt,name=environment,proto3" json:"environment,omitempty"` // Deployment zone, e.g. "wf-zone-a". A coarse billing-rollup dimension. - Zone string `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"` - // DON identifier the emitting service belongs to. Optional: web2 emitters - // without a DON leave this unset rather than sending an empty string. A - // coarse billing-rollup dimension; used (with node_id) to count distinct - // nodes for quorum. - DonId *string `protobuf:"bytes,4,opt,name=don_id,json=donId,proto3,oneof" json:"don_id,omitempty"` - // Node identifier (the node's CSA public key). Optional: web2 emitters - // without a node identity leave this unset rather than sending an empty - // string. A coarse billing-rollup dimension; lets billing dedup a node's - // retries and count distinct nodes. - NodeId *string `protobuf:"bytes,5,opt,name=node_id,json=nodeId,proto3,oneof" json:"node_id,omitempty"` + Zone string `protobuf:"bytes,4,opt,name=zone,proto3" json:"zone,omitempty"` + // DON-specific identity dimensions. Present only for DON emitters. Web2 or + // other non-DON emitters leave this unset instead of sending empty IDs. + Don *DonIdentity `protobuf:"bytes,5,opt,name=don,proto3,oneof" json:"don,omitempty"` // Stable service constant identifying the emitting service (the old // `entity`), e.g. "cron-trigger", "http-trigger", "evm-log-trigger", // "workflow-syncer-v2". A coarse billing-rollup dimension. @@ -125,8 +121,11 @@ type ResourceIdentity struct { // optionality to add a level of hierarchy within the resource_pool, or // UID a resource_pool ResourcePoolId string `protobuf:"bytes,8,opt,name=resource_pool_id,json=resourcePoolId,proto3" json:"resource_pool_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + // Numeric tenant identifier as used by Accounts/Linking/registry/Vault DON. + // This is a numbered identifier represented as a string. + NumericTenantId string `protobuf:"bytes,9,opt,name=numeric_tenant_id,json=numericTenantId,proto3" json:"numeric_tenant_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ResourceIdentity) Reset() { @@ -166,32 +165,32 @@ func (x *ResourceIdentity) GetProduct() string { return "" } -func (x *ResourceIdentity) GetEnvironment() string { +func (x *ResourceIdentity) GetTenant() string { if x != nil { - return x.Environment + return x.Tenant } return "" } -func (x *ResourceIdentity) GetZone() string { +func (x *ResourceIdentity) GetEnvironment() string { if x != nil { - return x.Zone + return x.Environment } return "" } -func (x *ResourceIdentity) GetDonId() string { - if x != nil && x.DonId != nil { - return *x.DonId +func (x *ResourceIdentity) GetZone() string { + if x != nil { + return x.Zone } return "" } -func (x *ResourceIdentity) GetNodeId() string { - if x != nil && x.NodeId != nil { - return *x.NodeId +func (x *ResourceIdentity) GetDon() *DonIdentity { + if x != nil { + return x.Don } - return "" + return nil } func (x *ResourceIdentity) GetService() string { @@ -215,23 +214,88 @@ func (x *ResourceIdentity) GetResourcePoolId() string { return "" } +func (x *ResourceIdentity) GetNumericTenantId() string { + if x != nil { + return x.NumericTenantId + } + return "" +} + +// DonIdentity captures DON-only identity dimensions together so consumers can +// branch on message presence, not individual field permutations. +type DonIdentity struct { + state protoimpl.MessageState `protogen:"open.v1"` + // DON ID the emitting service belongs to. + DonId string `protobuf:"bytes,1,opt,name=don_id,json=donId,proto3" json:"don_id,omitempty"` + // Node ID (the node's logical name, not the CSA public key). + NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DonIdentity) Reset() { + *x = DonIdentity{} + mi := &file_metering_v1_identity_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DonIdentity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DonIdentity) ProtoMessage() {} + +func (x *DonIdentity) ProtoReflect() protoreflect.Message { + mi := &file_metering_v1_identity_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DonIdentity.ProtoReflect.Descriptor instead. +func (*DonIdentity) Descriptor() ([]byte, []int) { + return file_metering_v1_identity_proto_rawDescGZIP(), []int{1} +} + +func (x *DonIdentity) GetDonId() string { + if x != nil { + return x.DonId + } + return "" +} + +func (x *DonIdentity) GetNodeId() string { + if x != nil { + return x.NodeId + } + return "" +} + var File_metering_v1_identity_proto protoreflect.FileDescriptor const file_metering_v1_identity_proto_rawDesc = "" + "\n" + - "\x1ametering/v1/identity.proto\x12\vmetering.v1\"\x9c\x02\n" + + "\x1ametering/v1/identity.proto\x12\vmetering.v1\"\xc8\x02\n" + "\x10ResourceIdentity\x12\x18\n" + - "\aproduct\x18\x01 \x01(\tR\aproduct\x12 \n" + - "\venvironment\x18\x02 \x01(\tR\venvironment\x12\x12\n" + - "\x04zone\x18\x03 \x01(\tR\x04zone\x12\x1a\n" + - "\x06don_id\x18\x04 \x01(\tH\x00R\x05donId\x88\x01\x01\x12\x1c\n" + - "\anode_id\x18\x05 \x01(\tH\x01R\x06nodeId\x88\x01\x01\x12\x18\n" + + "\aproduct\x18\x01 \x01(\tR\aproduct\x12\x16\n" + + "\x06tenant\x18\x02 \x01(\tR\x06tenant\x12 \n" + + "\venvironment\x18\x03 \x01(\tR\venvironment\x12\x12\n" + + "\x04zone\x18\x04 \x01(\tR\x04zone\x12/\n" + + "\x03don\x18\x05 \x01(\v2\x18.metering.v1.DonIdentityH\x00R\x03don\x88\x01\x01\x12\x18\n" + "\aservice\x18\x06 \x01(\tR\aservice\x12#\n" + "\rresource_pool\x18\a \x01(\tR\fresourcePool\x12(\n" + - "\x10resource_pool_id\x18\b \x01(\tR\x0eresourcePoolIdB\t\n" + - "\a_don_idB\n" + - "\n" + - "\b_node_id*\x90\x01\n" + + "\x10resource_pool_id\x18\b \x01(\tR\x0eresourcePoolId\x12*\n" + + "\x11numeric_tenant_id\x18\t \x01(\tR\x0fnumericTenantIdB\x06\n" + + "\x04_don\"=\n" + + "\vDonIdentity\x12\x15\n" + + "\x06don_id\x18\x01 \x01(\tR\x05donId\x12\x17\n" + + "\anode_id\x18\x02 \x01(\tR\x06nodeId*\x90\x01\n" + "\vMeterAction\x12\x1c\n" + "\x18METER_ACTION_UNSPECIFIED\x10\x00\x12\x18\n" + "\x14METER_ACTION_RESERVE\x10\x01\x12\x18\n" + @@ -252,17 +316,19 @@ func file_metering_v1_identity_proto_rawDescGZIP() []byte { } var file_metering_v1_identity_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_metering_v1_identity_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_metering_v1_identity_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_metering_v1_identity_proto_goTypes = []any{ (MeterAction)(0), // 0: metering.v1.MeterAction (*ResourceIdentity)(nil), // 1: metering.v1.ResourceIdentity + (*DonIdentity)(nil), // 2: metering.v1.DonIdentity } var file_metering_v1_identity_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 2, // 0: metering.v1.ResourceIdentity.don:type_name -> metering.v1.DonIdentity + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_metering_v1_identity_proto_init() } @@ -277,7 +343,7 @@ func file_metering_v1_identity_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_metering_v1_identity_proto_rawDesc), len(file_metering_v1_identity_proto_rawDesc)), NumEnums: 1, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/metering/go/meter_record.pb.go b/metering/go/meter_record.pb.go index 718bcc07..a0cedaed 100644 --- a/metering/go/meter_record.pb.go +++ b/metering/go/meter_record.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.11 // protoc v5.29.3 // source: metering/v1/meter_record.proto diff --git a/metering/go/snapshot.pb.go b/metering/go/snapshot.pb.go index 413b2cc4..d862427b 100644 --- a/metering/go/snapshot.pb.go +++ b/metering/go/snapshot.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.11 // protoc v5.29.3 // source: metering/v1/snapshot.proto diff --git a/metering/go/utilization.pb.go b/metering/go/utilization.pb.go index 5b140113..2d738f2d 100644 --- a/metering/go/utilization.pb.go +++ b/metering/go/utilization.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.6 +// protoc-gen-go v1.36.11 // protoc v5.29.3 // source: metering/v1/utilization.proto diff --git a/metering/metering/v1/identity.proto b/metering/metering/v1/identity.proto index d1cefcd7..11882d3b 100644 --- a/metering/metering/v1/identity.proto +++ b/metering/metering/v1/identity.proto @@ -9,34 +9,42 @@ option go_package = "github.com/smartcontractkit/chainlink-protos/metering/go;me // dimension as a discrete column rather than parsing a dotted string or // carrying values out-of-band on telemetry. message ResourceIdentity { - // Deployment product, e.g. "cre-mainline". One of the deployment+DON+node + // Deployment product, e.g. "cre". One of the deployment+DON+node // dimensions used for coarse billing rollup. string product = 1; + // Deployment tenant name, e.g. "mainline" or "enterprise". This is the + // human-readable tenant label (not the numeric tenant ID). + string tenant = 2; + // Numeric tenant identifier as used by Accounts/Linking/registry/Vault DON. + // This is a numbered identifier represented as a string. + string numeric_tenant_id = 3; // Deployment environment, e.g. "production", "staging". A coarse // billing-rollup dimension. - string environment = 2; + string environment = 4; // Deployment zone, e.g. "wf-zone-a". A coarse billing-rollup dimension. - string zone = 3; - // DON identifier the emitting service belongs to. Optional: web2 emitters - // without a DON leave this unset rather than sending an empty string. A - // coarse billing-rollup dimension; used (with node_id) to count distinct - // nodes for quorum. - optional string don_id = 4; - // Node identifier (the node's CSA public key). Optional: web2 emitters - // without a node identity leave this unset rather than sending an empty - // string. A coarse billing-rollup dimension; lets billing dedup a node's - // retries and count distinct nodes. - optional string node_id = 5; + string zone = 5; + // DON-specific identity dimensions. Present only for DON emitters. Web2 or + // other non-DON emitters leave this unset instead of sending empty IDs. + optional DonIdentity don = 6; // Stable service constant identifying the emitting service (the old // `entity`), e.g. "cron-trigger", "http-trigger", "evm-log-trigger", // "workflow-syncer-v2". A coarse billing-rollup dimension. - string service = 6; + string service = 7; // Resource pool the action applies to, e.g. "trigger_registrations", // "log_filters", "workflow_storage". Human friendly name - string resource_pool = 7; + string resource_pool = 8; // optionality to add a level of hierarchy within the resource_pool, or // UID a resource_pool - string resource_pool_id = 8; + string resource_pool_id = 9; +} + +// DonIdentity captures DON-only identity dimensions together so consumers can +// branch on message presence, not individual field permutations. +message DonIdentity { + // DON ID the emitting service belongs to. + string don_id = 1; + // Node ID (the node's logical name, not the CSA public key). + string node_id = 2; } // MeterAction identifies the billing semantics of a MeterRecord. From 467c5a9a248f9897159a86c090dbb3b8b7b9cc24 Mon Sep 17 00:00:00 2001 From: "app-token-issuer-engops[bot]" <144731339+app-token-issuer-engops[bot]@users.noreply.github.com> Date: Mon, 6 Jul 2026 18:56:19 +0000 Subject: [PATCH 2/2] bot: regenerate protobuf files --- metering/go/identity.pb.go | 2 +- metering/go/meter_record.pb.go | 2 +- metering/go/snapshot.pb.go | 2 +- metering/go/utilization.pb.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/metering/go/identity.pb.go b/metering/go/identity.pb.go index 874bd06f..b10b4516 100644 --- a/metering/go/identity.pb.go +++ b/metering/go/identity.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.6 // protoc v5.29.3 // source: metering/v1/identity.proto diff --git a/metering/go/meter_record.pb.go b/metering/go/meter_record.pb.go index a0cedaed..718bcc07 100644 --- a/metering/go/meter_record.pb.go +++ b/metering/go/meter_record.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.6 // protoc v5.29.3 // source: metering/v1/meter_record.proto diff --git a/metering/go/snapshot.pb.go b/metering/go/snapshot.pb.go index d862427b..413b2cc4 100644 --- a/metering/go/snapshot.pb.go +++ b/metering/go/snapshot.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.6 // protoc v5.29.3 // source: metering/v1/snapshot.proto diff --git a/metering/go/utilization.pb.go b/metering/go/utilization.pb.go index 2d738f2d..5b140113 100644 --- a/metering/go/utilization.pb.go +++ b/metering/go/utilization.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 +// protoc-gen-go v1.36.6 // protoc v5.29.3 // source: metering/v1/utilization.proto