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

Refactoring tracer api #12

Merged
merged 8 commits into from
Feb 9, 2024
Merged

Refactoring tracer api #12

merged 8 commits into from
Feb 9, 2024

Conversation

cappuc
Copy link
Contributor

@cappuc cappuc commented Feb 9, 2024

  • Added new SpanBuilder which allows to create and start a span with fluent syntax:
Tracer::newSpan('name')->setSpanKind(SpanKind::KIND_SERVER)->start();
  • Removed Tracer::start, Tracer::measure, moved to span builder:
Tracer::newSpan('name')->start();
Tracer::newSpan('name')->measure(callback);
  • Removed Tracer::measureAsync (it was like measure with span kind PRODUCER), replaced with:
Tracer::newSpan('name')->setSpanKind(SpanKind::KIND_PRODUCER)->measure(callback);
  • Removed Tracer::recordExceptionToSpan, use span methods directly:
$span->recordException($exception)
 ->setStatus(StatusCode::STATUS_ERROR); // optional, recordExceptionToSpan was setting the status to error
  • Removed Tracer::setRootSpan($span), it was only used to share traceId with log context. This has been replaced with Tracer::updateLogContext()

@cappuc cappuc marked this pull request as ready for review February 9, 2024 16:25
@cappuc cappuc merged commit d2d4fe8 into main Feb 9, 2024
14 checks passed
@cappuc cappuc deleted the refactoring-tracer branch February 14, 2024 09:12
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.

1 participant