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

Why does just php sdk have the concept of scope for span? #1295

Closed
changzee opened this issue Apr 28, 2024 · 2 comments
Closed

Why does just php sdk have the concept of scope for span? #1295

changzee opened this issue Apr 28, 2024 · 2 comments

Comments

@changzee
Copy link

I checked the official documentation and found that unlike other languages ​​​​(go, python), PHP SDK has two more APIs for scope activation and deativation, which is an unnecessary burden for users.
Is it a bad idea?

@brettmc
Copy link
Collaborator

brettmc commented Apr 28, 2024

I think it's this part:

https://github.com/open-telemetry/opentelemetry-specification/tree/v1.32.0/specification/context#attach-context

The API MUST return a value that can be used as a Token to restore the previous Context

Java has something very similar, Context::makeCurrent: https://github.com/open-telemetry/opentelemetry-java/blob/main/context/src/main/java/io/opentelemetry/context/Context.java#L201 (note that it returns a Scope, which must be closed)

@changzee
Copy link
Author

thanks for ur answer

@brettmc brettmc closed this as completed May 9, 2024
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

2 participants