opencensus-php
opencensus-php copied to clipboard
Add file where function is defined to trace attributes
a) Not sure how open are you about this. b) It serves a purpose where the function being trace is same across multiple files and you need to know which file has it. c) There should probably be some config option to enable this as it might impact performance.
I'm open on suggestions...
Hi @dz0ny, thanks for the contribution. I think it can be a helpful addition in certain cases. Having said that, there are indeed some concerns:
- this should not be always on behavior. It will need a PHP configuration switch to allow enabling/disabling this feature (default=disabled).
- all tests fail at the moment... this functionality needs to be tested and tests currently breaking need to be fixed
- we have a major update waiting for the PHP extension in #220 so once the design is approved we might ask for a rebase as I expect #220 to take precedence.
Yep tests fail because there is new attribute "file" outputted by default.
007+ ["file"]=>
008+ string(43) "/home/circleci/project/ext/tests/common.php"
The problem is that a test will fail because diff (because of the absolute path) will always be depended on the environment. SO the question is how to write tests or test in a way where it does not do exact match but just partial, which is required even if feature is disabled by default.