-
Notifications
You must be signed in to change notification settings - Fork 192
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
Refactor span context #801
Refactor span context #801
Conversation
src/API/Trace/SpanContextFactory.php
Outdated
public const TRACE_FLAG_DEFAULT = 0x00; | ||
|
||
/** @inheritDoc */ | ||
public static function createFromRemoteParent(string $traceId, string $spanId, int $traceFlags= self::TRACE_FLAG_DEFAULT, ?TraceStateInterface $traceState = null): SpanContextInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think that these methods should stay in SpanContext
.
src/API/Trace/SpanContext.php
Outdated
$this->traceFlags = $traceFlags; | ||
$this->isValid = self::isValidTraceId($this->traceId) && self::isValidSpanId($this->spanId); | ||
$this->isValid = SpanContextValidator::isValidTraceId($this->traceId) && SpanContextValidator::isValidSpanId($this->spanId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be moved into if-block above / should be moved into factory method to be able to reuse ::getInvalid()
singleton.
Changes have been made
PR for #618
Remove use OpenTelemetry\API\Trace as API;
Move factory methods into dedicated factory
Move validation methods into dedicated validatoe
Move constructor and properties to the top