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

opentelemetry-api: StatusCode is not public/exported by default #1619

Closed
vmihailenco opened this issue Feb 19, 2021 · 2 comments · Fixed by #1681
Closed

opentelemetry-api: StatusCode is not public/exported by default #1619

vmihailenco opened this issue Feb 19, 2021 · 2 comments · Fixed by #1681
Assignees
Labels
1.0.0rc2 release candidate 2 for tracing GA good first issue Good first issue help wanted

Comments

@vmihailenco
Copy link
Contributor

vmihailenco commented Feb 19, 2021

Should StatusCode be exported by default? E.g. I would like to do the following

from opentelemetry import trace

with tracer.start_as_current_span("main") as span:
    span.set_status(trace.Status(trace.StatusCode.ERROR, "error description"))

But trace.StatusCode is not available and should be imported separately

from opentelemetry.trace.status import StatusCode

Is it intentional?

@owais
Copy link
Contributor

owais commented Mar 5, 2021

If Status is exported directly from the trace module, I don't see any reason to not export StatusCode as well. Most of the time people would want to use Status is to set a status on a span so they'd also need StatusCode.

We should either remove Status from trace module and have users import both Status and StatusCode from opentelemetry.trace.status or make both available from the trace module. Don't have a strong preference.

@lzchen
Copy link
Contributor

lzchen commented Mar 8, 2021

@owais
My vote is for simply adding StatusCode into trace module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0.0rc2 release candidate 2 for tracing GA good first issue Good first issue help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants