Skip to content

Commit

Permalink
Rename project to appsignal-run
Browse files Browse the repository at this point in the history
Also refer to it as a "runner" rather than a "wrapper" whenever
possible.
  • Loading branch information
unflxw committed Dec 9, 2024
1 parent 43a796c commit 8e981a4
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `appsignal-wrap` changelog
# `appsignal-run` changelog

## 0.2.1

Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "appsignal-wrap"
name = "appsignal-run"
version = "0.2.1"
edition = "2021"

Expand Down
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# `appsignal-wrap`: monitor any process with AppSignal
# `appsignal-run`: monitor any process with AppSignal

`appsignal-wrap` is a tool that allows you to monitor any process with AppSignal. You can use it to:
`appsignal-run` is a tool that allows you to monitor any process with AppSignal. You can use it to:

- Send the process' standard output and standard error as logs to AppSignal, to be able to troubleshoot issues.
- Send a start cron check-in to AppSignal when the process starts, and a finish cron check-in if it finishes successfully, to be able to track whether it runs successfully and on schedule.
- Send heartbeat check-ins to AppSignal periodically, for as long as the process is active, to be able to monitor its uptime.

## Installation

The easiest way to get `appsignal-wrap` in your machine is to run our installation one-liner:
The easiest way to get `appsignal-run` in your machine is to run our installation one-liner:

```sh
curl -sSL https://github.com/appsignal/appsignal-wrap/releases/latest/download/install.sh | sh
curl -sSL https://github.com/appsignal/appsignal-run/releases/latest/download/install.sh | sh
```

You'll need to run it with super-user privileges -- if you're not running this as root, prefix it with `sudo`.

`appsignal-wrap` is only supported for Linux and macOS, in the x86_64 (Intel) and arm64 (Apple Silicon) architectures. Linux distributions based on musl, such as Alpine, are also supported.
`appsignal-run` is only supported for Linux and macOS, in the x86_64 (Intel) and arm64 (Apple Silicon) architectures. Linux distributions based on musl, such as Alpine, are also supported.

