MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / mod_init

Function mod_init

modules/opentelemetry/opentelemetry.cpp:762–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760};
761
762static int mod_init(void)
763{
764 if (!otel_enabled) {
765 otel_enabled = (int *)shm_malloc(sizeof(*otel_enabled));
766 if (!otel_enabled) {
767 LM_ERR("no shm memory for opentelemetry enable\n");
768 return -1;
769 }
770 *otel_enabled = otel_enabled_cfg;
771 }
772
773 if (enable_proc)
774 otel_trace_handlers.accepted_data_types |= PROFILING_DATA_TYPE_PROC;
775
776 if (register_profiling_handler(&otel_trace_handlers) != 0) {
777 LM_ERR("failed to register profiling hooks\n");
778 return -1;
779 }
780
781 if (!otel_is_enabled()) {
782 LM_INFO("opentelemetry module disabled\n");
783 }
784
785 if (otel_service_name.s)
786 otel_service_name.len = strlen(otel_service_name.s);
787 if (otel_exporter_endpoint.s)
788 otel_exporter_endpoint.len = strlen(otel_exporter_endpoint.s);
789
790 /* no provider init here; each process initializes on demand */
791
792 return 0;
793}
794
795static int child_init(int rank)
796{

Callers

nothing calls this directly

Calls 3

shm_mallocFunction · 0.85
otel_is_enabledFunction · 0.85

Tested by

no test coverage detected