-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This PR introduces a new way to apply runtime detection. ## Motivation Our current language detection has the following issues: - triggering the runtime detection is done via setting the `runtimeDetailsInvalidated` property on the `InstrumentationConfigSpec` CR. Since this resource is being written to by both the sdk configs controller in instromentor, and the odiglets once they finish runtime detection, the ping-pong is venerable to race conditions and is very hard to reason about. - we trigger runtime inspection only once, possibly missing future changes in the following info: `runtimeVersion`, `envVars` which does not represent the current state of the workload. since odigos itself touches some env variables, this inconsistent can lead to really hard to find bugs. having the runtime detection up to date when new generations of the workload are applied, helps eliminate edge and advanced use-cases. - we currently have 2 CRDs to represent instrumented workload in odigos: `instrumentationconfig` and `instrumentedapplication`. They can be merged into one CRD, making the maintenance a bit simpler. - the env override mechanism currently relies on the env values that are detected from runtime inspection to patch it with odigos content. For instrumentor to allow manifest changes in the env vars, it required to know if the runtime detection is up-to-date and avoid updating old values. Capturing the workload generation against which the runtime details were calculated, allows it to ignore this data when not up to date. ## Objectives - collect runtime details for new generations of the workload (recalculate when a pod with newer generation starts) - avoid calculating runtime details if the inspection is already made for this generation before. - Do not pull in any new objects into the contoller-runtime cache, possibly blowing up the memory and cpu. - apply the change in small steps, only changing one thing at a time for smaller PRs and safer transit ## Changes - Write the new runtime inspection info into the status of the `instrumentationconfig` object. It will live alongside the existing runtime detection, and is not used anywhere in this step. We can then use it to compare the two values to gain confident in the process before start using this info. - Add 2 new controllers to `odiglet`. one for detecting the language when a pod becomes running only if the geeneration in the CR requires to calculate again. the second one is for instrumentationconfig to do the initial language detection when a new source is added in odigos. - For generation calculation, we need to get the replicaset for pods that were generated from deployments. For that we need to add the relevant RBAC permissions. the reeeplicaset is accessed only from a clientset, so not to pull all cluster replicasets into the controller-runtime cache. - enhanced the e2e tests to assert the values we expect in existing tests
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.