summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_request.c
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2024-12-19 10:23:57 -0800
committerKonstantin Pavlov <thresh@nginx.com>2024-12-19 10:23:57 -0800
commitd8acad350a52a20918c46c09cb0a0f5479400923 (patch)
tree7d9c4b64daa60d3ac121743dfa3735c6fc5687a4 /src/nxt_http_request.c
parent624debcf17ea7faab01fa841bd4dcd9f308cf306 (diff)
parent27bde184dedcbf687db2f314c60c037623318a8d (diff)
downloadunit-1.34.0-1.tar.gz
unit-1.34.0-1.tar.bz2
Merge tag '1.34.0' into packaging1.34.0-1
Unit 1.34.0 release.
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r--src/nxt_http_request.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index a7e9ff69..722197b8 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:
@@ -311,6 +322,8 @@ nxt_http_request_start(nxt_task_t *task, void *obj, void *data)
r = obj;
+ NXT_OTEL_TRACE();
+
r->state = &nxt_http_request_body_state;
skcf = r->conf->socket_conf;
@@ -582,6 +595,8 @@ nxt_http_request_ready(nxt_task_t *task, void *obj, void *data)
r = obj;
action = r->conf->socket_conf->action;
+ NXT_OTEL_TRACE();
+
if (r->chunked) {
ret = nxt_http_request_chunked_transform(r);
if (nxt_slow_path(ret != NXT_OK)) {