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

Add Custom Instrumentation Documentation #1942

Merged
merged 28 commits into from
Mar 10, 2023
Merged

Conversation

PROFeNoM
Copy link
Contributor

@PROFeNoM PROFeNoM commented Feb 27, 2023

Description

Add documentation for the function and classes declared in ddtrace.c, related to custom instrumentation.

Fixes #1574.

As part of this pull request, by necessity, we are moving to TypeError'ing out on bad parameters to DDTrace functions, see also 24f8fa3.

Readiness checklist

  • (only for Members) Changelog has been added to the release document.
  • Tests added for this feature/bug.

Reviewer checklist

  • Appropriate labels assigned.
  • Milestone is set.
  • Changelog has been added to the release document. For community contributors the reviewer is in charge of this task.

@PROFeNoM PROFeNoM requested a review from a team as a code owner February 27, 2023 14:52
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
function set_user(string $userId, ?array $metadata = null, ?bool $propagate = null): void {}

/**
* Get the value of a DD environment variable
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* Get the value of a DD environment variable
* Get the parsed value of a DD environment variable

ext/ddtrace.stub.php Outdated Show resolved Hide resolved
@bwoebi
Copy link
Collaborator

bwoebi commented Feb 27, 2023

Can you please consistently leave a blank line in the docblocks between the description and the first @-line?

ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
ext/ddtrace.stub.php Outdated Show resolved Hide resolved
PROFeNoM and others added 14 commits March 2, 2023 13:54
Some tests are still failing on PHP 7.0 and 7.1. I'm working on it.
Note: There may be even more functions with this issue
Note: There are still some core dump issues in api randomized stress tests
Note: The last commit introduced a fatal error (Internal zval's can't be arrays, objects or resources in Unknown on line 0) that could be observed in the c tests in the 7.x versions of PHP. As a result, functions weren't defined.
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the alex/doc_custom_instrumentation branch 4 times, most recently from b9d1a39 to 24f8fa3 Compare March 8, 2023 12:55
This is primarily motivated by PHP 8.1 strongly enforcing types declared by the arginfos. Given the stubs, we now have full arginfos and PHP becomes much more picky.
This is a good thing though, so, we're going to eventually always throw TypeErrors.

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the alex/doc_custom_instrumentation branch from 24f8fa3 to 955d578 Compare March 9, 2023 14:05
bwoebi added 4 commits March 9, 2023 18:03
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Copy link
Collaborator

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

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

Thanks for all these docs :-)

@bwoebi bwoebi merged commit 78d08dc into master Mar 10, 2023
@bwoebi bwoebi deleted the alex/doc_custom_instrumentation branch March 10, 2023 11:17
This was referenced Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Add phpStan stub file so
2 participants