Skip to content

Commit 781ccd6

Browse files
dubloombwoebi
andauthored
Remove non actionnable telemetry logs (#3270)
* chore: remove non actionnable telemetry logs * Revert most useful integration error submissions Guard against file exists before submitting Signed-off-by: Bob Weinand <[email protected]> --------- Signed-off-by: Bob Weinand <[email protected]> Co-authored-by: Bob Weinand <[email protected]>
1 parent 2fd2b2a commit 781ccd6

File tree

3 files changed

+2
-92
lines changed

3 files changed

+2
-92
lines changed

ext/autoload_php_files.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ int dd_execute_php_file(const char *filename, zval *result, bool try) {
102102
LOGEV(WARN, {
103103
if (PG(last_error_message)) {
104104
log("Error raised in autoloaded file %s: %s in %s on line %d", filename, LAST_ERROR_STRING, LAST_ERROR_FILE, PG(last_error_lineno));
105-
if (get_global_DD_INSTRUMENTATION_TELEMETRY_ENABLED() && get_DD_TELEMETRY_LOG_COLLECTION_ENABLED()) {
105+
if (get_global_DD_INSTRUMENTATION_TELEMETRY_ENABLED() && get_DD_TELEMETRY_LOG_COLLECTION_ENABLED() && VCWD_ACCESS(filename, R_OK) == 0) {
106106
INTEGRATION_ERROR_TELEMETRY(ERROR, "Error raised in autoloaded file %s: %s in %s on line %d", filename, LAST_ERROR_STRING, LAST_ERROR_FILE, PG(last_error_lineno));
107107
}
108108
}
@@ -111,7 +111,7 @@ int dd_execute_php_file(const char *filename, zval *result, bool try) {
111111
const char *type = ex->ce->name->val;
112112
const char *msg = instanceof_function(ex->ce, zend_ce_throwable) ? ZSTR_VAL(zai_exception_message(ex)) : "<exit>";
113113
log("%s thrown in autoloaded file %s: %s", type, filename, msg);
114-
if (get_global_DD_INSTRUMENTATION_TELEMETRY_ENABLED() && get_DD_TELEMETRY_LOG_COLLECTION_ENABLED()) {
114+
if (get_global_DD_INSTRUMENTATION_TELEMETRY_ENABLED() && get_DD_TELEMETRY_LOG_COLLECTION_ENABLED() && VCWD_ACCESS(filename, R_OK) == 0) {
115115
INTEGRATION_ERROR_TELEMETRY(ERROR, "%s thrown in autoloaded file %s: %s", type, filename, msg);
116116
}
117117
}

ext/integrations/integrations.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ static void dd_invoke_integration_loader_and_unhook_posthook(zend_ulong invocati
9898
zend_class_entry *ce = zend_lookup_class(aux->classname);
9999
if (!ce) {
100100
LOG(WARN, "Error loading deferred integration %s: Class not loaded and not autoloadable", ZSTR_VAL(aux->classname));
101-
if (get_global_DD_INSTRUMENTATION_TELEMETRY_ENABLED() && get_DD_TELEMETRY_LOG_COLLECTION_ENABLED()) {
102-
INTEGRATION_ERROR_TELEMETRY(WARN, "Error loading deferred integration %s: Class not loaded and not autoloadable", ZSTR_VAL(aux->classname));
103-
}
104101
success = true;
105102
break;
106103
}

tests/ext/telemetry/integration_load_error.phpt

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)