File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/main/java/com/github/_1c_syntax/bsl/languageserver/aop/sentry Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 2424import io .sentry .IScope ;
2525import io .sentry .Sentry ;
2626import io .sentry .protocol .User ;
27+ import jakarta .annotation .Nullable ;
2728import jakarta .annotation .PostConstruct ;
2829import lombok .RequiredArgsConstructor ;
2930import org .eclipse .lsp4j .ServerInfo ;
3031import org .springframework .beans .factory .annotation .Value ;
3132import org .springframework .stereotype .Component ;
3233
34+ import java .net .InetAddress ;
35+ import java .net .UnknownHostException ;
3336import java .util .UUID ;
3437
3538/**
@@ -57,9 +60,10 @@ public void init() {
5760 options .setDsn (dsn );
5861 options .setEnvironment (environment );
5962 options .setRelease (serverInfo .getVersion ());
60- options .setTag ("server.version" , serverInfo .getVersion ());
6163 options .setAttachServerName (false );
64+ options .setServerName (getServerName ());
6265 options .setBeforeSend (beforeSendCallback );
66+ options .addInAppInclude ("com.github._1c_syntax.bsl.languageserver" );
6367 });
6468 }
6569
@@ -70,4 +74,15 @@ public void init() {
7074 });
7175 }
7276
77+ @ Nullable
78+ private String getServerName () {
79+ try {
80+ String hostName = InetAddress .getLocalHost ().getHostName ();
81+ return UUID .nameUUIDFromBytes (hostName .getBytes ()).toString ();
82+ } catch (UnknownHostException e ) {
83+ // ignore
84+ return null ;
85+ }
86+ }
87+
7388}
You can’t perform that action at this time.
0 commit comments