Skip to content

Commit

Permalink
Depreacte SpanStatus::resourceExchausted() (#1725)
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric authored Apr 2, 2024
1 parent 76a2184 commit 36345f6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions src/Tracing/SpanStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,22 @@ public static function failedPrecondition(): self
* Gets an instance of this enum representing the fact that the server returned
* 429 Too Many Requests.
*/
public static function resourceExchausted(): self
public static function resourceExhausted(): self
{
return self::getInstance('resource_exhausted');
}

/**
* Gets an instance of this enum representing the fact that the server returned
* 429 Too Many Requests.
*
* @deprecated since version 4.7. To be removed in version 5.0. Use SpanStatus::resourceExhausted() instead.
*/
public static function resourceExchausted(): self
{
return self::resourceExhausted();
}

/**
* Gets an instance of this enum representing the fact that the server returned
* 501 Not Implemented.
Expand Down Expand Up @@ -163,7 +174,7 @@ public static function createFromHttpStatusCode(int $statusCode): self
case $statusCode === 413:
return self::failedPrecondition();
case $statusCode === 429:
return self::resourceExchausted();
return self::resourceExhausted();
case $statusCode === 501:
return self::unimplemented();
case $statusCode === 503:
Expand Down
2 changes: 1 addition & 1 deletion tests/Monolog/BreadcrumbHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static function handleDataProvider(): iterable
];

yield 'with context' => [
RecordFactory::create('foo bar', Logger::DEBUG, 'channel.foo', ['context' => ['foo' => 'bar']], []),
RecordFactory::create('foo bar', Logger::DEBUG, 'channel.foo', ['context' => ['foo' => 'bar']], []),
$defaultBreadcrumb->withMetadata('context', ['foo' => 'bar']),
];

Expand Down
2 changes: 1 addition & 1 deletion tests/Tracing/SpanStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static function toStringDataProvider(): iterable
];

yield [
SpanStatus::resourceExchausted(),
SpanStatus::resourceExhausted(),
'resource_exhausted',
];

Expand Down

0 comments on commit 36345f6

Please sign in to comment.