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

Use oneAgent.hostGroup in ApplicationMonitoring mode (release-1.0) #2776

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

aorcholski
Copy link
Contributor

PR main branch

Description

oneAgent.hostGroup parameter is passed to code modules in case of application monitoring mode. In such a case standalone logic adds hostGroup field to the ProcessModuleConfig configuration and additionally standalone dynatrace client applies hostGroup to requests which can use it (getProcessModuleConfig).

oneAgent.hostGroup parameter has higher priority then --set-host-group argument for all related deployment modes (having args field). Validation webhook print a warning every time the argument is used.

How can this be tested?

hostGroup is used:

  1. Deploy ApplicationMonitoring dynakube
  oneAgent:
    hostGroup: appmongroup
    applicationMonitoring:
      useCSIDriver: false/true
  • check init secret in a monitored namespace
    kubectl -n <namespace> get -o json secret/dynatrace-dynakube-config|jq -r '.data.config'|base64 -d|jq -r '.hostGroup'
  • check ruxitagentproc.conf on the app pod
    kubectl -n <namespace> exec -t deployment.apps/<appname>l -- /bin/sh -c "cat /opt/dynatrace/oneagent-paas/agent/conf/ruxitagentproc.conf | grep hostGroup"

No changes in other modes:

  1. Deploy ClassicFullStack dynakube
  oneAgent:
    hostGroup: cngroupnew
    cloudNativeFullStack:
      args:
      - "--set-host-group=cngroupold"
  • check --set-host-group value used in oneagent pods
    kubectl -n dynatrace get -o json daemonset.apps/dynakube-oneagent | jq -r '.spec.template.spec.containers[0].args | grep set-host-group'
  • check init secret in a monitored namespace
    kubectl -n <namespace> get -o json secret/dynatrace-dynakube-config|jq -r '.data.config'|base64 -d|jq -r '.hostGroup'
  • check ruxitagentproc.conf on the app pod
    kubectl -n <namespace> exec -t deployment.apps/<appname>l -- /bin/sh -c "cat /opt/dynatrace/oneagent-paas/agent/conf/ruxitagentproc.conf | grep hostGroup"
  1. Deploy CloudNativeFullStack dynakube
  oneAgent:
    hostGroup: cfsgroupnew
    classicFullStack:
      args:
      - "--set-host-group=cfsgroupold"
  • check --set-host-group value used in oneagent pods
    kubectl -n dynatrace get -o json daemonset.apps/dynakube-oneagent | jq -r '.spec.template.spec.containers[0].args | grep set-host-group'
  • check init secret in a monitored namespace
    kubectl -n <namespace> get -o json secret/dynatrace-dynakube-config|jq -r '.data.config'|base64 -d|jq -r '.hostGroup'
  • check ruxitagentproc.conf on the app pod
    kubectl -n <namespace> exec -t deployment.apps/<appname>l -- /bin/sh -c "cat /opt/dynatrace/oneagent-paas/agent/conf/ruxitagentproc.conf | grep hostGroup"

Checklist

  • Unit tests have been updated/added
  • PR is labeled accordingly with a single label
  • I have read and understood the contribution guidelines

@aorcholski aorcholski requested a review from a team as a code owner February 20, 2024 10:19
@codecov-commenter
Copy link

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (df8dfb0) 67.86% compared to head (40522d6) 67.86%.

Files Patch % Lines
pkg/api/v1beta1/dynakube/properties.go 69.23% 4 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@               Coverage Diff               @@
##           release-1.0    #2776      +/-   ##
===============================================
- Coverage        67.86%   67.86%   -0.01%     
===============================================
  Files              250      250              
  Lines            13655    13667      +12     
===============================================
+ Hits              9267     9275       +8     
- Misses            3581     3585       +4     
  Partials           807      807              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aorcholski aorcholski merged commit 087cccf into release-1.0 Feb 20, 2024
15 checks passed
@aorcholski aorcholski deleted the feature/appmon-hostgroup-1.0 branch February 20, 2024 13:56
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.

None yet

3 participants