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 24
24
import io .sentry .IScope ;
25
25
import io .sentry .Sentry ;
26
26
import io .sentry .protocol .User ;
27
+ import jakarta .annotation .Nullable ;
27
28
import jakarta .annotation .PostConstruct ;
28
29
import lombok .RequiredArgsConstructor ;
29
30
import org .eclipse .lsp4j .ServerInfo ;
30
31
import org .springframework .beans .factory .annotation .Value ;
31
32
import org .springframework .stereotype .Component ;
32
33
34
+ import java .net .InetAddress ;
35
+ import java .net .UnknownHostException ;
33
36
import java .util .UUID ;
34
37
35
38
/**
@@ -57,9 +60,10 @@ public void init() {
57
60
options .setDsn (dsn );
58
61
options .setEnvironment (environment );
59
62
options .setRelease (serverInfo .getVersion ());
60
- options .setTag ("server.version" , serverInfo .getVersion ());
61
63
options .setAttachServerName (false );
64
+ options .setServerName (getServerName ());
62
65
options .setBeforeSend (beforeSendCallback );
66
+ options .addInAppInclude ("com.github._1c_syntax.bsl.languageserver" );
63
67
});
64
68
}
65
69
@@ -70,4 +74,15 @@ public void init() {
70
74
});
71
75
}
72
76
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
+
73
88
}
You can’t perform that action at this time.
0 commit comments