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 sync property to spans #1523

Closed
hmdhk opened this issue Nov 6, 2018 · 7 comments
Closed

Add sync property to spans #1523

hmdhk opened this issue Nov 6, 2018 · 7 comments
Assignees

Comments

@hmdhk
Copy link
Contributor

hmdhk commented Nov 6, 2018

Certain operations in some languages could be executed synchronously or asynchronously and it would be useful to have this indicated on the span.

For example in the frontend applications we can create http requests that are executed synchronously and this could have negative influence on the performance of the page.

We should add sync property to spans:

{
  "sync": Boolean (optional)
}

UPDATE

The sync property should be searchable therefore it should be indexed!

cc @elastic/apm-agent-devs

@simitt
Copy link
Contributor

simitt commented Nov 14, 2018

@jahtalab how urgent is this? Are there also UI changes necessary to leverage this information?

@hmdhk
Copy link
Contributor Author

hmdhk commented Nov 14, 2018

@simitt , I wouldn't say it's urgent but it's an important field so I'd prefer to get it in as soon as possible.

Yes, I will create an issue for Kibana once this property is defined in the apm-server schema.

@simitt
Copy link
Contributor

simitt commented Nov 14, 2018

Should this be searchable and/or aggregatable, so we have to index it?

@hmdhk
Copy link
Contributor Author

hmdhk commented Nov 14, 2018

Yes, it should be searchable, I have updated the description!

simitt added a commit to simitt/apm-server that referenced this issue Nov 14, 2018
@simitt simitt self-assigned this Nov 14, 2018
simitt added a commit to simitt/apm-server that referenced this issue Nov 14, 2018
simitt added a commit to simitt/apm-server that referenced this issue Nov 14, 2018
simitt added a commit to simitt/apm-server that referenced this issue Nov 19, 2018
simitt added a commit that referenced this issue Nov 19, 2018
* spec: add span.sync and index field

implements #1523
@simitt simitt closed this as completed Nov 19, 2018
@sorenlouv
Copy link
Member

sorenlouv commented Nov 20, 2018

In the future we will need to support spans that start and/or end after the parent transaction has ended. I have heard this mentioned as "async spans". Task queues is one example.
The kind of async spans suggested in this issue is a different concept. Have we thought about whether those two terminologies collide?

@roncohen
Copy link
Contributor

for future reference, I've copied the following from a discussion that happened elsewhere:

I took a look at the OpenTracing span relationships to see if that relates to this async field: They have FollowsFrom and ChildOf. The difference is that with ChildOf:

the parent Span depends on the child Span in some capacity

whereas that's not the case for FollowsFrom: https://github.com/opentracing/specification/blob/master/specification.md#references-between-spans

I think the two concepts are unrelated: To my understanding, the OT concept "ChildOf" means the parent cannot end before the child end because it depends on something the child returns/produces. While our context.async denotes if the "main thread" is blocked while the child executes. In other words, when you have "ChildOf" async can be both true and false, but with FollowsFrom "async" isn't so useful.

@watson
Copy link
Contributor

watson commented Nov 21, 2018

@roncohen I agree that the two concepts are unrelated, but I just wanted to correct a potential misunderstanding related to "ChildOf":

To my understanding, the OT concept "ChildOf" means the parent cannot end before the child end because it depends on something the child returns/produces.

As far as I understand it, this isn't a requirement of the "ChildOf" relationship. E.g. if you look at the valid timing diagrams for "ChildOf", you'll see that "Child Span D" ends after its parent span.

The example used here says that a parent span can have a deadline for when it expects a result from the child. If the child fails to deliver the result within the deadline the parent can choose to end before the child.

So the "ChildOf" relationship is just signaling intent rather than actual timing.

graphaelli pushed a commit to graphaelli/apm-server that referenced this issue Nov 28, 2018
* spec: add span.sync and index field

implements elastic#1523
graphaelli pushed a commit that referenced this issue Nov 28, 2018
* spec: add span.sync and index field

implements #1523
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

No branches or pull requests

7 participants