Set up Sentry error collection via a feature flag
This commit is contained in:
parent
47d78d4cf4
commit
27e42f4ed5
|
@ -3,7 +3,7 @@ FROM rust:buster as builder
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
make cmake g++ gcc llvm libclang-dev clang
|
make cmake g++ gcc llvm libclang-dev clang ca-certificates
|
||||||
|
|
||||||
RUN mkdir /zebra
|
RUN mkdir /zebra
|
||||||
WORKDIR /zebra
|
WORKDIR /zebra
|
||||||
|
@ -18,7 +18,7 @@ RUN rustc -V; cargo -V; rustup -V
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN cargo test --all --release; cargo build --release
|
RUN cargo test --all --release; cargo build --release --features enable-sentry
|
||||||
|
|
||||||
|
|
||||||
# Runner image
|
# Runner image
|
||||||
|
@ -41,6 +41,8 @@ RUN cat /zebrad.toml
|
||||||
|
|
||||||
EXPOSE 3000 8233 18233
|
EXPOSE 3000 8233 18233
|
||||||
|
|
||||||
|
ENV RUST_LOG debug
|
||||||
ENV RUST_BACKTRACE full
|
ENV RUST_BACKTRACE full
|
||||||
|
ENV SENTRY_DSN https://94059ee72a44420286310990b7c614b5@o485484.ingest.sentry.io/5540918
|
||||||
|
|
||||||
CMD [ "/zebrad", "-c", "/zebrad.toml", "start" ]
|
CMD [ "/zebrad", "-c", "/zebrad.toml", "start" ]
|
||||||
|
|
|
@ -2,7 +2,7 @@ FROM rust:buster
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
make cmake g++ gcc llvm libclang-dev clang
|
make cmake g++ gcc llvm libclang-dev clang ca-certificates
|
||||||
|
|
||||||
RUN mkdir /zebra
|
RUN mkdir /zebra
|
||||||
WORKDIR /zebra
|
WORKDIR /zebra
|
||||||
|
|
|
@ -52,6 +52,7 @@ tempdir = "0.3.7"
|
||||||
zebra-test = { path = "../zebra-test" }
|
zebra-test = { path = "../zebra-test" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
enable-sentry = []
|
||||||
test_sync_to_sapling_mainnet = []
|
test_sync_to_sapling_mainnet = []
|
||||||
test_sync_to_sapling_testnet = []
|
test_sync_to_sapling_testnet = []
|
||||||
test_sync_past_sapling_mainnet = []
|
test_sync_past_sapling_mainnet = []
|
||||||
|
|
|
@ -7,15 +7,11 @@ use zebrad::application::APPLICATION;
|
||||||
|
|
||||||
/// Boot Zebrad
|
/// Boot Zebrad
|
||||||
fn main() {
|
fn main() {
|
||||||
let _guard = sentry::init((
|
if cfg!(feature = "enable-sentry") {
|
||||||
"https://94059ee72a44420286310990b7c614b5@o485484.ingest.sentry.io/5540918",
|
// The Sentry default config pulls in the DSN from the `SENTRY_DSN`
|
||||||
sentry::ClientOptions {
|
// environment variable.
|
||||||
debug: true,
|
let _guard = sentry::init(());
|
||||||
..Default::default()
|
}
|
||||||
},
|
|
||||||
));
|
|
||||||
|
|
||||||
sentry::capture_message("Hello World!", sentry::Level::Info);
|
|
||||||
|
|
||||||
abscissa_core::boot(&APPLICATION);
|
abscissa_core::boot(&APPLICATION);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue