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

Depreacte SpanStatus::resourceExchausted() #1725

Merged
merged 1 commit into from
Apr 2, 2024
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
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
Loading