Skip to content

Commit

Permalink
Pass resource id and name to metrics
Browse files Browse the repository at this point in the history
default monitoring should distinguish transfers

---

Pull Request resolved: #93
commit_hash:eabc8b3173481dc9398ca8d7b50dd9b51668c7cb
  • Loading branch information
laskoviymishka authored and robot-piglet committed Nov 7, 2024
1 parent db55cc8 commit b1c4a62
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cmd/trcli/activate/activate.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ func RunActivate(
op,
cp,
*transfer,
registry,
registry.WithTags(map[string]string{
"resource_id": transfer.ID,
"name": transfer.TransferName,
}),
)

if err != nil {
Expand Down
10 changes: 9 additions & 1 deletion cmd/trcli/replicate/replicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@ func RunReplication(cp coordinator.Coordinator, transfer *model.Transfer, regist
return xerrors.Errorf("unable to adapt transfer: %w", err)
}
for {
worker := local.NewLocalWorker(cp, transfer, registry, logger.Log)
worker := local.NewLocalWorker(
cp,
transfer,
registry.WithTags(map[string]string{
"resource_id": transfer.ID,
"name": transfer.TransferName,
}),
logger.Log,
)
err := worker.Run()
if abstract.IsFatal(err) {
return err
Expand Down
5 changes: 4 additions & 1 deletion cmd/trcli/upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ func RunUpload(cp coordinator.Coordinator, transfer *model.Transfer, tables *con
*transfer,
nil,
tasks.UploadSpec{Tables: tables.Tables},
registry,
registry.WithTags(map[string]string{
"resource_id": transfer.ID,
"name": transfer.TransferName,
}),
)
}

0 comments on commit b1c4a62

Please sign in to comment.