Skip to content
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

Support for auto-instrumentation #237

Merged
merged 215 commits into from
Jan 21, 2019
Merged

Support for auto-instrumentation #237

merged 215 commits into from
Jan 21, 2019

Conversation

labbati
Copy link
Member

@labbati labbati commented Jan 15, 2019

Description

This PR adds support for autoinstrumenting PHP code.

Readiness checklist

labbati and others added 30 commits January 2, 2019 12:01
@labbati labbati force-pushed the labbati/autoinstrumentation branch from c48b9a8 to 942c2d2 Compare January 21, 2019 18:06
@labbati labbati force-pushed the labbati/autoinstrumentation branch from 942c2d2 to c3a739b Compare January 21, 2019 18:07
@labbati labbati requested a review from pawelchcki January 21, 2019 18:54
pawelchcki
pawelchcki previously approved these changes Jan 21, 2019
Copy link
Contributor

@pawelchcki pawelchcki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff!!

@@ -51,6 +51,8 @@ aliases:
image: php:7.2
name: request_replayer
command: sh -c "curl --output index.php https://raw.githubusercontent.com/DataDog/dd-trace-php/dev/tests/request_replayer/index.php -q && php -S 0.0.0.0:80 index.php"
environment:
DD_REQUEST_DUMPER_FILE: dump.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost Request dumpster fire :D <- this is the most useful Review comment of this decade

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

$args = func_get_args();
$options = $args[0];

$classExist = class_exists('DDTrace_Ddtrace');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:eye_twitch: at the random casing - I assume its as per Zend recommendation ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct! it actually took as a while to understand! 😄

@@ -203,6 +203,51 @@ static PHP_FUNCTION(dd_trace) {
RETURN_BOOL(rv);
}

// This function allows untracing a function.
static PHP_FUNCTION(dd_untrace) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff !!!!

@@ -16,8 +16,7 @@
"app/database/seeds"
],
"psr-4": {
"App\\": "app/",
"DDTrace\\": "../../../../src/DDTrace/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@@ -0,0 +1,32 @@
--TEST--
Check a function can be untraced.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nitpick - this test could also verify other functions/methods still remain traced after one is untraced.

@labbati labbati merged commit 5272732 into dev Jan 21, 2019
@labbati labbati deleted the labbati/autoinstrumentation branch January 22, 2019 13:37
@SammyK
Copy link
Contributor

SammyK commented Jan 22, 2019

Amazing work @labbati! :)

bwoebi pushed a commit that referenced this pull request Sep 15, 2023
* Update extraction ip algorithin

* Add more tests for new ip headers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants