Skip to content

Conversation

@deer-wmde
Copy link
Contributor

@deer-wmde deer-wmde commented Jan 26, 2024

https://phabricator.wikimedia.org/T344377

  • remove gluedev/laravel-stackdriver
  • add absszero/laravel-stackdriver-error-reporting

@deer-wmde deer-wmde marked this pull request as ready for review January 29, 2024 17:37
* Register the exception handling callbacks for the application.
*/
public function report(Throwable $e)
public function register()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about this; we just wanted to check that this will behave in the same way as before but is the new recommended way to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the docs this seems to be recommended, although I now realized a reason to override the report function may be if you want to call it yourself when there is no Exception (see section The report helper)

Copy link
Contributor Author

@deer-wmde deer-wmde Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we do this anywhere though. edit: not true, there are in fact 3 occurences of this in our code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I have to correct myself again, after testing locally I could verify that the handler still gets called this way, so we should be good.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe, this is excellent

Copy link
Contributor

@tarrow tarrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this one comment is "fine" and that the error reports coming out look the same then I'm happy for this to me merged :)

@deer-wmde
Copy link
Contributor Author

deer-wmde commented Jan 31, 2024

This is an example of the reported errors that I triggered on monday on staging for testing this:
GCP Error reporting
GCP Logs

Unfortunately it seems there is no matching naturally ocurring instance of this exact error in the last 30 days but what we still can see here is that it gets reported just as other errors before and it also turns up in the console logs

edit: actually looking at the occurences graph it seems like it also appeared last weekend but I struggle to find it in the console UI
edit2: here is a link to the logs where it occured on saturday 27th as well GCP Logs
edit3: aha, and now I see that previously the logName was projects/wikibase-cloud/logs/error-log and now it would be projects/wikibase-cloud/logs/app-error, I will adjust that in the conf

* Register the exception handling callbacks for the application.
*/
public function report(Throwable $e)
public function register()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe, this is excellent

'logName' => env('STACKDRIVER_LOGGING_NAME', 'error-log'),
'serviceId' => env('STACKDRIVER_ERROR_REPORTING_SERVICE_ID', env('APP_NAME')),
'versionId' => env('STACKDRIVER_ERROR_REPORTING_VERSION_ID', '1.0.0'),
'LoggingClient' => [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we mentioned in person it could be good to take 5mins to check if there is a way to make this logging appears as though its from a k8s container and add all the appropriate metadata to make it good; if not then no worries!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dug a bit into this and summarized my findings in the ticket. Seems like it's possible but also couldnt make it work: https://phabricator.wikimedia.org/T344377#9518149

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, let's just go ahead and merge this so we're unblocked on the laravel 10 update. I think we should then (not immediately) revisit our whole strategy and consider "just" logging to stdout/stderr similar to mediawiki

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should then (not immediately) revisit our whole strategy and consider "just" logging to stdout/stderr similar to mediawiki

sounds interesting, happy to talk about and improve this

deer-wmde added a commit that referenced this pull request Feb 7, 2024
@deer-wmde deer-wmde merged commit 873fd21 into main Feb 8, 2024
@deer-wmde deer-wmde deleted the de/google-error-reporting branch February 8, 2024 11:31
deer-wmde added a commit that referenced this pull request Feb 16, 2024
deer-wmde added a commit that referenced this pull request Feb 16, 2024
deer-wmde added a commit that referenced this pull request Feb 26, 2024
* wip composer.json

* WIP - departure to integrate
https://github.com/googleapis/google-cloud-php-errorreporting

* replace `gluedev/laravel-stackdriver`

* configure `absszero/laravel-stackdriver-error-reporting`

see #731

* remove call to `registerPolicies`

see https://laravel.com/docs/10.x/upgrade#register-policies

* schedule redis stale tag pruning

* use `$casts` property

see https://laravel.com/docs/10.x/upgrade#model-dates-property

* run `composer update --ignore-platform-reqs`

Composer version 2.6.5 2023-10-06 10:11:52

* rename `$routeMiddleware`

see https://laravel.com/docs/10.x/upgrade#middleware-aliases

* Apply curated changes from
laravel/laravel@9.x...10.x

* test: php 8.2

* update php version in composer

* remove custom stackdriver repo

* upgrade to phpunit 10

* migrate phpunit configuration

* re-add "absszero/laravel-stackdriver-error-reporting"

* replace CORS Handler

* refactor data providers

* refactor `$this->dispatch` & `dispatchNow`

* fix test class name

* refactor some tests

* update phpunit to 10.5, run composer update

* migrate ElasticSearchIndexDeleteTest.php

* fix deprecated string interpolation

* tests: replace job to queue dispatching with calling handle()

* implement ForceSearchIndex::uniqueId

* move to `dispatch` as mostly recommended example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants