Skip to content
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
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
],
"require": {
"php": ">=8.3",
"cakephp/authentication": "^3.1.1",
"cakephp/cakephp": "^5.1.1",
"cakephp/authentication": "^3.2.1",
"cakephp/cakephp": "^5.1.2",
"cakephp/migrations": "^4.4.2",
"cakephp/plugin-installer": "^2.0.1",
"lcobucci/jwt": "^5.4",
"lcobucci/jwt": "^5.4.2",
"paragonie/csp-builder": "^3.0.1",
"sentry/sentry": "^4.9.0"
"sentry/sentry": "^4.10.0"
},
"require-dev": {
"cakephp/bake": "^3.2.0",
"cakephp/cakephp-codesniffer": "^5.1.3",
"phpstan/phpstan": "^1.12.6",
"phpunit/phpunit": "^10.5.36"
"phpstan/phpstan": "^1.12.11",
"phpunit/phpunit": "^10.5.38"
},
"autoload": {
"psr-4": {
Expand Down
283 changes: 143 additions & 140 deletions composer.lock

Large diffs are not rendered by default.

1,364 changes: 795 additions & 569 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@
"preview": "vite preview"
},
"dependencies": {
"@sentry/vite-plugin": "^2.22.5",
"@sentry/vue": "^8.34.0",
"@sentry/vite-plugin": "^2.22.6",
"@sentry/vue": "^8.39.0",
"axios": "^1.7.7",
"vue": "^3.5.12",
"vue": "^3.5.13",
"vue-router": "^4.4.5",
"vue-select": "^4.0.0-beta.6",
"vuex": "^4.1.0"
},
"devDependencies": {
"@codecov/vite-plugin": "^1.2.0",
"@codecov/vite-plugin": "^1.4.0",
"@rushstack/eslint-patch": "^1.10.4",
"@vitejs/plugin-vue": "^5.1.4",
"@vue/eslint-config-prettier": "^10.0.0",
"@vitejs/plugin-vue": "^5.2.0",
"@vue/eslint-config-prettier": "^10.1.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.12.0",
"eslint-plugin-vue": "^9.29.0",
"postcss": "^8.4.47",
"eslint": "^9.15.0",
"eslint-plugin-vue": "^9.31.0",
"postcss": "^8.4.49",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.13",
"vite": "^5.4.9"
"tailwindcss": "^3.4.15",
"vite": "^5.4.11"
}
}
6 changes: 3 additions & 3 deletions potal/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ require (
github.com/getsentry/sentry-go v0.29.1
github.com/google/go-cmp v0.5.9
github.com/julienschmidt/httprouter v1.3.0
github.com/slack-go/slack v0.14.0
github.com/slack-go/slack v0.15.0
)

require (
github.com/gorilla/websocket v1.5.3 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
)
6 changes: 6 additions & 0 deletions potal/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/slack-go/slack v0.14.0 h1:6c0UTfbRnvRssZUsZ2qe0Iu07VAMPjRqOa6oX8ewF4k=
github.com/slack-go/slack v0.14.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/slack-go/slack v0.15.0 h1:LE2lj2y9vqqiOf+qIIy0GvEoxgF1N5yLGZffmEZykt0=
github.com/slack-go/slack v0.15.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
20 changes: 0 additions & 20 deletions src/Controller/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
use App\Event\EventFactory;
use Cake\Controller\Controller;
use Cake\Http\Response;
use Sentry\Metrics\MetricsUnit;
use Sentry\SentrySdk;
use function Sentry\metrics;

class EventsController extends Controller
{
Expand All @@ -33,24 +31,6 @@ public function index(): Response
$event = EventFactory::createEvent($this->request->getData());
$event->process();

metrics()->distribution(
key: 'gibpotato.potatoes.event_processing_time',
value: microtime(true) - $startTimestamp,
unit: MetricsUnit::second(),
tags: [
'event_type' => $event->getType(),
],
);

metrics()->distribution(
key: 'gibpotato.potatoes.event_size',
value: mb_strlen(serialize($this->request->getData()), '8bit'),
unit: MetricsUnit::byte(),
tags: [
'event_type' => $event->getType(),
],
);

$span = SentrySdk::getCurrentHub()->getSpan();
if ($span !== null) {
$span->setData([
Expand Down
9 changes: 0 additions & 9 deletions src/Middleware/SentryMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Sentry\Metrics\MetricsUnit;
use Sentry\SentrySdk;
use Sentry\Tracing\SpanContext;
use Sentry\Tracing\TransactionContext;
use Sentry\Tracing\TransactionSource;
use function microtime;
use function Sentry\metrics;
use function Sentry\startTransaction;

/**
Expand Down Expand Up @@ -78,19 +76,12 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
->setData([
'gibpotato.gcp.mem_peak_usage' => memory_get_peak_usage(false),
]);

metrics()->distribution(
key: 'gibpotato.gcp.mem_peak_usage',
value: memory_get_peak_usage(false),
unit: MetricsUnit::byte(),
);
}

EventManager::instance()->on(
'Server.terminate',
function (Event $event) use ($transaction): void {
$transaction->finish();
metrics()->flush();
},
);

Expand Down
8 changes: 0 additions & 8 deletions src/Middleware/SentryUserMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Sentry\Metrics\MetricsUnit;
use Sentry\SentrySdk;
use Sentry\State\Scope;
use function Sentry\metrics;

/**
* SentryUser middleware
Expand All @@ -35,12 +33,6 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
'username' => $user->slack_name,
]);

metrics()->set(
key: 'gibpotato.users.web_ui',
value: $user->id,
unit: MetricsUnit::custom('user_id'),
);

$span = $scope->getSpan();
if ($span !== null) {
$span->setData([
Expand Down
8 changes: 0 additions & 8 deletions src/Service/AwardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use App\Event\ReactionAddedEvent;
use App\Model\Entity\User;
use Cake\ORM\Locator\LocatorAwareTrait;
use Sentry\Metrics\MetricsUnit;
use Sentry\SentrySdk;
use function Sentry\metrics;

class AwardService
{
Expand Down Expand Up @@ -63,12 +61,6 @@ private function gibToUser(
]);
$messagesTable->saveOrFail($message);

metrics()->increment(
key: 'gibpotato.potatoes.given_out',
value: $event->amount,
unit: MetricsUnit::custom('potato'),
);

$span = SentrySdk::getCurrentHub()->getSpan();
if ($span !== null) {
$span->setData([
Expand Down
8 changes: 0 additions & 8 deletions src/Service/QuickWinService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use App\Model\Entity\QuickWin;
use App\Model\Entity\User;
use Cake\ORM\Locator\LocatorAwareTrait;
use Sentry\Metrics\MetricsUnit;
use Sentry\SentrySdk;
use function Sentry\metrics;

class QuickWinService
{
Expand Down Expand Up @@ -43,12 +41,6 @@ public function store(
]);
$quickWinsTable->saveOrFail($quickWin);

metrics()->increment(
key: 'gibpotato.message.quick_win',
value: 1,
unit: MetricsUnit::custom('tags'),
);

$span = SentrySdk::getCurrentHub()->getSpan();
if ($span !== null) {
$span->setData([
Expand Down
Loading