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

fix: flush reporter instead of closing #3

Merged
merged 2 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Jaeger/Jaeger.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public function gen128bit(): void
public function flush(): void
{
$this->reportSpan();
$this->reporter->close();
$this->reporter->flush();
}

private function generateId(): string
Expand Down
5 changes: 5 additions & 0 deletions src/Jaeger/Reporter/NullReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public function report(Jaeger $jaeger)
// no-op
}

public function flush()
{
// no-op
}

public function close()
{
// no-op
Expand Down
5 changes: 5 additions & 0 deletions src/Jaeger/Reporter/RemoteReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public function report(Jaeger $jaeger)
$this->tran->append($jaeger);
}

public function flush()
{
$this->tran->flush();
}

public function close()
{
$this->tran->close();
Expand Down
2 changes: 2 additions & 0 deletions src/Jaeger/Reporter/Reporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ interface Reporter
{
public function report(Jaeger $jaeger);

public function flush();

public function close();
}
2 changes: 2 additions & 0 deletions src/Jaeger/SpanContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public function withBaggageItem(string $key, string $value): \OpenTracing\SpanCo

/**
* {@inheritdoc}
*
* @return \Traversable
*/
public function getIterator()
{
Expand Down