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

Add name argument #24

Merged
merged 5 commits into from
Nov 19, 2024
Merged

Add name argument #24

merged 5 commits into from
Nov 19, 2024

Conversation

unflxw
Copy link
Contributor

@unflxw unflxw commented Nov 18, 2024

Built on top of the changes in #23. See branch comparison.

Disallow using both cron and heartbeat

Do not allow sending both cron check-ins and heartbeat check-ins.
It is unclear that an use case for this exists, and with the new
name argument, both would default to being sent for the same
check-in, which wouldn't be meaningful for at least one of them.

Add positional name argument

Add a positional name argument that is used as the identifier
for check-ins, as the log group for logs, and as the action name
for errors.

This makes using the CLI less repetitive:

// before:
appsignal-wrap --api-key=... \
  --cron backup \
  --error backup \
  --log backup \
  -- ./backup.sh

// after:
appsignal-wrap backup --api-key=... --cron -- ./backup.sh

In addition, errors are now opt-out, and cron and heartbeat check-ins
cannot both be used in the same invocation (as one of the two would
necessarily not be correct for the same name)

When starting the child process fails and error reporting is enabled,
report the failure to start the process as an error to AppSignal.

Fixes #22.
Using `--no-log` without either `--cron` or `--heartbeat` is now a
reasonable usage if `--error` is in the mix.
Add the command that was ran as the child process as a tag in the
errors reported to AppSignal, and as an attribute on the log lines
that are sent to AppSignal.

Fixes #21.
Do not allow sending both cron check-ins and heartbeat check-ins.
It is unclear that an use case for this exists, and with the new
name argument, both would default to being sent for the same
check-in, which wouldn't be meaningful for at least one of them.
Add a positional `name` argument that is used as the identifier
for check-ins, as the log group for logs, and as the action name
for errors.

This makes using the CLI less repetitive:

```sh
// before:
appsignal-wrap --api-key=... \
  --cron backup \
  --error backup \
  --log backup \
  -- ./backup.sh

// after:
appsignal-wrap backup --api-key=... --cron -- ./backup.sh
```

In addition, errors are now opt-out, and cron and heartbeat check-ins
cannot both be used in the same invocation (as one of the two would
necessarily not be correct for the same name)
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
@unflxw unflxw merged commit f337ea3 into main Nov 19, 2024
1 check passed
unflxw added a commit that referenced this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants