summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_request.c
diff options
context:
space:
mode:
authorAva Hahn <a.hahn@f5.com>2024-11-07 14:14:28 -0800
committerAva Hahn <110854134+avahahn@users.noreply.github.com>2024-11-12 09:50:02 -0800
commit9d3dcb800aba0c036b032ccd00197712c3f5d0d9 (patch)
tree60492891a92e91e5a83040fd43a0513c0e093270 /src/nxt_http_request.c
parent8b697101818d8d2257a5421d21020c02e0802907 (diff)
downloadunit-9d3dcb800aba0c036b032ccd00197712c3f5d0d9.tar.gz
unit-9d3dcb800aba0c036b032ccd00197712c3f5d0d9.tar.bz2
otel: add build tooling to include otel code
Adds the --otel flag to the configure command and the various build time variables and checks that are needed in this flow. It also includes the nxt_otel.c and nxt_otel.h files that are needed for the rest of Unit to talk to the compiled static library that's generated from the rust crate. Signed-off-by: Ava Hahn <a.hahn@f5.com> Co-authored-by: Gabor Javorszky <g.javorszky@f5.com> Signed-off-by: Gabor Javorszky <g.javorszky@f5.com>
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r--src/nxt_http_request.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index a7e9ff69..417b5a39 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -6,6 +6,7 @@
#include <nxt_router.h>
#include <nxt_http.h>
+#include <nxt_otel.h>
static nxt_int_t nxt_http_validate_host(nxt_str_t *host, nxt_mp_t *mp);
@@ -284,6 +285,16 @@ nxt_http_request_create(nxt_task_t *task)
r->tstr_cache.var.pool = mp;
+#if (NXT_HAVE_OTEL)
+ if (nxt_otel_rs_is_init()) {
+ r->otel = nxt_mp_zget(r->mem_pool, sizeof(nxt_otel_state_t));
+ if (nxt_slow_path(r->otel == NULL)) {
+ goto fail;
+ }
+ r->otel->status = NXT_OTEL_INIT_STATE;
+ }
+#endif
+
return r;
fail: