Skip to content

Commit

Permalink
even more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael-theriault-swi committed Nov 28, 2023
1 parent 6bcc476 commit 2474b43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/sdk/src/parent-info-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { type Context, trace, TraceFlags } from "@opentelemetry/api"
import { type Context, diag, trace, TraceFlags } from "@opentelemetry/api"
import {
NoopSpanProcessor,
type ReadableSpan,
Expand All @@ -25,6 +25,8 @@ import { cache } from "./cache"

export class SwParentInfoSpanProcessor extends NoopSpanProcessor {
override onStart(span: Span, parentContext: Context): void {
diag.debug("span start", span)

const spanContext = span.spanContext()
const parentSpanContext = trace.getSpanContext(parentContext)

Expand All @@ -34,6 +36,8 @@ export class SwParentInfoSpanProcessor extends NoopSpanProcessor {
}

override onEnd(span: ReadableSpan): void {
diag.debug("span end", span)

const spanContext = span.spanContext()
// clear here unless sampled in which case the exporter takes care of it
if (!(spanContext.traceFlags & TraceFlags.SAMPLED)) {
Expand Down

0 comments on commit 2474b43

Please sign in to comment.