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

Disable component based on logs profile #1141

Merged

Conversation

pfrcks
Copy link
Contributor

@pfrcks pfrcks commented Dec 19, 2023

  • Does not start fluentd and telegraf in DS if Logs and Events only profile set
  • Updates livenessprobe to check for DCR updates and restart container if the logs profile changes

@pfrcks pfrcks requested a review from a team as a code owner December 19, 2023 01:17
@controllerType = ENV['CONTROLLER_TYPE']
@containerType = ENV['CONTAINER_TYPE']
@daemonset = 'daemonset'
@dcrConfigFileLocation = '/etc/mdsd.d/config-cache/configchunks/'
Copy link
Contributor

Choose a reason for hiding this comment

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

This one seems not used

@os_type = ENV['OS_TYPE']
@controllerType = ENV['CONTROLLER_TYPE']
@containerType = ENV['CONTAINER_TYPE']
@daemonset = 'daemonset'
Copy link
Contributor

Choose a reason for hiding this comment

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

if only reference once, might not need global var

Copy link
Contributor Author

Choose a reason for hiding this comment

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

which one in specific are you referring?

Copy link
Contributor

Choose a reason for hiding this comment

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

daemonset one

touch /dev/write-to-traces

if [ "${GENEVA_LOGS_INTEGRATION}" == "true" ] || [ "${GENEVA_LOGS_INTEGRATION_SERVICE_MODE}" == "true" ]; then
checkAgentOnboardingStatus $AAD_MSI_AUTH_MODE 30
Copy link
Contributor

@wanlonghenry wanlonghenry Dec 19, 2023

Choose a reason for hiding this comment

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

line 938 and 940 is the same, the if condition can be combined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this part of code is old i just moved it up.

fluentd -c /etc/fluent/container.conf -o /var/opt/microsoft/docker-cimprov/log/fluentd.log --log-rotate-age 5 --log-rotate-size 20971520 &
if [ "$LOGS_AND_EVENTS_ONLY" != "true" ]; then
echo "*** starting fluentd v1 in daemonset"
fluentd -c /etc/fluent/container.conf -o /var/opt/microsoft/docker-cimprov/log/fluentd.log --log-rotate-age 5 --log-rotate-size 20971520 &
Copy link
Contributor

@wanlonghenry wanlonghenry Dec 19, 2023

Choose a reason for hiding this comment

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

although this is in old code, but where is this 20971520 number coming from? Is it adjustable from configmap?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i also dont know how this was picked. this part of code is quite old and its not configurable

@pfrcks pfrcks merged this pull request into develop/toggle-unused-components Dec 19, 2023
2 checks passed
@pfrcks pfrcks deleted the user/amagraw/toggle-components branch December 19, 2023 17:24
pfrcks added a commit that referenced this pull request Jan 11, 2024
* disables fluentd and telegraf in linux ds if logs and events only profile enabled

---------

Co-authored-by: Amol Agrawal <amagraw@microsoft.com>
pfrcks added a commit that referenced this pull request Feb 21, 2024
* disables fluentd and telegraf in linux ds if logs or events only streams enabled

---------

Co-authored-by: Amol Agrawal <amagraw@microsoft.com>

* address PR comments

* added telemetry

---------

Co-authored-by: Amol Agrawal <amagraw@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants