-
-
Notifications
You must be signed in to change notification settings - Fork 64
feat: migrate from deadmanswitch to Sentry monitors
#585
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
813055a
feat: replace dms with sentry monitors
JacobCoffee ec0cda0
chore: add more helpful debugging if error
JacobCoffee e86175f
fix: remove fqdn separators, use key and ids instead of names
JacobCoffee 602a03d
feat: use script to run highstate if sentry key present
JacobCoffee b9da2e2
chore: less of a git diff
JacobCoffee cd93ea1
fix: dont use local
JacobCoffee 0bca8db
chore: less of a git diff
JacobCoffee b62711a
chore: undo (inactive) token commit
JacobCoffee 62984d3
docs: notate what scopes are needed for monitor upserts
JacobCoffee 61eb5d6
fix: resolve issue with duplicate monitor creation by locking file
JacobCoffee cb11aa2
fix: the script needs curl but its not on vagrant
JacobCoffee af7142a
Merge branch 'main' into sentry-monitors
JacobCoffee 1456a65
feat: simplify
JacobCoffee 4351d0e
chore: uv run tox -e lint
JacobCoffee 130b807
feat: use tempalte instead of making 4 salt-calls!
JacobCoffee 034cb26
chore: removing nesting in pillar data
JacobCoffee e881dd8
Merge branch 'main' into sentry-monitors
JacobCoffee 83d93cf
fix: make sure we dont run sentry things if disabled
JacobCoffee fc7c48f
chore: clean up DMS
JacobCoffee 4003034
docs: add sentry
JacobCoffee 9a736fe
fix(docs): trim wording
JacobCoffee 9368b07
chore: turn off secrets.sentry if in dev by default, add note
JacobCoffee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| secrets: | ||
JacobCoffee marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| sentry: | ||
| project_id: 0123456789012345 | ||
| project_key: deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef | ||
| ingest_url: deadbeef.ingest | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #!/bin/bash | ||
|
|
||
| MINION_ID=$(salt-call --local grains.get id --out=newline_values_only) | ||
JacobCoffee marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| SENTRY_INGEST_URL=$(salt-call pillar.get secrets:sentry:ingest_url --out=newline_values_only) | ||
| SENTRY_PROJECT_ID=$(salt-call pillar.get secrets:sentry:project_id --out=newline_values_only) | ||
| SENTRY_PROJECT_KEY=$(salt-call pillar.get secrets:sentry:project_key --out=newline_values_only) | ||
|
|
||
| MONITOR_SLUG="salt-highstate-${MINION_ID//./}" | ||
|
|
||
| if [ -n "$SENTRY_INGEST_URL" ] && [ -n "$SENTRY_PROJECT_ID" ] && [ -n "$SENTRY_PROJECT_KEY" ]; then | ||
| curl -X POST "https://${SENTRY_INGEST_URL}/api/${SENTRY_PROJECT_ID}/cron/${MONITOR_SLUG}/${SENTRY_PROJECT_KEY}/" \ | ||
| --header 'Content-Type: application/json' \ | ||
| --data-raw '{"monitor_config": {"schedule": {"type": "crontab", "value": "*/15 * * * *"}, "checkin_margin": 5, "max_runtime": 30, "timezone": "UTC"}, "status": "in_progress"}' &> /dev/null | ||
|
|
||
| "$@" | ||
| COMMAND_EXIT=$? | ||
|
|
||
| if [ $COMMAND_EXIT -eq 0 ]; then | ||
| curl "https://${SENTRY_INGEST_URL}/api/${SENTRY_PROJECT_ID}/cron/${MONITOR_SLUG}/${SENTRY_PROJECT_KEY}/?status=ok" &> /dev/null | ||
| else | ||
| curl "https://${SENTRY_INGEST_URL}/api/${SENTRY_PROJECT_ID}/cron/${MONITOR_SLUG}/${SENTRY_PROJECT_KEY}/?status=error" &> /dev/null | ||
| fi | ||
|
|
||
| exit $COMMAND_EXIT | ||
| else | ||
| exit 1 | ||
| fi | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.