Skip to content

Commit

Permalink
Submit root span data when service/env/version ini is changed
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
  • Loading branch information
bwoebi committed Oct 11, 2024
1 parent abcf76c commit bce0358
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ext/ddtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ static inline bool dd_alter_prop(size_t prop_offset, zval *old_value, zval *new_
pspan = pspan->parent;
}

if (DDTRACE_G(request_initialized)) {
ddtrace_sidecar_submit_root_span_data_direct(NULL);
}

return true;
}

Expand Down Expand Up @@ -1694,6 +1698,8 @@ static PHP_RSHUTDOWN_FUNCTION(ddtrace) {
}

dd_finalize_sidecar_lifecycle();
DDTRACE_G(request_initialized) = false;

ddtrace_telemetry_rshutdown();
ddtrace_sidecar_rshutdown();

Expand Down Expand Up @@ -1725,7 +1731,6 @@ zend_result ddtrace_post_deactivate(void) {
// zai config may be accessed indirectly via other modules RSHUTDOWN, so delay this until the last possible time
zai_config_rshutdown();

DDTRACE_G(request_initialized) = false;
return SUCCESS;
}

Expand Down
1 change: 1 addition & 0 deletions ext/sidecar.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ void ddtrace_sidecar_submit_root_span_data(void);
void ddtrace_sidecar_push_tag(ddog_Vec_Tag *vec, ddog_CharSlice key, ddog_CharSlice value);
void ddtrace_sidecar_push_tags(ddog_Vec_Tag *vec, zval *tags);
ddog_Endpoint *ddtrace_sidecar_agent_endpoint(void);
void ddtrace_sidecar_submit_root_span_data_direct(ddtrace_root_span_data *root);

void ddtrace_sidecar_send_debugger_data(ddog_Vec_DebuggerPayload payloads);
void ddtrace_sidecar_send_debugger_datum(ddog_DebuggerPayload *payload);
Expand Down
2 changes: 1 addition & 1 deletion libdatadog
Submodule libdatadog updated 0 files

0 comments on commit bce0358

Please sign in to comment.