AppSignal v1.6.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

Link to this section Functions

Link to this function add_distribution_value(key, value, tags) View Source
Link to this function complete(transaction_resource) View Source
Link to this function data_set_boolean(resource, value) View Source
Link to this function data_set_boolean(resource, key, value) View Source
Link to this function data_set_data(resource, value) View Source
Link to this function data_set_data(resource, key, value) View Source
Link to this function data_set_float(resource, value) View Source
Link to this function data_set_float(resource, key, value) View Source
Link to this function data_set_integer(resource, value) View Source
Link to this function data_set_integer(resource, key, value) View Source
Link to this function data_set_nil(resource, key) View Source
Link to this function data_set_string(resource, value) View Source
Link to this function data_set_string(resource, key, value) View Source
Link to this function finish(transaction_resource) View Source
Link to this function finish_event(transaction_resource, name, title, body, body_format) View Source
Link to this function finish_event_data(transaction_resource, name, title, body, body_format) View Source
Link to this function increment_counter(key, count, tags) View Source
Link to this function record_event(transaction_resource, name, title, body, body_format, duration) View Source
Link to this function set_action(transaction_resource, action) View Source
Link to this function set_error(transaction_resource, error, message, backtrace) View Source
Link to this function set_gauge(key, value, tags) View Source
Link to this function set_meta_data(transaction_resource, key, value) View Source
Link to this function set_queue_start(transaction_resource, start) View Source
Link to this function set_sample_data(transaction_resource, key, payload) View Source
Link to this function start_event(transaction_resource) View Source
Link to this function start_transaction(transaction_id, namespace) View Source