AppSignal v1.9.3 Appsignal.Nif View Source
It's a NIF! Oh no!
While people generally think NIFs are a bad idea, the overhead of this particular NIF is low. The C code that the NIF calls has been designed to be as fast as possible and to do as little as possible on the calling thread.
Internally, the AppSignal NIF works as follows: it fork/execs a separate agent process, to which the NIF sends its data (protobuf) over a unix socket. This agent process (which is a separate unix process!) then takes care of sending the data the server periodically.
The C library that the NIF interfaces with, is specifically written with performance in mind and is very robust and battle tested; written in Rust and it is the same code that the Ruby AppSignal Gem uses, which is used in production in thousands of sites.
While doing native Elixir protobufs to communicate directly with this agent makes more sense from a BEAM standpoint, from a maintainability point the NIF choice is more logical because AppSignal is planning more language integrations in the future (PHP, Java) which all will use this same C library and agent process.
Link to this section Summary
Functions
Callback implementation for Appsignal.NifBehaviour.loaded?/0
Callback implementation for Appsignal.NifBehaviour.running_in_container?/0
Link to this section Functions
add_distribution_value(key, value, tags) View Source
agent_version() View Source
complete(transaction_resource) View Source
data_list_new() View Source
data_map_new() View Source
data_set_boolean(resource, value) View Source
data_set_boolean(resource, key, value) View Source
data_set_data(resource, value) View Source
data_set_data(resource, key, value) View Source
data_set_float(resource, value) View Source
data_set_float(resource, key, value) View Source
data_set_integer(resource, value) View Source
data_set_integer(resource, key, value) View Source
data_set_nil(resource) View Source
data_set_nil(resource, key) View Source
data_set_string(resource, value) View Source
data_set_string(resource, key, value) View Source
diagnose() View Source
env_clear() View Source
env_delete(key) View Source
env_get(key) View Source
env_put(key, value) View Source
finish(transaction_resource) View Source
finish_event(transaction_resource, name, title, body, body_format) View Source
finish_event_data(transaction_resource, name, title, body, body_format) View Source
increment_counter(key, count, tags) View Source
init() View Source
loaded?() View Source
Callback implementation for Appsignal.NifBehaviour.loaded?/0
.
record_event(transaction_resource, name, title, body, body_format, duration) View Source
running_in_container?() View Source
Callback implementation for Appsignal.NifBehaviour.running_in_container?/0
.