Repository navigation
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5529 +/- ##
==========================================
+ Coverage 75.09% 75.42% +0.32%
==========================================
Files 467 474 +7
Lines 64053 64904 +851
==========================================
+ Hits 48101 48954 +853
+ Misses 13283 13247 -36
- Partials 2669 2703 +34 ☔ View full report in Codecov by Sentry. |
Contributor
|
This PR is considered to be stale. It has been open 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR. |
1 task done
lvrach
added a commit
that referenced
this pull request
Apr 15, 2025
# Description ## Motivation To introduce a cost attribution metric for all reporting services. I've noticed coupling and discrepancies between different client implementations, making it hard to test the changes and requiring redundant effort. First, I attempted a more [aggressive](#5529) refactor effort. However, after discussing this with the PipeOps team, we decided to take a more cynical approach. ## Plan * Introduce a common client for all communication with the reporting service * Support switching to the new common client via a single feature flag * Intention to remove old client/send method in the next release. It was also decided * To break the backward compatibility with metrics exposed by old clients. This might break some dashboards, but no alert should be impacted. ## Changes ### Metric names New metrics: ```go const ( StatRequestTotalBytes = "reporting_client_http_request_total_bytes" StatTotalDurationsSeconds = "reporting_client_http_total_durations_seconds" StatRequestLatency = "reporting_client_http_request_latency" StatHttpRequest = "reporting_client_http_request" ) ``` Deprecated metrics -- will no longer work after switching to the common client: ```go f.reqLatency = f.stats.NewTaggedStat("reporting_flusher_http_request_duration_seconds", stats.TimerType, tags) f.reqCount = f.stats.NewTaggedStat("reporting_flusher_http_requests_total", stats.CountType, tags) f.sentBytes = f.stats.NewTaggedStat("reporting_flusher_sent_bytes", stats.HistogramType, tags) edr.stats.NewTaggedStat("error_detail_reporting_http_request", stats.CountType, httpStatTags).Increment() edr.edReportingRequestLatency = edr.stats.NewTaggedStat("error_detail_reporting_request_latency", stats.TimerType, tags) ``` ### Metric labels Changes: * `workspaceID` -- REMOVED will no longer be captured by the client, as it is not relevant when multiple workspaces are batch to a single call * `clientName` -- RENAMED --> `module` * `endpoint` --> ADDED: reporting URL * `path` --> ADDED: reporting path/service ### `region` query param Region query parameter, used only by some reporting clients **has been removed**. Based on team feedback this query param was used temporary for multi region transition and is no longer needed. ### `REPORTING_URL` env var REPORTING_URL now always defaults to `"https://reporting.dev.rudderlabs.com"` Some of the existing clients defaulted to `https://reporting.rudderstack.com/` ## To Be Discussed * Should we use a default value for `REPORTING_URL`, would we rather fail if `REPORTING_URL` is not configured ? It could be a privacy risk for EU customers if reporting us endpoint is configured accidentally. * Should we introduce `.Ping()` method and corresponding endpoint ? ## Next steps 1. Rollout `useCommonClient` flag in production 2. Update Grafana dashboards as need 3. Remove all deprecated code (most of it is marked with commends` 4. Start the work for unifying reporting logic ## Linear Ticket Resolves PRI-168 https://linear.app/rudderstack/issue/PRI-168/introduce-reporting-client-metrics-in-rudder-server-for-cost ## Security - [x] The code changed/added as part of this pull request won't create any security issues with how the software is being used.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
While working on the reporting code base to add metrics for cost attribution.
Linear Ticket
< Replace with Linear Link ( create or search linear ticket) or >
Security