feat: Add APM to DatadogInstrumentation CRD#2984
feat: Add APM to DatadogInstrumentation CRD#2984betterengineering wants to merge 1 commit intomainfrom
Conversation
This commit adds the schema required to utilize the DatadogInstrumentation CRD for APM.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ed1d9455e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| config: | ||
| description: Config defines the Datadog instrumentation configuration to apply to the target workload. | ||
| properties: | ||
| apm: |
There was a problem hiding this comment.
Update the OLM bundle CRD with the APM schema
This adds spec.config.apm to the generated CRD under config/crd, but the stored OLM bundle CRD was not regenerated: bundle/manifests/datadoghq.com_datadoginstrumentations.yaml still has only config.properties.checks and no apm/ddTraceConfigs entry (verified with rg ddTraceConfigs bundle/manifests/datadoghq.com_datadoginstrumentations.yaml). Because bundle.Dockerfile copies bundle/manifests into the published bundle, installations through the operator bundle will install the old CRD and Kubernetes will prune spec.config.apm, so the Cluster Agent will never see the APM settings for those users.
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2984 +/- ##
==========================================
+ Coverage 41.39% 42.05% +0.65%
==========================================
Files 331 331
Lines 28911 29724 +813
==========================================
+ Hits 11969 12499 +530
- Misses 16086 16323 +237
- Partials 856 902 +46
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
🎯 Code Coverage (details) 🔗 Commit SHA: 1ed1d94 | Docs | Datadog PR Page | Give us feedback! |
| type DatadogInstrumentationAPMConfig struct { | ||
| // Enabled turns on APM via Single Step Instrumentation to automatically install the Datadog SDKs for supported | ||
| // languages with no additional configuration required. | ||
| Enabled bool `json:"enabled,omitempty"` |
There was a problem hiding this comment.
Is an enabled section needed? The APM config already implies this based if the section is added (enabled) or removed (disabled).
There was a problem hiding this comment.
The other two fields are optional and have default values. So I thought it would be weird if we did something like:
config:
apm: {}The current design looks like this, and it's what most users would need to do:
config:
apm:
enabled: trueI agree though, this case feels redundent:
config:
apm:
enabled: true
ddTraceVersions:
python: "3"Do you think there is a way around this?
There was a problem hiding this comment.
Ahh I see. I can't think of anything better to be honest and apm: {} is definitely not the right choice. I'm good to keep enabled. 👍🏽
What does this PR do?
This commit adds the schema required to utilize the
DatadogInstrumentationCRD for APM. Relates to #2962Example
Motivation
Two relevant RFCs:
Additional Notes
All this adds is the schema. The consumer of this schema is the Datadog Cluster Agent.
Describe your test plan
Ran:
Also verified
make generate && make manifestsproduces no additional diff after generated files are up to date.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel