-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add trackingPlanId label in events_processed_total metric #4782
chore: add trackingPlanId label in events_processed_total metric #4782
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe recent update to the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant EventStatsReporter
participant Metric
participant ConnectionDetails
Client->>EventStatsReporter: Call Record(metrics)
loop For each metric
EventStatsReporter->>Metric: Access ConnectionDetails
Metric->>ConnectionDetails: Get TrackingPlanID
ConnectionDetails-->>Metric: Return TrackingPlanID
Metric-->>EventStatsReporter: Provide TrackingPlanID
EventStatsReporter->>EventStatsReporter: Add trackingPlanId to tags
end
EventStatsReporter-->>Client: Complete Record function
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- enterprise/reporting/event_stats.go (1 hunks)
Additional comments not posted (1)
enterprise/reporting/event_stats.go (1)
50-50
: The addition oftrackingPlanId
enhances the granularity of the metrics, aligning with the PR objectives. Good integration with existing tags.
@@ -47,6 +47,7 @@ func (es *EventStatsReporter) Record(metrics []*types.PUReportedMetric) { | |||
"terminal": terminal, | |||
"destinationType": es.configSubscriber.GetDestDetail(metrics[index].ConnectionDetails.DestinationID).destType, | |||
"status": status, | |||
"trackingPlanId": metrics[index].ConnectionDetails.TrackingPlanID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Ensure TrackingPlanID
is always non-null to avoid runtime errors.
The search results indicate that TrackingPlanID
is assigned in various places, including tests and the main codebase. However, there is no evidence of null checks or default assignments to ensure it is always set before use. This could potentially lead to runtime errors if TrackingPlanID
is ever nil.
- File:
enterprise/reporting/event_stats.go
- Line: 50
Please ensure that TrackingPlanID
is properly initialized or checked for null values before being used.
Analysis chain
Ensure TrackingPlanID
is always non-null to avoid runtime errors.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that `TrackingPlanID` is always set before being used.
# Test: Search for any null checks or default assignments for `TrackingPlanID`.
rg --type go $'if .*TrackingPlanID.*== nil'
Length of output: 44
Script:
#!/bin/bash
# Description: Find where `TrackingPlanID` is assigned and how it is used.
# Search for assignments to `TrackingPlanID`
rg --type go 'TrackingPlanID\s*='
# Search for usages of `TrackingPlanID`
rg --type go 'TrackingPlanID'
Length of output: 4124
https://github.com/rudderlabs/rudder-server into chore.addTrackingPlanLabelInEventProcessedTotalMetric
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4782 +/- ##
==========================================
+ Coverage 73.30% 73.32% +0.01%
==========================================
Files 414 414
Lines 48688 48689 +1
==========================================
+ Hits 35691 35700 +9
+ Misses 10658 10652 -6
+ Partials 2339 2337 -2 ☔ View full report in Codecov by Sentry. |
Description
Add
trackingPlanId
label in events_processed_total metric.Linear Ticket
resolves OBS-498
Security
Summary by CodeRabbit