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

Отправка исключений в Sentry #2794

Merged
merged 20 commits into from
Jul 18, 2022
Merged

Conversation

nixel2007
Copy link
Member

@nixel2007 nixel2007 commented Jun 3, 2022

Описание

Отправка уведомлений об ошибках в Sentry. Три режима отправки:

  • спросить
  • отправлять
  • не отправлять

Четыре возможных ответа на вопрос:

  • отправлять
  • отправить только сейчас
  • не отправлять
  • пропустить текущую ошибку

Связанные задачи

Closes

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Для диагностик

  • Описание диагностики заполнено для обоих языков (присутствуют файлы для обоих языков, для русского заполнено все подробно, перевод на английский можно опустить)

Дополнительно

@sonarcloud
Copy link

sonarcloud bot commented Jun 3, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 12 Code Smells

20.8% 20.8% Coverage
0.0% 0.0% Duplication

@nixel2007 nixel2007 force-pushed the feature/sentry branch 3 times, most recently from 0f16ec3 to 1929d56 Compare July 14, 2022 20:52
@nixel2007 nixel2007 marked this pull request as ready for review July 15, 2022 15:10
@sonarcloud
Copy link

sonarcloud bot commented Jul 15, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

73.7% 73.7% Coverage
0.0% 0.0% Duplication

https://sentry.io/organizations/1c-syntax/projects/bsl-language-server

К сожалению, особенности настройки доступа к Sentry.io ограничивают возможность просмотра данных
неавторизованным пользователям.
Copy link
Contributor

Choose a reason for hiding this comment

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

Проверил ссылку, я авторизован через гитхаб, но указанный проект не вижу

Copy link
Contributor

Choose a reason for hiding this comment

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

возможно, права на проект в Сентри есть только у мейнтейнеров бсл лс?

Copy link
Contributor

Choose a reason for hiding this comment

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

получил ошибку Authentication error: You do not have access to the required GitHub organization.

Copy link
Member Author

Choose a reason for hiding this comment

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

Да, проект виден только участникам 1c-syntax.

Отсутствие ответа воспринимается как "не отправлять эту ошибку, но спросить снова".

Сообщение об ошибке не содержит идентификационных данных пользователя или рабочей станции
за исключением генерируемого UUID сессии для связывания ошибок, возникающих в течении одного
Copy link
Contributor

Choose a reason for hiding this comment

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

запятая перед "за исключением"

Copy link
Member Author

Choose a reason for hiding this comment

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

Я вот не уверен....

Copy link
Contributor

Choose a reason for hiding this comment

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

используй синоним "кроме". а перед ним запятая точно обязательна!


Если вы включите отладочные логи (настроив `logback` или используя переменные среды), содержимое логов (последние 100 записей) приложится к отправляемому событию.

Некоторые сообщения, пересылаемые между Language Client и BSL Language Server содержат фрагменты исходного кода
Copy link
Contributor

Choose a reason for hiding this comment

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

запятая перед содержат


Пример отправляемого события об ошибке:

??? event.json
Copy link
Contributor

Choose a reason for hiding this comment

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

что за "???"

Copy link
Member Author

Choose a reason for hiding this comment

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

Spoiler в mkdocs

"type": "RuntimeException",
"value": "psss",
"module": "java.lang",
"stacktrace": {
Copy link
Contributor

Choose a reason for hiding this comment

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

стек-трейс в обратном порядке выдается или нет?

Copy link
Member Author

Choose a reason for hiding this comment

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

Не знаю. А какая разница? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

тогда остается убедиться, что ты в сентри стек-трейс смотрел.
там в каком виде выдается?
ошибка сверху или нет? )

Copy link
Member Author

Choose a reason for hiding this comment

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

В сентри оно выглядит как обычно - от глубокого к верхнему. Плюс этот файл генерит sentry sdk, а не я, они, думаю, знают в каком виде слать себе эксепшены :)

map.put(Resources.getResourceString(language, clazz, "answer_sendOnce"), SendErrorsMode.SEND_ONCE);
map.put(Resources.getResourceString(language, clazz, "answer_skip"), SendErrorsMode.ASK);
map.put(Resources.getResourceString(language, clazz, "answer_send"), SendErrorsMode.SEND);
map.put(Resources.getResourceString(language, clazz, "answer_dontSend"), SendErrorsMode.NEVER);
Copy link
Contributor

Choose a reason for hiding this comment

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

А почему ИД ресурсов не в константах?

Copy link
Member Author

Choose a reason for hiding this comment

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

Было лень :)

@NoArgsConstructor
public class SentryAspect {

private final ExecutorService executorService = Executors.newCachedThreadPool();
Copy link
Member Author

Choose a reason for hiding this comment

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

Забыл закрыть

@nixel2007 nixel2007 merged commit f1d67b1 into develop Jul 18, 2022
@nixel2007 nixel2007 deleted the feature/sentry branch July 18, 2022 09:32
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.

2 participants