Application info
Every error report, log line and trace tells Flare which app sent it, which version of your code was running, and on which machine. Most of this comes from flareapp::config!(), which #[flareapp::main] calls for you.
Name and version
Flare uses the name and version from the Cargo.toml of your crate, sent as service.name and service.version. Building your own config? Start from flareapp::config!() so you keep them:
Rust
fn flare_config() -> flareapp::Config {
flareapp::config!().environment("production")
}
#[flareapp::main(config = flare_config)]
fn main() {}
Config::new() can't read your Cargo.toml, so a config that starts there sends a name like unknown_service:my-app, after your executable, no version and no git commit. To use a different name or version, set them yourself:
Rust
flareapp::config!()
.service_name("billing-worker")
.service_version("2.4.1")
Environment
Set the environment with FLARE_ENVIRONMENT, or in code:
Rust
#[flareapp::main(environment = "staging")]
fn main() {}
Use it to keep production, staging and the rest apart in Flare.
Git commit
Flare shows the git commit your app was built from, and uses its first 7 characters as the version of your app. flareapp::config!() reads the commit while your app compiles, from the first of these environment variables that's set:
| Variable | Set by |
|---|---|
FLARE_GIT_HASH |
you |
GITHUB_SHA |
GitHub Actions |
CI_COMMIT_SHA |
GitLab CI |
CIRCLE_SHA1 |
CircleCI |
BITBUCKET_COMMIT |
Bitbucket Pipelines |
On those four CI systems, there's nothing to set up. Anywhere else, set FLARE_GIT_HASH for the cargo build. The value gets baked into your binary, so the server that runs it doesn't need git or your source code.
A Docker build can't see the variables of your CI, so pass the commit in as a build argument:
Dockerfile
ARG FLARE_GIT_HASH
RUN cargo build --release
Terminal
docker build --build-arg FLARE_GIT_HASH="$(git rev-parse HEAD)" .
The ARG line must come before cargo build, because that's when the commit is read.
When none of these variables are set, Flare tries one more thing when your app starts: it runs git in the folder of your Cargo.toml, and reads the commit, the branch and the newest tag. That works when you run your app from its source folder, like on your own machine, but not on a typical production server.
You can also set the commit in code with Config::git_hash. A blank hash removes it, and Flare then tries git when your app starts, as described above.
Host details
Every report, log line and trace carries the name of the host, its CPU architecture and the type of its operating system, like linux. Turn on the host-details feature to also send:
- The IP address of the host, like
10.0.3.17. That's the address of the network interface behind the default route. - The name and version of the operating system, like
Ubuntuand24.04, and its full description, likeUbuntu 24.04.1 LTS.
Terminal
cargo add flareapp --features host-details
Flare looks these up once, when it starts, without any network traffic. Anything it can't find is left out.
Runtime and framework
Flare also sends the version of the Rust compiler that built your app, and the command line it runs with. With the axum or Actix Web middleware, it adds the name of the framework as well. You don't have to do anything for these.
Read more
- What a report contains: everything Flare sends with an error.
- Configuration: every setting, including
service_nameandgit_hash.