Skip to content

Update for the more restricted span status codes.#1701

Merged
jkwatson merged 2 commits into
open-telemetry:masterfrom
jkwatson:limited_statuses
Sep 28, 2020
Merged

Update for the more restricted span status codes.#1701
jkwatson merged 2 commits into
open-telemetry:masterfrom
jkwatson:limited_statuses

Conversation

@jkwatson

@jkwatson jkwatson commented Sep 24, 2020

Copy link
Copy Markdown
Contributor

resolves #1700

Note: I made the numeric codes match the proposed protobuf status codes.

@codecov

codecov Bot commented Sep 24, 2020

Copy link
Copy Markdown

Codecov Report

Merging #1701 into master will increase coverage by 0.08%.
The diff coverage is 84.21%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1701      +/-   ##
============================================
+ Coverage     85.36%   85.44%   +0.08%     
- Complexity     1382     1386       +4     
============================================
  Files           164      164              
  Lines          5418     5395      -23     
  Branches        556      556              
============================================
- Hits           4625     4610      -15     
+ Misses          594      587       -7     
+ Partials        199      198       -1     
Impacted Files Coverage Δ Complexity Δ
...opentelemetry/opentracingshim/SpanBuilderShim.java 53.68% <0.00%> (ø) 22.00 <0.00> (ø)
...ava/io/opentelemetry/opentracingshim/SpanShim.java 44.11% <0.00%> (ø) 14.00 <0.00> (ø)
...i/src/main/java/io/opentelemetry/trace/Status.java 90.00% <100.00%> (-2.54%) 20.00 <6.00> (+4.00) ⬇️
...a/io/opentelemetry/exporters/otlp/SpanAdapter.java 95.95% <100.00%> (+0.12%) 20.00 <3.00> (+1.00)
...entelemetry/extensions/trace/CurrentSpanUtils.java 85.71% <100.00%> (ø) 4.00 <0.00> (ø)
...ntelemetry/sdk/trace/RecordEventsReadableSpan.java 81.89% <100.00%> (+0.07%) 76.00 <0.00> (-1.00) ⬆️
...telemetry/sdk/trace/export/BatchSpanProcessor.java 89.33% <0.00%> (+3.33%) 8.00% <0.00%> (ø%)
...y/sdk/metrics/aggregator/DoubleMinMaxSumCount.java 100.00% <0.00%> (+3.92%) 6.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10ea529...73c0db3. Read the comment docs.

* @since 0.1.0
*/
UNAVAILABLE(14),
OK(0),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need the numbers anymore?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm honestly not sure. I noticed that in the Jaeger mapping, we directly just copy that code over as a status code. Is that correct? No idea, either. I'd prefer to get rid of the numeric codes, and the accessor for them, but we need to decide what to do with the existing mappings.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Got it - we can change this latter anyways.

private static void setErrorStatus(Span span, Throwable t) {
span.setStatus(
Status.UNKNOWN.withDescription(
Status.ERROR.withDescription(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I realised that I still an open question about this use case: open-telemetry/opentelemetry-specification#1008

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'd be happy to revisit this when the issue is clarified. Meanwhile, it does seem like approximately preserving the existing behavior is a good thing for now. And, as I commented on that issue, I think the intent with recordException is that it's an error, most commonly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When that gets merged, I'll create an issue to address it here. Meanwhile, keeping the existing behavior seems like the right decision for this PR.

Comment thread api/src/main/java/io/opentelemetry/trace/Status.java Outdated
@bogdandrutu bogdandrutu reopened this Sep 26, 2020
@jkwatson jkwatson merged commit 287eae9 into open-telemetry:master Sep 28, 2020
@jkwatson jkwatson deleted the limited_statuses branch September 30, 2020 17:03
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.

Update allowed span status codes

4 participants