Skip to content

Commit 1aaebd8

Browse files
authored
Move env and version from meta to span properties (#2665)
As a fallback, direct assignments to $span->meta["env"] (or version) do still take precedence over the new properties. This was deprecated, and will be eventually removed. Side note: There were tests for DD_TAGS vs DD_ENV and DD_VERSION. These tests started failing. I elected to remove the tests instead of adding special handling in ddtrace_set_global_span_properties() (if key equals env and property_env non-empty, then ignore). These tests came from a 4 year old migration, at which time these tags had to be set via DD_TAGS, thus prioritizing DD_ENV and DD_VERSION explicitly made sense. By now it would just be a waste of CPU cycles to check that. Signed-off-by: Bob Weinand <[email protected]>
1 parent 3d5be50 commit 1aaebd8

25 files changed

Lines changed: 218 additions & 286 deletions

ext/compat_string.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,5 @@ zend_string *ddtrace_convert_to_str(zval *op) {
7878

7979
void ddtrace_convert_to_string(zval *dst, zval *src) {
8080
zend_string *str = ddtrace_convert_to_str(src);
81-
if (str) {
82-
ZVAL_STR(dst, str);
83-
} else {
84-
ZVAL_NULL(dst);
85-
}
81+
ZVAL_STR(dst, str);
8682
}

ext/compatibility.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,8 @@ static zend_always_inline zend_result zend_call_function_with_return_value(zend_
446446

447447
#if PHP_VERSION_ID < 80400
448448
#define zend_parse_arg_func(arg, dest_fci, dest_fcc, check_null, error, free_trampoline) zend_parse_arg_func(arg, dest_fci, dest_fcc, check_null, error)
449-
#endif
450-
451-
#if PHP_VERSION_ID < 80400
452-
#define zend_parse_arg_func(arg, dest_fci, dest_fcc, check_null, error, free_trampoline) zend_parse_arg_func(arg, dest_fci, dest_fcc, check_null, error)
449+
#undef ZEND_RAW_FENTRY
450+
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags, ...) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
453451
#endif
454452

455453
#endif // DD_COMPATIBILITY_H

ext/configuration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ enum ddtrace_sampling_rules_format {
9494
CONFIG(BOOL, DD_AUTOFINISH_SPANS, "false") \
9595
CONFIG(BOOL, DD_TRACE_URL_AS_RESOURCE_NAMES_ENABLED, "true") \
9696
CONFIG(BOOL, DD_HTTP_SERVER_ROUTE_BASED_NAMING, "true") \
97-
CONFIG(STRING, DD_SERVICE, "") \
97+
CONFIG(STRING, DD_SERVICE, "", .ini_change = ddtrace_alter_dd_service) \
9898
CONFIG(MAP, DD_SERVICE_MAPPING, "") \
9999
CONFIG(MAP, DD_TAGS, "") \
100100
CONFIG(INT, DD_TRACE_AGENT_PORT, "0", .ini_change = zai_config_system_ini_change) \

ext/ddtrace.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -367,29 +367,28 @@ bool ddtrace_alter_sampling_rules_file_config(zval *old_value, zval *new_value)
367367
return dd_save_sampling_rules_file_config(Z_STR_P(new_value), PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
368368
}
369369

370-
static inline bool dd_alter_meta_var(const char *tag, zval *old_value, zval *new_value) {
370+
static inline bool dd_alter_prop(size_t prop_offset, zval *old_value, zval *new_value) {
371371
UNUSED(old_value);
372372

373373
ddtrace_span_properties *pspan = ddtrace_active_span_props();
374374
while (pspan) {
375-
zend_array *meta = ddtrace_property_array(&pspan->property_meta);
376-
if (Z_STRLEN_P(new_value) == 0) {
377-
zend_hash_str_del(meta, tag, strlen(tag));
378-
} else {
379-
Z_TRY_ADDREF_P(new_value);
380-
zend_hash_str_update(meta, tag, strlen(tag), new_value);
381-
}
375+
zval *property = (zval*)(prop_offset + (char*)pspan), garbage = *property;
376+
ZVAL_COPY(property, new_value);
377+
zval_ptr_dtor(&garbage);
382378
pspan = pspan->parent;
383379
}
384380

385381
return true;
386382
}
387383

384+
bool ddtrace_alter_dd_service(zval *old_value, zval *new_value) {
385+
return dd_alter_prop(XtOffsetOf(ddtrace_span_properties, property_service), old_value, new_value);
386+
}
388387
bool ddtrace_alter_dd_env(zval *old_value, zval *new_value) {
389-
return dd_alter_meta_var("env", old_value, new_value);
388+
return dd_alter_prop(XtOffsetOf(ddtrace_span_properties, property_env), old_value, new_value);
390389
}
391390
bool ddtrace_alter_dd_version(zval *old_value, zval *new_value) {
392-
return dd_alter_meta_var("version", old_value, new_value);
391+
return dd_alter_prop(XtOffsetOf(ddtrace_span_properties, property_version), old_value, new_value);
393392
}
394393

395394
static void dd_activate_once(void) {

ext/ddtrace.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void ddtrace_disable_tracing_in_current_request(void);
4848
bool ddtrace_alter_dd_trace_disabled_config(zval *old_value, zval *new_value);
4949
bool ddtrace_alter_sampling_rules_file_config(zval *old_value, zval *new_value);
5050
bool ddtrace_alter_default_propagation_style(zval *old_value, zval *new_value);
51+
bool ddtrace_alter_dd_service(zval *old_value, zval *new_value);
5152
bool ddtrace_alter_dd_env(zval *old_value, zval *new_value);
5253
bool ddtrace_alter_dd_version(zval *old_value, zval *new_value);
5354
void dd_force_shutdown_tracing(void);

ext/ddtrace.stub.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ class SpanData {
8282
*/
8383
public string|null $service = "";
8484

85+
/**
86+
* @var string The environment you are tracing. Defaults to active environment at the time of span creation
87+
* (i.e., the parent span), or datadog.env initialization settings if no parent exists
88+
*/
89+
public string $env = "";
90+
91+
/**
92+
* @var string The version of the application you are tracing. Defaults to active version at the time of
93+
* span creation (i.e., the parent span), or datadog.version initialization settings if no parent exists
94+
*/
95+
public string $version = "";
96+
8597
/**
8698
* @var string|null The type of request which can be set to: web, db, cache, or custom (Optional). Inherited
8799
* from parent.

ext/ddtrace_arginfo.h

Lines changed: 57 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 206c9d9eefe4af1076007627bb6d5651e23202ce */
2+
* Stub hash: cbd454866b5b3f34bee057c9a35d7807c6e718ca */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_DDTrace_trace_method, 0, 3, _IS_BOOL, 0)
55
ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0)
@@ -271,7 +271,6 @@ ZEND_END_ARG_INFO()
271271

272272
#define arginfo_class_DDTrace_Integration_init arginfo_dd_trace_dd_get_memory_limit
273273

274-
275274
ZEND_FUNCTION(DDTrace_trace_method);
276275
ZEND_FUNCTION(DDTrace_trace_function);
277276
ZEND_FUNCTION(DDTrace_hook_function);
@@ -346,49 +345,48 @@ ZEND_METHOD(DDTrace_SpanData, getStartTime);
346345
ZEND_METHOD(DDTrace_SpanData, getLink);
347346
ZEND_METHOD(DDTrace_SpanData, hexId);
348347

349-
350348
static const zend_function_entry ext_functions[] = {
351-
ZEND_NS_FALIAS("DDTrace", trace_method, DDTrace_trace_method, arginfo_DDTrace_trace_method)
352-
ZEND_NS_FALIAS("DDTrace", trace_function, DDTrace_trace_function, arginfo_DDTrace_trace_function)
353-
ZEND_NS_FALIAS("DDTrace", hook_function, DDTrace_hook_function, arginfo_DDTrace_hook_function)
354-
ZEND_NS_FALIAS("DDTrace", hook_method, DDTrace_hook_method, arginfo_DDTrace_hook_method)
355-
ZEND_NS_FALIAS("DDTrace", add_global_tag, DDTrace_add_global_tag, arginfo_DDTrace_add_global_tag)
356-
ZEND_NS_FALIAS("DDTrace", add_distributed_tag, DDTrace_add_distributed_tag, arginfo_DDTrace_add_distributed_tag)
357-
ZEND_NS_FALIAS("DDTrace", set_user, DDTrace_set_user, arginfo_DDTrace_set_user)
358-
ZEND_NS_FALIAS("DDTrace", close_spans_until, DDTrace_close_spans_until, arginfo_DDTrace_close_spans_until)
359-
ZEND_NS_FALIAS("DDTrace", active_span, DDTrace_active_span, arginfo_DDTrace_active_span)
360-
ZEND_NS_FALIAS("DDTrace", root_span, DDTrace_root_span, arginfo_DDTrace_root_span)
361-
ZEND_NS_FALIAS("DDTrace", start_span, DDTrace_start_span, arginfo_DDTrace_start_span)
362-
ZEND_NS_FALIAS("DDTrace", close_span, DDTrace_close_span, arginfo_DDTrace_close_span)
363-
ZEND_NS_FALIAS("DDTrace", update_span_duration, DDTrace_update_span_duration, arginfo_DDTrace_update_span_duration)
364-
ZEND_NS_FALIAS("DDTrace", start_trace_span, DDTrace_start_trace_span, arginfo_DDTrace_start_trace_span)
365-
ZEND_NS_FALIAS("DDTrace", active_stack, DDTrace_active_stack, arginfo_DDTrace_active_stack)
366-
ZEND_NS_FALIAS("DDTrace", create_stack, DDTrace_create_stack, arginfo_DDTrace_create_stack)
367-
ZEND_NS_FALIAS("DDTrace", switch_stack, DDTrace_switch_stack, arginfo_DDTrace_switch_stack)
368-
ZEND_NS_FALIAS("DDTrace", set_priority_sampling, DDTrace_set_priority_sampling, arginfo_DDTrace_set_priority_sampling)
369-
ZEND_NS_FALIAS("DDTrace", get_priority_sampling, DDTrace_get_priority_sampling, arginfo_DDTrace_get_priority_sampling)
370-
ZEND_NS_FALIAS("DDTrace", get_sanitized_exception_trace, DDTrace_get_sanitized_exception_trace, arginfo_DDTrace_get_sanitized_exception_trace)
371-
ZEND_NS_FALIAS("DDTrace", consume_distributed_tracing_headers, DDTrace_consume_distributed_tracing_headers, arginfo_DDTrace_consume_distributed_tracing_headers)
372-
ZEND_NS_FALIAS("DDTrace", generate_distributed_tracing_headers, DDTrace_generate_distributed_tracing_headers, arginfo_DDTrace_generate_distributed_tracing_headers)
373-
ZEND_NS_FALIAS("DDTrace", find_active_exception, DDTrace_find_active_exception, arginfo_DDTrace_find_active_exception)
374-
ZEND_NS_FALIAS("DDTrace", extract_ip_from_headers, DDTrace_extract_ip_from_headers, arginfo_DDTrace_extract_ip_from_headers)
375-
ZEND_NS_FALIAS("DDTrace", startup_logs, DDTrace_startup_logs, arginfo_DDTrace_startup_logs)
376-
ZEND_NS_FALIAS("DDTrace", trace_id, DDTrace_trace_id, arginfo_DDTrace_trace_id)
377-
ZEND_NS_FALIAS("DDTrace", logs_correlation_trace_id, DDTrace_logs_correlation_trace_id, arginfo_DDTrace_logs_correlation_trace_id)
378-
ZEND_NS_FALIAS("DDTrace", current_context, DDTrace_current_context, arginfo_DDTrace_current_context)
379-
ZEND_NS_FALIAS("DDTrace", set_distributed_tracing_context, DDTrace_set_distributed_tracing_context, arginfo_DDTrace_set_distributed_tracing_context)
380-
ZEND_NS_FALIAS("DDTrace", flush, DDTrace_flush, arginfo_DDTrace_flush)
381-
ZEND_NS_FALIAS("DDTrace", curl_multi_exec_get_request_spans, DDTrace_curl_multi_exec_get_request_spans, arginfo_DDTrace_curl_multi_exec_get_request_spans)
382-
ZEND_NS_FALIAS("DDTrace\\System", container_id, DDTrace_System_container_id, arginfo_DDTrace_System_container_id)
383-
ZEND_NS_FALIAS("DDTrace\\Config", integration_analytics_enabled, DDTrace_Config_integration_analytics_enabled, arginfo_DDTrace_Config_integration_analytics_enabled)
384-
ZEND_NS_FALIAS("DDTrace\\Config", integration_analytics_sample_rate, DDTrace_Config_integration_analytics_sample_rate, arginfo_DDTrace_Config_integration_analytics_sample_rate)
385-
ZEND_NS_FALIAS("DDTrace\\UserRequest", has_listeners, DDTrace_UserRequest_has_listeners, arginfo_DDTrace_UserRequest_has_listeners)
386-
ZEND_NS_FALIAS("DDTrace\\UserRequest", notify_start, DDTrace_UserRequest_notify_start, arginfo_DDTrace_UserRequest_notify_start)
387-
ZEND_NS_FALIAS("DDTrace\\UserRequest", notify_commit, DDTrace_UserRequest_notify_commit, arginfo_DDTrace_UserRequest_notify_commit)
388-
ZEND_NS_FALIAS("DDTrace\\UserRequest", set_blocking_function, DDTrace_UserRequest_set_blocking_function, arginfo_DDTrace_UserRequest_set_blocking_function)
389-
ZEND_NS_FALIAS("DDTrace\\Testing", trigger_error, DDTrace_Testing_trigger_error, arginfo_DDTrace_Testing_trigger_error)
390-
ZEND_NS_FALIAS("DDTrace\\Internal", add_span_flag, DDTrace_Internal_add_span_flag, arginfo_DDTrace_Internal_add_span_flag)
391-
ZEND_NS_FALIAS("DDTrace\\Internal", handle_fork, DDTrace_Internal_handle_fork, arginfo_DDTrace_Internal_handle_fork)
349+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "trace_method"), zif_DDTrace_trace_method, arginfo_DDTrace_trace_method, 0, NULL, NULL)
350+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "trace_function"), zif_DDTrace_trace_function, arginfo_DDTrace_trace_function, 0, NULL, NULL)
351+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "hook_function"), zif_DDTrace_hook_function, arginfo_DDTrace_hook_function, 0, NULL, NULL)
352+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "hook_method"), zif_DDTrace_hook_method, arginfo_DDTrace_hook_method, 0, NULL, NULL)
353+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "add_global_tag"), zif_DDTrace_add_global_tag, arginfo_DDTrace_add_global_tag, 0, NULL, NULL)
354+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "add_distributed_tag"), zif_DDTrace_add_distributed_tag, arginfo_DDTrace_add_distributed_tag, 0, NULL, NULL)
355+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "set_user"), zif_DDTrace_set_user, arginfo_DDTrace_set_user, 0, NULL, NULL)
356+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "close_spans_until"), zif_DDTrace_close_spans_until, arginfo_DDTrace_close_spans_until, 0, NULL, NULL)
357+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "active_span"), zif_DDTrace_active_span, arginfo_DDTrace_active_span, 0, NULL, NULL)
358+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "root_span"), zif_DDTrace_root_span, arginfo_DDTrace_root_span, 0, NULL, NULL)
359+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "start_span"), zif_DDTrace_start_span, arginfo_DDTrace_start_span, 0, NULL, NULL)
360+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "close_span"), zif_DDTrace_close_span, arginfo_DDTrace_close_span, 0, NULL, NULL)
361+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "update_span_duration"), zif_DDTrace_update_span_duration, arginfo_DDTrace_update_span_duration, 0, NULL, NULL)
362+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "start_trace_span"), zif_DDTrace_start_trace_span, arginfo_DDTrace_start_trace_span, 0, NULL, NULL)
363+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "active_stack"), zif_DDTrace_active_stack, arginfo_DDTrace_active_stack, 0, NULL, NULL)
364+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "create_stack"), zif_DDTrace_create_stack, arginfo_DDTrace_create_stack, 0, NULL, NULL)
365+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "switch_stack"), zif_DDTrace_switch_stack, arginfo_DDTrace_switch_stack, 0, NULL, NULL)
366+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "set_priority_sampling"), zif_DDTrace_set_priority_sampling, arginfo_DDTrace_set_priority_sampling, 0, NULL, NULL)
367+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "get_priority_sampling"), zif_DDTrace_get_priority_sampling, arginfo_DDTrace_get_priority_sampling, 0, NULL, NULL)
368+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "get_sanitized_exception_trace"), zif_DDTrace_get_sanitized_exception_trace, arginfo_DDTrace_get_sanitized_exception_trace, 0, NULL, NULL)
369+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "consume_distributed_tracing_headers"), zif_DDTrace_consume_distributed_tracing_headers, arginfo_DDTrace_consume_distributed_tracing_headers, 0, NULL, NULL)
370+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "generate_distributed_tracing_headers"), zif_DDTrace_generate_distributed_tracing_headers, arginfo_DDTrace_generate_distributed_tracing_headers, 0, NULL, NULL)
371+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "find_active_exception"), zif_DDTrace_find_active_exception, arginfo_DDTrace_find_active_exception, 0, NULL, NULL)
372+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "extract_ip_from_headers"), zif_DDTrace_extract_ip_from_headers, arginfo_DDTrace_extract_ip_from_headers, 0, NULL, NULL)
373+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "startup_logs"), zif_DDTrace_startup_logs, arginfo_DDTrace_startup_logs, 0, NULL, NULL)
374+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "trace_id"), zif_DDTrace_trace_id, arginfo_DDTrace_trace_id, 0, NULL, NULL)
375+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "logs_correlation_trace_id"), zif_DDTrace_logs_correlation_trace_id, arginfo_DDTrace_logs_correlation_trace_id, 0, NULL, NULL)
376+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "current_context"), zif_DDTrace_current_context, arginfo_DDTrace_current_context, 0, NULL, NULL)
377+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "set_distributed_tracing_context"), zif_DDTrace_set_distributed_tracing_context, arginfo_DDTrace_set_distributed_tracing_context, 0, NULL, NULL)
378+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "flush"), zif_DDTrace_flush, arginfo_DDTrace_flush, 0, NULL, NULL)
379+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace", "curl_multi_exec_get_request_spans"), zif_DDTrace_curl_multi_exec_get_request_spans, arginfo_DDTrace_curl_multi_exec_get_request_spans, 0, NULL, NULL)
380+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace\\System", "container_id"), zif_DDTrace_System_container_id, arginfo_DDTrace_System_container_id, 0, NULL, NULL)
381+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace\\Config", "integration_analytics_enabled"), zif_DDTrace_Config_integration_analytics_enabled, arginfo_DDTrace_Config_integration_analytics_enabled, 0, NULL, NULL)
382+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace\\Config", "integration_analytics_sample_rate"), zif_DDTrace_Config_integration_analytics_sample_rate, arginfo_DDTrace_Config_integration_analytics_sample_rate, 0, NULL, NULL)
383+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace\\UserRequest", "has_listeners"), zif_DDTrace_UserRequest_has_listeners, arginfo_DDTrace_UserRequest_has_listeners, 0, NULL, NULL)
384+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace\\UserRequest", "notify_start"), zif_DDTrace_UserRequest_notify_start, arginfo_DDTrace_UserRequest_notify_start, 0, NULL, NULL)
385+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace\\UserRequest", "notify_commit"), zif_DDTrace_UserRequest_notify_commit, arginfo_DDTrace_UserRequest_notify_commit, 0, NULL, NULL)
386+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace\\UserRequest", "set_blocking_function"), zif_DDTrace_UserRequest_set_blocking_function, arginfo_DDTrace_UserRequest_set_blocking_function, 0, NULL, NULL)
387+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace\\Testing", "trigger_error"), zif_DDTrace_Testing_trigger_error, arginfo_DDTrace_Testing_trigger_error, 0, NULL, NULL)
388+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace\\Internal", "add_span_flag"), zif_DDTrace_Internal_add_span_flag, arginfo_DDTrace_Internal_add_span_flag, 0, NULL, NULL)
389+
ZEND_RAW_FENTRY(ZEND_NS_NAME("DDTrace\\Internal", "handle_fork"), zif_DDTrace_Internal_handle_fork, arginfo_DDTrace_Internal_handle_fork, 0, NULL, NULL)
392390
ZEND_FE(dd_trace_env_config, arginfo_dd_trace_env_config)
393391
ZEND_FE(dd_trace_disable_in_request, arginfo_dd_trace_disable_in_request)
394392
ZEND_FE(dd_trace_reset, arginfo_dd_trace_reset)
@@ -411,21 +409,19 @@ static const zend_function_entry ext_functions[] = {
411409
ZEND_FE(dd_trace_serialize_closed_spans, arginfo_dd_trace_serialize_closed_spans)
412410
ZEND_FE(dd_trace_peek_span_id, arginfo_dd_trace_peek_span_id)
413411
ZEND_FE(dd_trace_close_all_spans_and_flush, arginfo_dd_trace_close_all_spans_and_flush)
414-
ZEND_FALIAS(dd_trace_function, DDTrace_trace_function, arginfo_dd_trace_function)
415-
ZEND_FALIAS(dd_trace_method, DDTrace_trace_method, arginfo_dd_trace_method)
412+
ZEND_RAW_FENTRY("dd_trace_function", zif_DDTrace_trace_function, arginfo_dd_trace_function, 0, NULL, NULL)
413+
ZEND_RAW_FENTRY("dd_trace_method", zif_DDTrace_trace_method, arginfo_dd_trace_method, 0, NULL, NULL)
416414
ZEND_FE(dd_untrace, arginfo_dd_untrace)
417415
ZEND_FE(dd_trace_synchronous_flush, arginfo_dd_trace_synchronous_flush)
418416
ZEND_FE_END
419417
};
420418

421-
422419
static const zend_function_entry class_DDTrace_SpanLink_methods[] = {
423420
ZEND_ME(DDTrace_SpanLink, jsonSerialize, arginfo_class_DDTrace_SpanLink_jsonSerialize, ZEND_ACC_PUBLIC)
424421
ZEND_ME(DDTrace_SpanLink, fromHeaders, arginfo_class_DDTrace_SpanLink_fromHeaders, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
425422
ZEND_FE_END
426423
};
427424

428-
429425
static const zend_function_entry class_DDTrace_SpanData_methods[] = {
430426
ZEND_ME(DDTrace_SpanData, getDuration, arginfo_class_DDTrace_SpanData_getDuration, ZEND_ACC_PUBLIC)
431427
ZEND_ME(DDTrace_SpanData, getStartTime, arginfo_class_DDTrace_SpanData_getStartTime, ZEND_ACC_PUBLIC)
@@ -434,19 +430,16 @@ static const zend_function_entry class_DDTrace_SpanData_methods[] = {
434430
ZEND_FE_END
435431
};
436432

437-
438433
static const zend_function_entry class_DDTrace_RootSpanData_methods[] = {
439434
ZEND_FE_END
440435
};
441436

442-
443437
static const zend_function_entry class_DDTrace_SpanStack_methods[] = {
444438
ZEND_FE_END
445439
};
446440

447-
448441
static const zend_function_entry class_DDTrace_Integration_methods[] = {
449-
ZEND_ABSTRACT_ME_WITH_FLAGS(DDTrace_Integration, init, arginfo_class_DDTrace_Integration_init, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
442+
ZEND_RAW_FENTRY("init", NULL, arginfo_class_DDTrace_Integration_init, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT, NULL, NULL)
450443
ZEND_FE_END
451444
};
452445

@@ -532,6 +525,18 @@ static zend_class_entry *register_class_DDTrace_SpanData(void)
532525
zend_declare_typed_property(class_entry, property_service_name, &property_service_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING|MAY_BE_NULL));
533526
zend_string_release(property_service_name);
534527

528+
zval property_env_default_value;
529+
ZVAL_EMPTY_STRING(&property_env_default_value);
530+
zend_string *property_env_name = zend_string_init("env", sizeof("env") - 1, 1);
531+
zend_declare_typed_property(class_entry, property_env_name, &property_env_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING));
532+
zend_string_release(property_env_name);
533+
534+
zval property_version_default_value;
535+
ZVAL_EMPTY_STRING(&property_version_default_value);
536+
zend_string *property_version_name = zend_string_init("version", sizeof("version") - 1, 1);
537+
zend_declare_typed_property(class_entry, property_version_name, &property_version_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING));
538+
zend_string_release(property_version_name);
539+
535540
zval property_type_default_value;
536541
ZVAL_EMPTY_STRING(&property_type_default_value);
537542
zend_string *property_type_name = zend_string_init("type", sizeof("type") - 1, 1);

0 commit comments

Comments
 (0)