Fix telemetry submission - #305
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 915e155 | Docs | View more details | Give us feedback! |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec85fd54e8
ℹ️ 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".
| from dda.telemetry.constants import DaemonEnvVars | ||
| from dda.utils.process import EnvVars | ||
|
|
||
| self.__storage_dir.ensure_dir() |
There was a problem hiding this comment.
Handle cache creation failures without aborting commands
When the configured cache parent is unavailable or read-only—for example, when DDA_CACHE_DIR points to a missing mount—ensure_dir() raises synchronously from the root CLI callback. Because app.telemetry.watch() runs before normal subcommands, this makes optional telemetry initialization abort commands that do not otherwise need the cache; previously the directory-related failure occurred only in the detached telemetry daemon. Please keep directory creation best-effort so telemetry storage failures cannot prevent the requested command from running.
Useful? React with 👍 / 👎.
### Motivation I came across this while working on DataDog/datadog-agent-dev#305
ec85fd5 to
915e155
Compare
Telemetry submission does not work for new users of developer environments and existing users who happen to clear their cache volume.
The daemon's communication directory disappears because https://github.com/DataDog/datadog-agent-buildimages/blob/c4de8da8719b26238f6d238c88c6924b60faf1b2/dev-envs/linux/finalize.sh#L21 clears the cache. Startup then runs
dda self telemetry enable, but consent only removes an existing dissent file and does not recreate the directory. Only dissent currently ensures the parent exists.