Skip to content

Commit

Permalink
chore: added sourceID and destID tags for router tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
achettyiitr committed May 9, 2024
1 parent 5d54fc5 commit a7be112
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions warehouse/bcm/backend_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"sync"

"github.com/rudderlabs/rudder-go-kit/stats"

"github.com/rudderlabs/rudder-server/utils/misc"

"github.com/rudderlabs/rudder-server/warehouse/multitenant"
Expand All @@ -18,6 +19,7 @@ import (

"github.com/rudderlabs/rudder-go-kit/config"
"github.com/rudderlabs/rudder-go-kit/logger"

backendconfig "github.com/rudderlabs/rudder-server/backend-config"
cpclient "github.com/rudderlabs/rudder-server/warehouse/client/controlplane"
"github.com/rudderlabs/rudder-server/warehouse/integrations/middleware/sqlquerywrapper"
Expand Down Expand Up @@ -348,6 +350,7 @@ func (bcm *BackendConfigManager) persistSSLFileErrorStat(
"module": "warehouse",
"destType": destType,
"warehouseID": misc.GetTagName(destID, sourceName, destName, misc.TailTruncateStr(sourceID, 6)),
"sourceID": sourceID,
"destinationID": destID,
"errTag": errTag,
}
Expand Down
3 changes: 3 additions & 0 deletions warehouse/internal/api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

"github.com/rudderlabs/rudder-go-kit/logger"
"github.com/rudderlabs/rudder-go-kit/stats"

backendconfig "github.com/rudderlabs/rudder-server/backend-config"
"github.com/rudderlabs/rudder-server/utils/misc"
"github.com/rudderlabs/rudder-server/warehouse/internal/model"
Expand Down Expand Up @@ -149,6 +150,8 @@ func (api *WarehouseAPI) processHandler(w http.ResponseWriter, r *http.Request)
"workspaceId": stagingFile.WorkspaceID,
"module": "warehouse",
"destType": payload.BatchDestination.Destination.DestinationDefinition.Name,
"sourceID": payload.BatchDestination.Source.ID,
"destID": payload.BatchDestination.Destination.ID,
"warehouseID": misc.GetTagName(
payload.BatchDestination.Destination.ID,
payload.BatchDestination.Source.Name,
Expand Down
2 changes: 2 additions & 0 deletions warehouse/router/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ func (r *Router) Track(
"workspaceId": warehouse.WorkspaceID,
"module": moduleName,
"destType": r.destType,
"sourceID": source.ID,
"destID": destination.ID,
"warehouseID": misc.GetTagName(
destination.ID,
source.Name,
Expand Down
3 changes: 3 additions & 0 deletions warehouse/router/tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/rudderlabs/rudder-go-kit/stats"
"github.com/rudderlabs/rudder-go-kit/stats/memstats"
"github.com/rudderlabs/rudder-go-kit/testhelper/docker/resource/postgres"

backendconfig "github.com/rudderlabs/rudder-server/backend-config"
migrator "github.com/rudderlabs/rudder-server/services/sql-migrator"
"github.com/rudderlabs/rudder-server/utils/misc"
Expand Down Expand Up @@ -174,6 +175,8 @@ func TestRouter_Track(t *testing.T) {
"module": moduleName,
"workspaceId": warehouse.WorkspaceID,
"destType": handle.destType,
"sourceID": sourceID,
"destID": destID,
"warehouseID": misc.GetTagName(
warehouse.Destination.ID,
warehouse.Source.Name,
Expand Down

0 comments on commit a7be112

Please sign in to comment.