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

Order of events is not correct #47

Closed
asgrim opened this issue Sep 3, 2019 · 0 comments · Fixed by #52
Closed

Order of events is not correct #47

asgrim opened this issue Sep 3, 2019 · 0 comments · Fixed by #52
Assignees
Labels
bug Something isn't working

Comments

@asgrim
Copy link
Collaborator

asgrim commented Sep 3, 2019

        $agent->webTransaction('Yay', static function () use ($agent) : void {
            $agent->instrument('test', 'foo', static function () use ($agent) : void {
                sleep(1);
                $agent->instrument('test', 'foo2', static function () : void {
                    sleep(1);
                });
            });
            $agent->tagRequest('testtag', '1.23');
        });

At the moment, we're getting events in the order more like:

  • StartRequest
  • StartSpan test/foo2
  • TagSpan test/foo2 stack
  • StopSpan test/foo2
  • StartSpan test/foo
  • TagSpan test/foo stack
  • StopSpan test/foo
  • TagRequest testtag 1.23
  • StartSpan Controller/Yay
  • TagSpan Controller/Yay stack
  • StopSpan Controller/Yay
  • FinishRequest

The order events is wrong because the StartSpan test/foo2 refers to the parent_id of the StartSpan Controller/Yay which doesn't "exist" yet. Also, the order doesn't really make sense due to the order in which the spans are started/stopped etc.

These events should be reordered to their "natural" order, for example:

  • StartRequest
  • StartSpan Controller/Yay
  • StartSpan test/foo
  • StartSpan test/foo2
  • TagSpan test/foo2 stack
  • StopSpan test/foo2
  • TagSpan test/foo stack
  • StopSpan test/foo
  • TagRequest testtag 1.23
  • TagSpan Controller/Yay stack
  • StopSpan Controller/Yay
  • FinishRequest
@asgrim asgrim added the bug Something isn't working label Sep 3, 2019
@asgrim asgrim self-assigned this Sep 5, 2019
cschneid pushed a commit that referenced this issue Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant