| 760 | }; |
| 761 | |
| 762 | static 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 | |
| 795 | static int child_init(int rank) |
| 796 | { |
nothing calls this directly
no test coverage detected