-
Notifications
You must be signed in to change notification settings - Fork 243
Add telemetry contextual properties if it is enabled #4870
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
Add telemetry contextual properties if it is enabled #4870
Conversation
/test v4.7-integration-e2e Looks like a flaky test -
|
/lgtm |
pkg/odo/cli/component/push.go
Outdated
@@ -258,16 +260,22 @@ func (po *PushOptions) Validate() (err error) { | |||
|
|||
// Run has the logic to perform the required actions as part of command | |||
func (po *PushOptions) Run(cmd *cobra.Command) (err error) { | |||
scontext.SetClusterType(cmd.Context(), po.Client) | |||
if segment.IsTelemetryEnabled(nil) { |
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 are multiple calls to segment.IsTelemetryEnabled(nil)
in this function. Can we store the return value of segment.IsTelemetryEnabled(nil)
into some variable so that it can be reused?
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.
I was thinking the same, perhaps adding a property to cobra command or something that is common across all the commands. Let me take a look.
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, done. Amended the multiple calls to IsTelemetryEnabled
by adding its value to cmd.Context.
/retest |
1 similar comment
/retest |
SonarCloud Quality Gate failed.
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feloy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/test all |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
/test all |
/refresh |
Just a force push to remove non existence job /lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@valaparthvi: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/override ci/prow/psi-unit-test-mac Overriding tests since team's debugging issue with Jenkins. /lgtm |
@dharmit: Overrode contexts on behalf of dharmit: ci/prow/psi-unit-test-mac, ci/prow/psi-unit-test-windows In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest Please review the full test history for this PR and help us cut down flakes. |
…r#4870) * Add telemetry contextual properties if it is enabled * update changelog * Remove the redundant calls to IsTelemetryEnabled
What type of PR is this?
/kind cleanup
What does this PR do / why we need it:
The changes introduced with this PR will add properties to telemetry context only if telemetry is enabled.
Which issue(s) this PR fixes:
Fixes part of #4462
PR acceptance criteria:
Unit test
Integration test
Documentation
Update changelog
I have read the test guidelines
How to test changes / Special notes to the reviewer:
There isn't much to test here, except you can disable telemetry and check if the data is added to contextual property with debugger.