
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
@polarsignals/custom-labels
Advanced tools
This library is experimental; both the API and ABI are subject to change.
This library maintains a thread-local mapping of keys to values. Each key and value is an arbitrary byte array.
The core goal of the design is that the map for a thread may be validly read from that thread whenever user code is stopped; for example, in a signal handler, a debugger, or an eBPF program. This should work even if the thread happens to be suspended in the middle of one of the functions of this library.
The intended purpose is to store custom labels for annotating stack traces
during profiling; for example, client code might set the label customer_id
whenever it is processing a request for a particular customer,
and a CPU profiler might then record that value whenever it interrupts the program
to collect a stack trace.
The library exposes a C API (in customlabels.h
), a Rust API
documented here, and an ABI for reading
by external code (e.g., profilers or debuggers).
Language: any language that can link against C code.
Platform: Linux on x86-64 or aarch64 (64-bit ARM).
Depend on the custom-labels
crate as both a standard dependency and a build dependency. For example, in your Cargo.toml
:
[dependencies]
custom-labels = "0.4"
[build-dependencies]
custom-labels = "0.4"
Then add the following line to your executable's build.rs
:
#[cfg(not(target_os="macos"))]
custom_labels::build::emit_build_instructions();
For a release build:
CFLAGS="-O2" make
For a debug build:
CFLAGS="-O0 -g" make
Either will produce a library called libcustomlabels.so
in the repository root,
which should be linked against during your build process.
Ensure that customlabels.c
is linked into your executable and that customlabels.h
is available
in the include path for any source file from which you want to use custom labels. The details of
this will depend on your build system.
For profiler authors, the ABI is v1 of the Custom Labels ABI described here.
FAQs
test
The npm package @polarsignals/custom-labels receives a total of 13,919 weekly downloads. As such, @polarsignals/custom-labels popularity was classified as popular.
We found that @polarsignals/custom-labels demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.