Skip to content
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

systemd journal log spam #6

Open
froque opened this issue Jul 1, 2024 · 1 comment
Open

systemd journal log spam #6

froque opened this issue Jul 1, 2024 · 1 comment

Comments

@froque
Copy link
Member

froque commented Jul 1, 2024

If this service is deployed on an instance that is not spot, the systemd journal is being spammed with:

admin@i-0a7a558938a65a3ba:~$ sudo journalctl --since '2024-07-01 14:00:00' -t spotdrain 
Jul 01 14:00:22 i-0a7a558938a65a3ba spotdrain[826367]: 2024/07/01 14:00:22 WARN: Datadog env not found. Event will not have env tag
Jul 01 14:00:22 i-0a7a558938a65a3ba spotdrain[826367]: 2024/07/01 14:00:22 This is not a spot instance. Spotdrain will not run
Jul 01 14:00:22 i-0a7a558938a65a3ba spotdrain[826367]: 2024/07/01 14:00:22 Exiting ...
Jul 01 14:01:07 i-0a7a558938a65a3ba spotdrain[826625]: 2024/07/01 14:01:07 WARN: Datadog env not found. Event will not have env tag
Jul 01 14:01:07 i-0a7a558938a65a3ba spotdrain[826625]: 2024/07/01 14:01:07 This is not a spot instance. Spotdrain will not run
Jul 01 14:01:07 i-0a7a558938a65a3ba spotdrain[826625]: 2024/07/01 14:01:07 Exiting ...
Jul 01 14:01:52 i-0a7a558938a65a3ba spotdrain[826886]: 2024/07/01 14:01:52 WARN: Datadog env not found. Event will not have env tag
Jul 01 14:01:52 i-0a7a558938a65a3ba spotdrain[826886]: 2024/07/01 14:01:52 This is not a spot instance. Spotdrain will not run
Jul 01 14:01:52 i-0a7a558938a65a3ba spotdrain[826886]: 2024/07/01 14:01:52 Exiting ...
Jul 01 14:02:37 i-0a7a558938a65a3ba spotdrain[827163]: 2024/07/01 14:02:37 WARN: Datadog env not found. Event will not have env tag
Jul 01 14:02:37 i-0a7a558938a65a3ba spotdrain[827163]: 2024/07/01 14:02:37 This is not a spot instance. Spotdrain will not run
Jul 01 14:02:37 i-0a7a558938a65a3ba spotdrain[827163]: 2024/07/01 14:02:37 Exiting ...
Jul 01 14:03:23 i-0a7a558938a65a3ba spotdrain[827415]: 2024/07/01 14:03:23 WARN: Datadog env not found. Event will not have env tag
Jul 01 14:03:23 i-0a7a558938a65a3ba spotdrain[827415]: 2024/07/01 14:03:23 This is not a spot instance. Spotdrain will not run
Jul 01 14:03:23 i-0a7a558938a65a3ba spotdrain[827415]: 2024/07/01 14:03:23 Exiting ...
@froque
Copy link
Member Author

froque commented Jul 1, 2024

proposal for workaround

ExecCondition=/bin/sh -c 'test $(curl -s --fail http://169.254.169.254/latest/meta-data/instance-life-cycle) = "spot"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant