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

Auto-instrumentation in Symfony 3.4 and PHP 5.6 #262

Merged
merged 21 commits into from
Jan 28, 2019

Conversation

labbati
Copy link
Member

@labbati labbati commented Jan 25, 2019

Description

Readiness checklist

@labbati labbati added the 🍏 core Changes to the core tracing functionality label Jan 25, 2019
@labbati labbati added this to the 0.11.0 milestone Jan 25, 2019
Copy link
Contributor

@SammyK SammyK left a comment

Choose a reason for hiding this comment

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

Excellent work @labbati! And kudos for being able to find the source of the Symfony 3.4 issue with the cache! :D I just have a few suggestions to keep the auto-instrumentation stuff out of the global scope. :)

* @param string[] $sentinelClasses
* @return bool
*/
function any_class_exists(array $sentinelClasses)
Copy link
Contributor

Choose a reason for hiding this comment

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

In order to not fill the global namespace with functions that might collide with user's apps, can we add namespace DDTrace; to the top of this file and then we can do the same in the dd_wrap_autoloader.php file. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Also if we add the namespaces, we'll need to update line 10 of dd_init.php to this:

if (!\DDTrace\dd_tracing_enabled()) {

@@ -12,16 +12,25 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add namespace DDTrace; to the top of this file per the other comment? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

If it is fine for you, for consistency I would add DDTrace\Bridge as int he other files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Even better! :)

@@ -12,16 +12,25 @@

$dd_autoload_called = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since these variables get dumped into the global scope even with the namespacing, can we wrap everything from this line down with a self-calling function?

call_user_func(function () {
    $dd_autoload_called = false;
    // ....
});

That will prevent these variables from showing up in user's apps to potentially cause unexpected behavior. :)

screen shot 2019-01-25 at 12 53 18 pm

- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
environment:
- DD_API_KEY=${DATADOG_API_KEY}
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this intentional to duplicate the agent container ddagent_integration here and pull the API key from the env vars instead of using the value invalid_key_but_its_ok? If so, cool, but wanted to double check. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

This can be used together with apache_56_server container to send real traces to our backend. I can drop this no problem (or move to a different file). But it may be useful to have some real server sending traces to our backend.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect! Just wanted to double check. :)

rm -rf build/packages
mkdir -p build/packages

function build_version() {
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Copy link
Contributor

@SammyK SammyK left a comment

Choose a reason for hiding this comment

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

Great work @labbati! :D

@labbati labbati merged commit bc365d2 into master Jan 28, 2019
@labbati labbati deleted the labbati/improve-autoinstrumentation branch January 28, 2019 14:32
bwoebi pushed a commit that referenced this pull request Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍏 core Changes to the core tracing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants