grafana / pyroscope-rs

Pyroscope Profiler for Rust. Profile your Rust applications.
Apache License 2.0
132 stars 22 forks source link

pyroscope.tag_wrapper and other methods cause errors if pyroscope not configured #70

Closed davidhao3300 closed 1 year ago

davidhao3300 commented 1 year ago

Describe the bug you encountered:

Repro:

import pyroscope

with pyroscope.tag_wrapper({"key": "value"}):
    print("hello world")
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })', src/lib.rs:173:64
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
Aborted (core dumped)

What did you expect to happen instead?

Not have the program crash if pyroscope is not configured, right now I have to add a wrapper on top to no-op the tag_wrapper if pyroscope is not configured.

How did you install pyroscope-rs?

pip

korniltsev commented 1 year ago

fixed here cd3c7d9

davidhao3300 commented 1 year ago

Thank you!