Not a fan of `curl | sh` one-liners? Download the binary for your operating system and architecture [from our latest release](https://github.com/appsignal/appsignal-wrap/releases/latest/).
Not a fan of `curl | sh` one-liners? Download the binary for your operating system and architecture [from our latest release](https://github.com/appsignal/appsignal-run/releases/latest/).

## Usage

See `appsignal-wrap --help` for detailed information on all configuration options.
See `appsignal-run --help` for detailed information on all configuration options.

```
appsignal-wrap NAME [OPTIONS] -- COMMAND
appsignal-run NAME [OPTIONS] -- COMMAND
```

To use `appsignal-wrap`, you must provide an app-level API key. You can find the app-level API key in the [push and deploy settings](https://appsignal.com/redirect-to/app?to=api_keys) for your application.
To use `appsignal-run`, you must provide an app-level API key. You can find the app-level API key in the [push and deploy settings](https://appsignal.com/redirect-to/app?to=api_keys) for your application.

To provide the app-level API key, set it as the value for the `APPSIGNAL_APP_PUSH_API_KEY` environment variable, or pass it as the value for the `--api-key` command-line option.

Expand All @@ -38,25 +38,25 @@ Finally, you must provide a command to execute as the last argument, preceded by

### Send standard output and error as logs to AppSignal

By default, `appsignal-wrap` will send the standard output and standard error of the command it executes as logs to AppSignal:
By default, `appsignal-run` will send the standard output and standard error of the command it executes as logs to AppSignal:

```sh
appsignal-wrap sync_customers -- python ./sync_customers.py
appsignal-run sync_customers -- python ./sync_customers.py
```

The above command will execute `python ./sync_customers.py` with the AppSignal wrapper, sending its standard output and error as logs to AppSignal.
The above command will execute `python ./sync_customers.py` with the AppSignal runper, sending its standard output and error as logs to AppSignal.

You can disable sending logs entirely by using the `--no-log` command-line option, and you can use `--no-stdout` and `--no-stderr` to control whether standard output and error are used to send logs to AppSignal.

### Report failure exit codes as errors to AppSignal

By default, `appsignal-wrap` will report an error to AppSignal if the command it executes exits with a failure exit code, or if the command fails to be executed:
By default, `appsignal-run` will report an error to AppSignal if the command it executes exits with a failure exit code, or if the command fails to be executed:

```sh
appsignal-wrap sync_customers -- python ./sync_customers.py
appsignal-run sync_customers -- python ./sync_customers.py
```

The above command will attempt to execute `python ./sync_customers.py` with the AppSignal wrapper, and it will report an error to AppSignal if it fails to execute the command, or if the command ends with a failure exit code.
The above command will attempt to execute `python ./sync_customers.py` with the AppSignal runper, and it will report an error to AppSignal if it fails to execute the command, or if the command ends with a failure exit code.

You can disable sending errors entirely by using the `--no-error` command-line option.

Expand All @@ -65,7 +65,7 @@ You can disable sending errors entirely by using the `--no-error` command-line o
Use the `--heartbeat` flag to send heartbeat check-ins continuously to AppSignal, for as long as the process is running. This allows you to track that certain processes are always up:

```sh
appsignal-wrap worker --heartbeat -- bundle exec ruby ./worker.rb
appsignal-run worker --heartbeat -- bundle exec ruby ./worker.rb
```

The above command will execute `bundle exec ruby ./worker.rb`, and send heartbeat check-ins to AppSignal with the `worker` check-in identifier continuously, for as long as the process is running.
Expand All @@ -77,7 +77,7 @@ It will also send logs and report errors, as described in previous sections. To
Use the `--cron` flag to send a start cron check-in to AppSignal when the process starts, and a finish cron check-in to AppSignal if it finishes successfully. This allows you to track that certain processes are executed on schedule:

```sh
appsignal-wrap sync_customers --cron -- python ./sync_customers.py
appsignal-run sync_customers --cron -- python ./sync_customers.py
```

The above command will execute `python ./sync_customers.py`, send a start cron check-in to AppSignal with the `sync_customers` check-in identifier if it starts successfully, and send a finish cron check-in to AppSignal if it finishes with a success exit code.
Expand All @@ -90,10 +90,10 @@ It will also send logs and report errors, as described in previous sections. To

You can use the `--heartbeat` command-line option to send heartbeat check-ins (named `database` in this example) to AppSignal periodically, for as long as the database process is running. This allows you to set up alerts that will notify you if the database is no longer running.

In this example, we'll start `mysqld`, the MySQL server process, using `appsignal-wrap`:
In this example, we'll start `mysqld`, the MySQL server process, using `appsignal-run`:

```sh
appsignal-wrap database --heartbeat -- mysqld
appsignal-run database --heartbeat -- mysqld
```

This invocation can then be added to the `mysql.service` service definition:
Expand All @@ -102,13 +102,13 @@ This invocation can then be added to the `mysql.service` service definition:
# /usr/lib/systemd/system/mysql.service

[Service]
# Modify the existing ExecStart line to add `appsignal-wrap`
ExecStart=/usr/local/bin/appsignal-wrap database --heartbeat -- /usr/sbin/mysqld
# Modify the existing ExecStart line to add `appsignal-run`
ExecStart=/usr/local/bin/appsignal-run database --heartbeat -- /usr/sbin/mysqld
# Add an environment variable containing the AppSignal app-level push API key
Environment=APPSIGNAL_APP_PUSH_API_KEY=...
```

In addition to sending heartbeat check-ins, by default `appsignal-wrap` will also:
In addition to sending heartbeat check-ins, by default `appsignal-run` will also:

- Send your database process' standard output and standard error as logs to AppSignal, under the `database` group
- Report failure exit codes as errors to AppSignal, grouped under the `database` action
Expand All @@ -119,10 +119,10 @@ You can use the `--no-log` and `--no-error` command-line option to disable this

You can use the `--cron` command-line option to send cron check-ins (named `backup` in this example) to notify AppSignal when your cron job starts, and when it finishes, if and only if it finishes successfully.

In this example, we'll run `/usr/local/bin/backup.sh`, our custom backup shell script, using `appsignal-wrap`:
In this example, we'll run `/usr/local/bin/backup.sh`, our custom backup shell script, using `appsignal-run`:

```sh
appsignal-wrap backup --cron -- bash /usr/local/bin/backup.sh
appsignal-run backup --cron -- bash /usr/local/bin/backup.sh
```

This invocation can then be added to the `/etc/crontab` file:
Expand All @@ -132,10 +132,10 @@ This invocation can then be added to the `/etc/crontab` file:

APPSIGNAL_APP_PUSH_API_KEY=...

0 2 * * * appsignal-wrap backup --cron -- bash /usr/local/bin/backup.sh
0 2 * * * appsignal-run backup --cron -- bash /usr/local/bin/backup.sh
```

In addition to sending cron check-ins, by default `appsignal-wrap` will also:
In addition to sending cron check-ins, by default `appsignal-run` will also:

- Send your database process' standard output and standard error as logs to AppSignal, under the `backup` group
- Report failure exit codes as errors to AppSignal, grouped under the `backup` action
Expand Down
16 changes: 8 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
set -eu

if ! command -v curl >/dev/null; then
echo "Error: \`curl\` is required to download the \`appsignal-wrap\` binary"
echo "Error: \`curl\` is required to download the \`appsignal-run\` binary"
exit 1
fi

if ! command -v tar >/dev/null; then
echo "Error: \`tar\` is required to extract the \`appsignal-wrap\` binary"
echo "Error: \`tar\` is required to extract the \`appsignal-run\` binary"
exit 1
fi

# This value is automatically updated during the release process;
# see `script/write_version`.
LAST_RELEASE="0.2.1"

VERSION="${APPSIGNAL_WRAP_VERSION:-"$LAST_RELEASE"}"
INSTALL_FOLDER="${APPSIGNAL_WRAP_INSTALL_FOLDER:-"/usr/local/bin"}"
VERSION="${APPSIGNAL_RUN_VERSION:-"$LAST_RELEASE"}"
INSTALL_FOLDER="${APPSIGNAL_RUN_INSTALL_FOLDER:-"/usr/local/bin"}"

# Expected values are "linux" or "darwin".
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
Expand Down Expand Up @@ -84,15 +84,15 @@ else
fi

if [ "$VERSION" = "latest" ]; then
URL="https://github.com/appsignal/appsignal-wrap/releases/latest/download/$TRIPLE.tar.gz"
URL="https://github.com/appsignal/appsignal-run/releases/latest/download/$TRIPLE.tar.gz"
VERSION_FRIENDLY="latest version"
else
URL="https://github.com/appsignal/appsignal-wrap/releases/download/v$VERSION/$TRIPLE.tar.gz"
URL="https://github.com/appsignal/appsignal-run/releases/download/v$VERSION/$TRIPLE.tar.gz"
VERSION_FRIENDLY="version $VERSION"
fi

echo "Downloading $VERSION_FRIENDLY of the \`appsignal-wrap\` binary for $TRIPLE_FRIENDLY..."
echo "Downloading $VERSION_FRIENDLY of the \`appsignal-run\` binary for $TRIPLE_FRIENDLY..."

curl --progress-bar -SL "$URL" | tar -C "$INSTALL_FOLDER" -xz

echo "Done! Installed \`appsignal-wrap\` binary at \`$INSTALL_FOLDER/appsignal-wrap\`."
echo "Done! Installed \`appsignal-run\` binary at \`$INSTALL_FOLDER/appsignal-run\`."
2 changes: 1 addition & 1 deletion mono.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
language: "custom"
repo: "https://github.com/appsignal/appsignal-wrap"
repo: "https://github.com/appsignal/appsignal-run"
build:
command: "echo 'Can only build from GitHub Actions'"
publish:
Expand Down
2 changes: 1 addition & 1 deletion script/build_artifact
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "Building for \`$TARGET\`..."
echo

cross build --release --target $TARGET
tar -czvf release/$TARGET.tar.gz -C target/$TARGET/release appsignal-wrap
tar -czvf release/$TARGET.tar.gz -C target/$TARGET/release appsignal-run

echo "Done! Built release at \`release/$TARGET.tar.gz\`."
echo

0 comments on commit 8e981a4

Please sign in to comment.