Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

rm datadog dependency#169

Merged
evgensheff merged 1 commit intomainfrom
350-datadog
Oct 13, 2025
Merged

rm datadog dependency#169
evgensheff merged 1 commit intomainfrom
350-datadog

Conversation

@evgensheff
Copy link
Collaborator

@evgensheff evgensheff commented Oct 9, 2025

Merge after
vultisig/verifier#354

Summary by CodeRabbit

  • New Features
    • None.
  • Bug Fixes
    • Improved reliability by handling errors during engine initialization in transaction validation flows.
  • Refactor
    • Removed Datadog/StatsD metrics integration to simplify runtime and reduce dependencies.
  • Chores
    • Removed Datadog-related configuration options from server and worker configs; update your configuration files to remove Datadog sections.
    • Updated dependencies to newer versions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

Walkthrough

This change removes Datadog/StatsD integrations across API, CLI servers, workers, and scripts; updates constructors and config structs accordingly; adjusts go.mod dependencies; and adds error handling for engine initialization in plugins. Minor formatting changes occur in storage. Relay import paths are updated in worker binaries.

Changes

Cohort / File(s) Summary of changes
API middleware and server
api/middlewares.go, api/server.go
Removed StatsD middleware implementation and usage; dropped sdClient field and constructor parameter; removed statsd import/integration.
Fees CLI (server and worker)
cmd/fees/config/config.go, cmd/fees/server/main.go, cmd/fees/worker/main.go
Removed Datadog config block; deleted statsd client creation and passing; updated server/service initializations; updated relay import in worker.
Payroll CLI (server and worker)
cmd/payroll/server/config.go, cmd/payroll/server/main.go, cmd/payroll/worker/config.go, cmd/payroll/worker/main.go
Removed Datadog config; deleted statsd imports/clients; adjusted constructor calls without sdClient; updated relay import in worker; noted vault.NewManagementService signature change without sdClient.
Dev script dummy server
scripts/dev/create_fee_policy/dummy_server.go
Removed Datadog config field, statsd import, client setup, and sdClient argument; updated api.NewServer invocation.
Plugins: engine error handling
plugin/fees/transaction.go, plugin/payroll/policy.go
Changed engine initialization to return and handle error from engine.NewEngine().
Module dependencies
go.mod
Removed datadog-go; updated Vultisig-related modules; added several indirect dependencies.
Storage formatting
storage/postgres/db_plugin.go
Non-functional trailing newline change.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant Echo as Echo HTTP Server
  participant MW as statsdMiddleware
  participant H as Handler

  opt Previous flow (with StatsD)
    Client->>Echo: HTTP request
    Echo->>MW: invoke middleware
    MW->>H: next(ctx)
    H-->>MW: response/error
    MW-->>Echo: record metrics, return
    Echo-->>Client: HTTP response
  end

  rect rgb(245,245,245)
  note over Echo: Current flow (no StatsD middleware)
  Client->>Echo: HTTP request
  Echo->>H: handler
  H-->>Echo: response/error
  Echo-->>Client: HTTP response
  end
Loading
sequenceDiagram
  autonumber
  participant Plugin as ValidateProposedTransactions
  participant Engine as engine.NewEngine()

  Plugin->>Engine: NewEngine()
  alt Engine init fails
    Engine-->>Plugin: error
    Plugin-->>Plugin: return fmt.Errorf("failed to create engine: %w")
  else Success
    Engine-->>Plugin: eng
    Plugin-->>Plugin: proceed with validation
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I nibble wires where metrics once hopped,
StatsD carrots are trimmed and dropped.
Engines now greet with a cautious hello—
“Error?” I twitch, “then back we go.”
New paths to relay, clean fields to till—
Thump-thump! Deploying with a tidy will. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the main change of the PR, which is the removal of the Datadog dependency across the codebase, and is directly related to the modifications made. It is concise and specific enough for a teammate to understand the primary change at a glance.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 350-datadog

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2ca206 and 3c7a64d.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (14)
  • api/middlewares.go (0 hunks)
  • api/server.go (0 hunks)
  • cmd/fees/config/config.go (0 hunks)
  • cmd/fees/server/main.go (0 hunks)
  • cmd/fees/worker/main.go (1 hunks)
  • cmd/payroll/server/config.go (0 hunks)
  • cmd/payroll/server/main.go (0 hunks)
  • cmd/payroll/worker/config.go (1 hunks)
  • cmd/payroll/worker/main.go (1 hunks)
  • go.mod (6 hunks)
  • plugin/fees/transaction.go (1 hunks)
  • plugin/payroll/policy.go (1 hunks)
  • scripts/dev/create_fee_policy/dummy_server.go (0 hunks)
  • storage/postgres/db_plugin.go (1 hunks)
💤 Files with no reviewable changes (7)
  • cmd/payroll/server/config.go
  • cmd/payroll/server/main.go
  • api/server.go
  • cmd/fees/config/config.go
  • api/middlewares.go
  • scripts/dev/create_fee_policy/dummy_server.go
  • cmd/fees/server/main.go
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-20T13:51:05.212Z
Learnt from: neavra
PR: vultisig/plugin#157
File: api/plugin.go:236-236
Timestamp: 2025-08-20T13:51:05.212Z
Learning: In the vultisig/plugin codebase migration to vultisig-go, SystemMigrations() and vultisig_validator functionality were not moved from the verifier package to vultisig-go. This means some imports of github.com/vultisig/verifier/common are intentionally retained for accessing these specific functions, while vault-related types and common functionality were migrated to vultisig-go.

Applied to files:

  • cmd/fees/worker/main.go
  • go.mod
  • cmd/payroll/worker/main.go
📚 Learning: 2025-08-20T13:51:41.822Z
Learnt from: neavra
PR: vultisig/plugin#157
File: api/server.go:22-24
Timestamp: 2025-08-20T13:51:41.822Z
Learning: In the vultisig-go migration, only vault-related functions (GetVaultBackupFilename, DecryptVaultFromBackup) were moved from github.com/vultisig/verifier/common to github.com/vultisig/vultisig-go/common. Other functions like SystemMigrations() remained in the verifier/common package, so files using these non-migrated functions should keep the original verifier/common import.

Applied to files:

  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (8)
plugin/payroll/policy.go (1)

23-26: LGTM! Proper error handling added for engine initialization.

The error handling is correct and necessary. The implementation properly checks for initialization errors and returns them with appropriate context.

plugin/fees/transaction.go (1)

237-240: LGTM! Consistent error handling across plugin implementations.

The error handling for engine initialization is correct and maintains consistency with the similar change in plugin/payroll/policy.go.

cmd/payroll/worker/config.go (1)

14-23: No Datadog references remain
The Datadog configuration field has been removed and searches through cmd/payroll show no remaining references.

cmd/payroll/worker/main.go (2)

70-78: Approve vault service initialization update

The removal of the sdClient parameter from the vault.NewManagementService call is correct. Confirm that the vault.NewManagementService signature in the vault package has been updated accordingly to avoid compile errors.


15-15: Ensure relay.NewRelayClient API compatibility
All vutliserver/relay imports have been replaced. Confirm that relay.NewRelayClient in github.com/vultisig/vultisig-go/relay retains the same signature at cmd/payroll/worker/main.go:94 and cmd/fees/worker/main.go:139.

cmd/fees/worker/main.go (2)

122-127: LGTM! Datadog dependency cleanly removed.

The vault.NewManagementService call has been properly updated to remove the sdClient parameter, aligning with the PR objective to remove Datadog/StatsD integration. Error handling is appropriate.


17-17: Verify relay.NewRelayClient API compatibility

  • go.mod is already pinned to v0.0.0-20251004125942-60b3b1898d15 (pseudo-version with commit SHA) – satisfies reproducible-build best practices.
  • Manually confirm that relay.NewRelayClient(cfg.VaultServiceConfig.Relay.Server) signature matches the previous in-house implementation to avoid breaking changes.
go.mod (1)

20-23: Thanks for updating the upstream module pins.

These pseudo-versions track the Datadog-free commits and keep this plugin aligned with the rest of the stack.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@evgensheff evgensheff merged commit 98eb398 into main Oct 13, 2025
2 checks passed
@evgensheff evgensheff deleted the 350-datadog branch October 13, 2025 07:45
@evgensheff evgensheff restored the 350-datadog branch October 13, 2025 07:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants