Skip to content

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

Merged

Conversation

valaparthvi
Copy link
Contributor

@valaparthvi valaparthvi commented Jul 2, 2021

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.

@valaparthvi
Copy link
Contributor Author

/test v4.7-integration-e2e

Looks like a flaky test -

[odo] I0702 06:42:31.202940   66152 kclient.go:215] Checking if "ingresses" resource supported
[odo] I0702 06:42:31.372793   66152 kclient.go:215] Checking if "projects" resource supported
[odo] I0702 06:42:31.544924   66152 kclient.go:215] Checking if "projects" resource supported
[odo]  ⚠  Warning! Projects are deleted from the cluster asynchronously. Odo does its best to delete the project. Due to multi-tenant clusters, the project may still exist on a different node.
[odo] I0702 06:42:31.647162   66152 segment.go:210] Checking telemetry enable status
[odo] I0702 06:42:31.647171   66152 segment.go:223] Sending telemetry disabled by ODO_DISABLE_TELEMETRY=true
[odo] I0702 06:42:31.647180   66152 odo.go:75] Could not get the latest release information in time. Never mind, exiting gracefully :)
[odo]  ✓  Deleted project : e2e-images-test102oqy
Setting current dir to: /go/src/github.com/openshift/odo/tests/e2escenarios
Deleting dir: /tmp/452846782

�[32m•�[0m�[32m•�[0m�[32m•�[0m�[32m•�[0m�[32m•�[0m�[32m•�[0m�[32m•�[0m�[32m•�[0m�[32m•�[0m�[32m•�[0m�[32m•�[0m�[32m•�[0m

�[91m�[1mSummarizing 1 Failure:�[0m

�[91m�[1m[Fail] �[0m�[90modo supported images e2e tests �[0m�[0modo supported images deployment on amd64 �[0m�[91m�[1m[It] Should be able to verify the nodejs-12-centos7 image �[0m
�[37m/go/src/github.com/openshift/odo/tests/helper/helper_generic.go:82�[0m

�[1m�[91mRan 21 of 21 Specs in 408.084 seconds�[0m
�[1m�[91mFAIL!�[0m -- �[32m�[1m20 Passed�[0m | �[91m�[1m1 Failed�[0m | �[33m�[1m0 Pending�[0m | �[36m�[1m0 Skipped�[0m


Ginkgo ran 1 suite in 6m51.562366135s
Test Suite Failed
exit status 1
make: *** [test-e2e-all] Error 1
+ error=true
+ '[' true ']'
+ exit -1
{"component":"entrypoint","error":"wrapped process failed: exit status 255","file":"prow/entrypoint/run.go:80","func":"k8s.io/test-infra/prow/entrypoint.Options.Run","level":"error","msg":"Error executing test process","severity":"error","time":"2021-07-02T06:47:21Z"}
error: failed to execute wrapped command: exit status 255

@feloy
Copy link
Contributor

feloy commented Jul 2, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 2, 2021
@@ -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) {
Copy link
Member

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?

Copy link
Contributor Author

@valaparthvi valaparthvi Jul 2, 2021

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.

Copy link
Contributor Author

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.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 2, 2021
@valaparthvi
Copy link
Contributor Author

/retest

1 similar comment
@valaparthvi
Copy link
Contributor Author

/retest

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 5, 2021

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 12 Code Smells

No Coverage information No Coverage information
6.7% 6.7% Duplication

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 5, 2021
@feloy
Copy link
Contributor

feloy commented Jul 5, 2021

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jul 5, 2021

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Jul 5, 2021
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@redhat-developer redhat-developer deleted a comment from openshift-ci bot Jul 5, 2021
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@valaparthvi
Copy link
Contributor Author

/test all

@valaparthvi
Copy link
Contributor Author

/retest

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@prietyc123
Copy link
Contributor

/test all

@prietyc123
Copy link
Contributor

/refresh

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 5, 2021
@prietyc123
Copy link
Contributor

New changes are detected. LGTM label has been removed.

Just a force push to remove non existence job

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 5, 2021
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Jul 5, 2021
@openshift-ci openshift-ci bot removed lgtm Indicates that a PR is ready to be merged. Required by Prow. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. labels Jul 5, 2021
@openshift-ci
Copy link

openshift-ci bot commented Jul 5, 2021

@valaparthvi: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/psi-kubernetes-integration-e2e 45f98d8 link /test psi-kubernetes-integration-e2e

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.

@dharmit
Copy link
Member

dharmit commented Jul 6, 2021

/override ci/prow/psi-unit-test-mac
/override ci/prow/psi-unit-test-windows

Overriding tests since team's debugging issue with Jenkins.

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Jul 6, 2021

@dharmit: Overrode contexts on behalf of dharmit: ci/prow/psi-unit-test-mac, ci/prow/psi-unit-test-windows

In response to this:

/override ci/prow/psi-unit-test-mac
/override ci/prow/psi-unit-test-windows

Overriding tests since team's debugging issue with Jenkins.

/lgtm

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.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 6, 2021
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 7c8398f into redhat-developer:main Jul 6, 2021
anandrkskd pushed a commit to anandrkskd/odo that referenced this pull request Jul 27, 2021
…r#4870)

* Add telemetry contextual properties if it is enabled

* update changelog

* Remove the redundant calls to IsTelemetryEnabled
@rm3l rm3l added the area/refactoring Issues or PRs related to code refactoring label Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. area/refactoring Issues or PRs related to code refactoring lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants