Skip to content

Commit

Permalink
review nits (to be squashed)
Browse files Browse the repository at this point in the history
Signed-off-by: Ava Hahn <[email protected]>
  • Loading branch information
avahahn committed Sep 17, 2024
1 parent 675ce16 commit 473bb10
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 97 deletions.
29 changes: 14 additions & 15 deletions src/nxt_conf_validation.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,19 +311,19 @@ static nxt_conf_vldt_object_t nxt_conf_vldt_root_members[] = {
#if (NXT_HAVE_OTEL)
static nxt_conf_vldt_object_t nxt_conf_vldt_otel_members[] = {
{
.name = nxt_string("endpoint"),
.type = NXT_CONF_VLDT_STRING,
.validator = nxt_otel_validate_endpoint,
.flags = NXT_CONF_VLDT_REQUIRED
}, {
.name = nxt_string("batch_size"),
.type = NXT_CONF_VLDT_INTEGER,
.validator = nxt_otel_validate_batch_size,
}, {
.name = nxt_string("protocol"),
.type = NXT_CONF_VLDT_STRING,
.validator = nxt_otel_validate_protocol,
.flags = NXT_CONF_VLDT_REQUIRED
.name = nxt_string("endpoint"),
.type = NXT_CONF_VLDT_STRING,
.validator = nxt_otel_validate_endpoint,
.flags = NXT_CONF_VLDT_REQUIRED
}, {
.name = nxt_string("batch_size"),
.type = NXT_CONF_VLDT_INTEGER,
.validator = nxt_otel_validate_batch_size,
}, {
.name = nxt_string("protocol"),
.type = NXT_CONF_VLDT_STRING,
.validator = nxt_otel_validate_protocol,
.flags = NXT_CONF_VLDT_REQUIRED
},

NXT_CONF_VLDT_END
Expand Down Expand Up @@ -356,7 +356,6 @@ static nxt_conf_vldt_object_t nxt_conf_vldt_setting_members[] = {
#endif
},


NXT_CONF_VLDT_END
};

Expand Down Expand Up @@ -914,7 +913,7 @@ static nxt_conf_vldt_object_t nxt_conf_vldt_python_target_members[] = {
{
.name = nxt_string("module"),
.type = NXT_CONF_VLDT_STRING,
.flags = NXT_CONF_VLDT_REQUIRED
.flags = NXT_CONF_VLDT_REQUIRED,
}, {
.name = nxt_string("callable"),
.type = NXT_CONF_VLDT_STRING,
Expand Down
2 changes: 1 addition & 1 deletion src/nxt_h1proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,6 @@ nxt_h1p_request_discard(nxt_task_t *task, nxt_http_request_t *r,
nxt_sendbuf_drain(task, wq, last);

#if (NXT_HAVE_OTEL)
// TODO Phase 2: Test
nxt_otel_test_and_call_state(task, r);
#endif
}
Expand Down Expand Up @@ -1839,6 +1838,7 @@ nxt_h1p_conn_sent(nxt_task_t *task, void *obj, void *data)
nxt_event_engine_t *engine;
#if (NXT_HAVE_OTEL)
nxt_http_request_t *r;

r = ((nxt_h1proto_t *) data)->request;
nxt_otel_test_and_call_state(task, r);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/nxt_http_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ nxt_http_request_create(nxt_task_t *task)
#if (NXT_HAVE_OTEL)
if (nxt_otel_is_init()) {
r->otel = nxt_mp_zget(r->mem_pool, sizeof(nxt_otel_state_t));
if (!r->otel) {
if (r->otel == NULL) {
goto fail;
}
r->otel->status = NXT_OTEL_INIT_STATE;
Expand Down
Loading

0 comments on commit 473bb10

Please sign in to comment.