@@ -85,7 +85,7 @@ func (s *Metrics) Equal(other *Metrics) bool {
8585 return true
8686}
8787
88- func getOtelMeters (tableName string , clientID string ) * OtelMeters {
88+ func getOtelMeters (tableName , clientID , invocationID string ) * OtelMeters {
8989 resources , err := otel .Meter (OtelName ).Int64Counter ("sync.table.resources" ,
9090 metric .WithDescription ("Number of resources synced for a table" ),
9191 metric .WithUnit ("/{tot}" ),
@@ -136,21 +136,22 @@ func getOtelMeters(tableName string, clientID string) *OtelMeters {
136136 attributes : []attribute.KeyValue {
137137 attribute .Key ("sync.client.id" ).String (clientID ),
138138 attribute .Key ("sync.table.name" ).String (tableName ),
139+ attribute .Key ("sync.invocation.id" ).String (invocationID ),
139140 },
140141 }
141142}
142143
143- func (s * Metrics ) InitWithClients (table * schema.Table , clients []schema.ClientMeta ) {
144+ func (s * Metrics ) InitWithClients (table * schema.Table , clients []schema.ClientMeta , invocationID string ) {
144145 s .TableClient [table .Name ] = make (map [string ]* TableClientMetrics , len (clients ))
145146 for _ , client := range clients {
146147 tableName := table .Name
147148 clientID := client .ID ()
148149 s.TableClient [tableName ][clientID ] = & TableClientMetrics {
149- otelMeters : getOtelMeters (tableName , clientID ),
150+ otelMeters : getOtelMeters (tableName , clientID , invocationID ),
150151 }
151152 }
152153 for _ , relation := range table .Relations {
153- s .InitWithClients (relation , clients )
154+ s .InitWithClients (relation , clients , invocationID )
154155 }
155156}
156157
0 commit comments