Skip to content

Commit

Permalink
Merge pull request #3 from ostrolucky/eqs-improvements
Browse files Browse the repository at this point in the history
Fix linking with newrelic.distributed_tracing_enabled=1
  • Loading branch information
rguennichi authored May 30, 2024
2 parents 39ddf69 + 164ce60 commit c2c9eb9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Trace/TraceId.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@

class TraceId implements \Stringable
{
public function __construct(private string $value)
public function __construct(private string $fallbackValue)
{
}

public function __toString(): string
{
return $this->value;
return newrelic_get_trace_metadata()['trace_id'] ?? $this->fallbackValue;
}

public function refresh(self $new): void
{
$this->value = $new->value;
$this->fallbackValue = $new->fallbackValue;
}
}

0 comments on commit c2c9eb9

Please sign in to comment.