-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(agent): Adds label forwarding to log events #1027
base: dev
Are you sure you want to change the base?
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1027 +/- ##
==========================================
+ Coverage 77.58% 77.63% +0.05%
==========================================
Files 198 198
Lines 27715 27786 +71
==========================================
+ Hits 21503 21573 +70
- Misses 6212 6213 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The function nr_txn_begin() now accepts a nrobj_t *log_labels parameter which contains the logging labels to be associated with log events.
…ding labels metric
- skipped PHP5 specific tests
- added PHP5 tests - these are not for PHP 5 but are intended to run on PHP5+!
nrl_debug(NRL_INIT, "unable to begin transaction: app '%.128s' is unknown", | ||
appnames ? appnames : ""); | ||
return NR_FAILURE; | ||
} | ||
|
||
attribute_config = nr_php_create_attribute_config(TSRMLS_C); | ||
NRPRG(txn) = nr_txn_begin(NRPRG(app), &opts, attribute_config); | ||
log_forwarding_labels | ||
= nr_php_txn_get_log_forwarding_labels(NRPRG(app)->info.labels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just have log_forwarding_labels
be part of NRPRG(app)->info
? Why does it need to be passed separately?
It could just be added as a var here: https://github.com/newrelic/newrelic-php-agent/pull/1027/files#diff-f5f8c5da8db458c336e8505b331bcb42a571175d89cdd0e65fbc39c1121a5960L881
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that but it would be odd to put it in "appinfo" but send it to the daemon in the "transaction" payload. Also I believe the information needed to make the filtered log labels list is not available when "appinfo" is initialized.
bc18e12
to
df096d7
Compare
This PR adds the ability for labels to be forwarded with any log messages forwarded by the PHP agent.