@@ -85,7 +85,7 @@ func (s *Metrics) Equal(other *Metrics) bool {
85
85
return true
86
86
}
87
87
88
- func getOtelMeters (tableName , clientID string ) * OtelMeters {
88
+ func getOtelMeters (tableName , clientID , invocationID string ) * OtelMeters {
89
89
resources , err := otel .Meter (OtelName ).Int64Counter ("sync.table.resources" ,
90
90
metric .WithDescription ("Number of resources synced for a table" ),
91
91
metric .WithUnit ("/{tot}" ),
@@ -136,21 +136,22 @@ func getOtelMeters(tableName, clientID string) *OtelMeters {
136
136
attributes : []attribute.KeyValue {
137
137
attribute .Key ("sync.client.id" ).String (clientID ),
138
138
attribute .Key ("sync.table.name" ).String (tableName ),
139
+ attribute .Key ("sync.invocation.id" ).String (invocationID ),
139
140
},
140
141
}
141
142
}
142
143
143
- func (s * Metrics ) InitWithClients (table * schema.Table , clients []schema.ClientMeta ) {
144
+ func (s * Metrics ) InitWithClients (table * schema.Table , clients []schema.ClientMeta , invocationID string ) {
144
145
s .TableClient [table .Name ] = make (map [string ]* TableClientMetrics , len (clients ))
145
146
for _ , client := range clients {
146
147
tableName := table .Name
147
148
clientID := client .ID ()
148
149
s.TableClient [tableName ][clientID ] = & TableClientMetrics {
149
- otelMeters : getOtelMeters (tableName , clientID ),
150
+ otelMeters : getOtelMeters (tableName , clientID , invocationID ),
150
151
}
151
152
}
152
153
for _ , relation := range table .Relations {
153
- s .InitWithClients (relation , clients )
154
+ s .InitWithClients (relation , clients , invocationID )
154
155
}
155
156
}
156
157
0 commit comments