opentelemetry-erlang icon indicating copy to clipboard operation
opentelemetry-erlang copied to clipboard

Fix `OpenTelemetry.Tracer.end_span` return type spec

Open RudolfMan opened this issue 1 year ago • 4 comments

Hi there!

Based on the specs of otel_span:end_span/0,1 this Tracer.end_span/0,1 is supposed to always return span context (:undefined is not an option for the return)

See here: https://github.com/open-telemetry/opentelemetry-erlang/blob/0a38bd4765c9f3efbf5e5b40e95783b9df97e2a7/apps/opentelemetry_api/src/otel_span.erl#L291-L306

RudolfMan avatar Nov 04 '24 07:11 RudolfMan

I believe the otel_tracer.erl may be the incorrect one as SpanCtx could be undefined. Not positive yet, but that is my guess here.

tsloughter avatar Nov 04 '24 11:11 tsloughter

@RudolfMan any update? I think you actually need to update otel_tracer to have undefined as a valid return of end_span.

tsloughter avatar Nov 22 '24 11:11 tsloughter

Just updated, @tsloughter!

RudolfMan avatar Nov 22 '24 13:11 RudolfMan

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 17.32%. Comparing base (0a969d1) to head (913e583). Report is 127 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #796   +/-   ##
=======================================
  Coverage   17.32%   17.32%           
=======================================
  Files          24       24           
  Lines         710      710           
=======================================
  Hits          123      123           
  Misses        587      587           
Flag Coverage Δ
api 17.32% <ø> (ø)
elixir 17.32% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 26 '24 20:11 codecov[bot]