Skip to content
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

refactor: To ensure telemetry is only enabled when both conditions are met. #393

Closed
wants to merge 5 commits into from

Conversation

Carpe-Wang
Copy link

@Carpe-Wang Carpe-Wang commented May 17, 2024

Description

About #339. Based on my understanding of this issue, to ensure telemetry is only enabled when both conditions are met, thus avoiding unnecessary or incorrect configuration leading to resource waste or incorrect data collection, I believe we need to add a check for enableTelemetry being true in the if applicationInsightsID != ""{ and I want to change to if applicationInsightsID != "" && enableTelemetry {. But I'm not sure if my understanding is correct.

Related Issue

If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request.

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Screenshots (if applicable) or Testing Completed

Please add any relevant screenshots or GIFs to showcase the changes made.

Additional Notes

Add any additional notes or context about the pull request here.


Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

@Carpe-Wang Carpe-Wang requested a review from a team as a code owner May 17, 2024 14:13
@Carpe-Wang Carpe-Wang requested review from jimassa and matmerr May 17, 2024 14:13
@rbtr
Copy link
Collaborator

rbtr commented May 17, 2024

@Carpe-Wang this seems correct, can you test it and confirm the behavior is what we want?
Also need you to comment on #339 if you want it assigned to you 🙂

@Carpe-Wang
Copy link
Author

@microsoft-github-policy-service agree

@Carpe-Wang
Copy link
Author

@Carpe-Wang this seems correct, can you test it and confirm the behavior is what we want? Also need you to comment on #339 if you want it assigned to you 🙂

hey @rbtr, I had comment on #339, and I noticed #339 had assigned to me. I make some new commits about test the unit test successfully.

@nddq nddq linked an issue May 20, 2024 that may be closed by this pull request
@Carpe-Wang
Copy link
Author

Hey, I have a question about how to execute the workflows whose status is always Expected — Waiting for status to be reported.

@rbtr
Copy link
Collaborator

rbtr commented May 21, 2024

Only project maintainers can trigger the workflows

@Carpe-Wang Carpe-Wang changed the title To ensure telemetry is only enabled when both conditions are met. refactor : To ensure telemetry is only enabled when both conditions are met. May 23, 2024
@rbtr rbtr changed the title refactor : To ensure telemetry is only enabled when both conditions are met. refactor: To ensure telemetry is only enabled when both conditions are met. May 23, 2024
init/retina/main_linux.go Outdated Show resolved Hide resolved
init/retina/main_linux.go Outdated Show resolved Hide resolved
Copy link
Contributor

@nddq nddq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Carpe-Wang can you sign all your commits please, thanks 🙂

@Carpe-Wang
Copy link
Author

@Carpe-Wang can you sign all your commits please, thanks 🙂

@nddq I have signed all my commits. I hope they meet your expectations. Please check them.

nddq
nddq previously approved these changes Jun 9, 2024
@nddq
Copy link
Contributor

nddq commented Jun 9, 2024

@Carpe-Wang seems like you missed a few commits

@Carpe-Wang
Copy link
Author

@Carpe-Wang seems like you missed a few commits
@nddq yeah, those commits were unverified because the email in my local Git configuration didn't match the email for GPG. So, I deleted them and updated the email in my local Git configuration. However, the final code is consistent.

@nddq
Copy link
Contributor

nddq commented Jun 10, 2024

@Carpe-Wang seems like you missed a few commits
@nddq yeah, those commits were unverified because the email in my local Git configuration didn't match the email for GPG. So, I deleted them and updated the email in my local Git configuration. However, the final code is consistent.

So what I meant is that we are looking for the Verified check across all commits, as you can see, some of them are missing that
image
My suggestion is that you could squash all the previous commit into a single one, sign it and the force push it to this branch 🙂 Let me know if you have any issue

@Carpe-Wang Carpe-Wang force-pushed the main branch 4 times, most recently from eaf88d6 to cb11c07 Compare June 11, 2024 04:57
@nddq nddq enabled auto-merge June 11, 2024 15:47
nddq
nddq previously approved these changes Jun 11, 2024
@nddq
Copy link
Contributor

nddq commented Jun 18, 2024

@Carpe-Wang there are still unsigned commits, so we can't merge this yet 🥲

@rbtr
Copy link
Collaborator

rbtr commented Jun 18, 2024

@Carpe-Wang as mentioned previously, all commits in a PR must be signed. As long as you have commits without a (Verified) badge on this page, this will not be mergeable due to signing policy. Updating the branch from main won't change this.
The easy way to resolve this is to squash the 21 commits currently on your branch down to a single one. Do this via interactive rebase, eg: git rebase -i HEAD~21, leave the first one as "pick", change all the rest to "squash", and adjust the commit message appropriately. Then force push the branch.

auto-merge was automatically disabled June 19, 2024 05:38

Head branch was pushed to by a user without write access

@Carpe-Wang
Copy link
Author

@nddq Sorry, I've been a bit busy these days and didn't have enough time to handle it. I just did a reset --hard now. If this doesn't meet your merge requirements, I'll make the changes again.

@Carpe-Wang
Copy link
Author

@rbtr thank you for your comment. I haven't used rebase before. I tried a few times without much success because when I pushed, there were many commits that weren't mine. So, I opted to use reset --hard directly. Thank you for your guidance.

@nddq nddq enabled auto-merge June 19, 2024 14:02
@nddq nddq added this pull request to the merge queue Jun 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 19, 2024
@nddq nddq added this pull request to the merge queue Jun 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 19, 2024
}

// Define a command-line flag "config" with a default value and parse the flags, then create a logger with a name and version.
configPath := flag.String("config", "/retina/config/config.yaml", "path to the config file")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Carpe-Wang looks like you need to pass in the path to the config via arguments to the init-container as well. Please refer to how we are currently doing it for the agent's main container
image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

I added the following section to the relevant file:

args:
  - --config=/retina/config/config.yaml

Does this meet your expectation?"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should work

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, I had push the newest commit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops i forgot to mention, you will also have to mount the path the config file like we are doing with the main container. Thanks for the prompt response!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nddq I change the file according to your comment. Please review it.

Copy link

This PR will be closed in 7 days due to inactivity.

@github-actions github-actions bot added the meta/waiting-for-author Blocked and waiting on the author label Jul 27, 2024
Copy link

github-actions bot commented Aug 3, 2024

Pull request closed due to inactivity.

@github-actions github-actions bot closed this Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta/waiting-for-author Blocked and waiting on the author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ideally agent's init container enables telemetry based on ConfigMap flag
3 participants