-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: update heartbeat, language event and add serviceName event #4571
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
WalkthroughThe recent updates enhance the query service's capability to handle telemetry data more flexibly. By introducing new methods and modifying existing ones, the service can now query logs, samples, spans, and tags over specific intervals, improving data retrieval efficiency. Additionally, the telemetry system has been refined to better capture and report on service-related metrics, ensuring a more comprehensive understanding of system performance and user interactions. Changes
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 (
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
2 similar comments
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
Review Status
Actionable comments generated: 5
Configuration used: CodeRabbit UI
Files selected for processing (3)
- pkg/query-service/app/clickhouseReader/reader.go (6 hunks)
- pkg/query-service/interfaces/interface.go (2 hunks)
- pkg/query-service/telemetry/telemetry.go (7 hunks)
Additional comments: 10
pkg/query-service/interfaces/interface.go (5)
- 5-5: The addition of the
time
package import is appropriate given the introduction of methods that require atime.Duration
parameter. This change is necessary for the functionality being introduced and follows best practices for handling time-based operations in Go.- 78-78: The method
GetTotalLogs
has been correctly renamed and now returns auint64
and anerror
, which is a standard approach for methods that perform operations which might fail. This change aligns with Go's idiomatic error handling.- 79-79: The addition of the
GetTotalSamples
method is consistent with the objective of enhancing telemetry data collection capabilities. Returning auint64
and anerror
is appropriate for the expected functionality.- 80-80: The modification of
GetSpansInLastHeartBeatInterval
to include aninterval
parameter of typetime.Duration
is logical and necessary for the intended functionality of querying spans within a specific time interval. This change improves the method's flexibility and utility.- 82-84: The updates to
GetSamplesInfoInLastHeartBeatInterval
,GetLogsInfoInLastHeartBeatInterval
, andGetTagsInfoInLastHeartBeatInterval
methods to include aninterval
parameter of typetime.Duration
are consistent with the objective of enhancing query capabilities based on specific time intervals. These changes are correctly implemented and follow best practices for handling time-based operations in Go.pkg/query-service/telemetry/telemetry.go (4)
- 38-38: The addition of the
TELEMETRY_EVENT_SERVICE
constant is correctly implemented and follows Go's naming conventions for constants. This change is necessary for the new functionality being introduced.- 55-55: Updating the
SAAS_EVENTS_LIST
map to include theTELEMETRY_EVENT_SERVICE
constant is appropriate and necessary for the new telemetry event handling. This change ensures that the new event type is recognized and processed correctly.- 235-237: The loop that sends the
TELEMETRY_EVENT_SERVICE
event for each service found intagsInfo.Services
is correctly implemented. This approach allows for the emission of service-specific telemetry events, enhancing the granularity of the telemetry data collected.- 288-288: The conditional check to send the
TELEMETRY_EVENT_DASHBOARDS_ALERTS
event only if there are dashboards or alerts is a good practice. It avoids unnecessary event emissions when there is no relevant data to report, which can help in optimizing the telemetry data collection process.pkg/query-service/app/clickhouseReader/reader.go (1)
- 3365-3368: The method
GetTotalSamples
retrieves the total count of samples excluding those with a metric name starting with 'signoz_'. This is a straightforward query, but it's important to ensure that the metric name filter ('signoz_%') correctly captures all intended cases and doesn't inadvertently exclude relevant data. Additionally, consider the performance impact of this query on large datasets and whether any optimizations or indexes could improve its efficiency.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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.
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.
Had a code walk-through with @makeavish - approving on request
Summary
Summary by CodeRabbit