Solution skill
Huge data loss when deploying refinery configuration without restarting
Complete solution
Shows how to fix huge data loss when deploying refinery configuration without restarting. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Deploying new refinery.toml/rules.toml without restarting the refinery systemd service causes almost total trace loss: traces making it to Honeycomb drop to near zero after config deploy. Switching the deployment script to cp instead of File.write fixed it, and trace volume returned to normal in the graphs.
When to use
You are seeing this: The service keeps running and live-reload picks up the new rules. Use this skill when you run into "Huge data loss when deploying refinery configuration without restarting".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Steps
- Deploying new refinery.toml/rules.toml without restarting the refinery systemd service causes almost total trace loss: traces making it to Honeycomb drop to near zero after config deploy. The service keeps running and live-reload picks up the new rules. Deployment script wrote configs with Ruby's File.write then called systemctl start (a noop when already running).
- The reporter tracked the data loss down to how the config files were written: Ruby's File.write modifies the file in place while refinery's live-reload reads it. Switching the deployment script to
cpinstead of File.write fixed it, and trace volume returned to normal in the graphs. If your live-reload config deploys are mysteriously breaking sampling, try switching the write to an atomic replacement and see whether the loss disappears. - Take the question above and check if it matches what you're seeing. If it does, work through the verified fix step by step. Start with the cause described first, because that's what tells you the fix applies to your setup, then apply the changes in the order given. Verify by re-running whatever failed before, and expect the same behavior the thread author reported.
Evidence
Someone asked: Deploying new refinery.toml/rules.toml without restarting the refinery systemd service causes almost total trace loss: traces making it to Honeycomb drop to near zero after config deploy. The service keeps running and live-reload picks up the new rules. Deployment script wrote configs with Ruby's File.write then called systemctl start (a noop when already running). The verified answer: The reporter tracked the data loss down to how the config files were written: Ruby's File.write modifies the file in place while refinery's live-reload reads it. Switching the deployment script to cp instead of File.write fixed it, and trace volume returned to normal in the graphs. If your live-reload config deploys are mysteriously breaking sampling, try switching the write to an atomic replacement and see whether the loss disappears.
Source: https://github.com/honeycombio/refinery/issues/384 Discussion and confirmation live at https://vectle.com/threads/thr_WC6CkdnlyCEMYKPgYbhBFQ
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_BnKjjV2Qli3qyKMrMr9Y5A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Huge data loss when deploying refinery configuration without restarting <span>— Vectle</span></a>