-
Notifications
You must be signed in to change notification settings - Fork 137
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 builtin:logmonitoring.log-storage-settings to CR and reconciler #4053
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #4053 +/- ##
==========================================
- Coverage 64.69% 64.52% -0.17%
==========================================
Files 397 400 +3
Lines 26512 26754 +242
==========================================
+ Hits 17151 17263 +112
- Misses 8031 8136 +105
- Partials 1330 1355 +25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
The methods are pretty similar, that is true, but they still differ in the parameters, hence I decided to exclude the dupl linter for both methods
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.
settings are created and only created once, so works
but we are constantly (ie.: every reconcile) check if the settings exist this is a bit of an overkill
Outsourced logmon settings check to its own reconciler; Built in a check that checks if the condition, that there are already settings are outdated, to not pollute logs too much; added test
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 removed ingestRuleMatchers
from logMonitoring
section to get empty logMinitoring: {}
. Then I updated my dynakube and had to wait ~9 minutes for the default matcher to be added to the settings object on the server.
Is it OK? I guess we need to limit the number of queries we sent to the server. On the other hand it is a little bit annoying.
Just a sidenote which is important IMO: we not only removed the |
Operator currently has no good way of reacting to changes done on the Dynatrace API side. We are listening and reacting to changes in the Kubernetes cluster and need to find a way to better/quicker react to external changes. This is not something we can quickly fix here, but we'll need to properly think about options we have. For the initial feature the delay is acceptable. |
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.
By the way could you please move log.Info("start reconciling app injection")
to a line just before err = controller.injectionReconcilerBuilder(...).Reconcile(ctx)
in pkg/controllers/dynakube.controller.go ?
log.Info("start reconciling app injection")
log.Info("start reconciling LogMonitoring")
logMonitoringReconciler := controller.logMonitoringReconcilerBuilder(controller.client, controller.apiReader, dynatraceClient, dk)
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.
LGTM
Description
Ticket
With this it is possible to define ingest rule matchers in the dynakube. This configuration needs to be stored in settings (schema
builtin:logmonitoring.log-storage-settings
) in the scope of the current cluster ( =KubernetesClusterMEID
).This logic queries inside the logmonitoring reconciler all settings with this schemaID, and if there is none, we create new ones based on the defined ingest rule matchers in the dynakube (default is empty).
IF we query the settings and there are already some defined, I decided to add a condition to the dynakube that says exactly that.
How can this be tested?
Go to the Environment API v2 page in your tenant and try it out. It is in the Settings section. At first you'll need to enable
com.compuware.apm.webuiff.config.core.hierarchy.resolution.pg.k8workload.pgwlhr.feature
Deploy a dynakube with a valid logmonitoring section for example:
Wait a little bit then run in the environment API page the get query for the settings with the schema. See if it is created properly.
It should look like this:
You can then grab the objectID, delete the setting and reapply a dynakube with an empty logmonitoring section and see if default settings gets created.
That looks like this: