File tree 1 file changed +8
-0
lines changed
src/main/java/com/gitblit/guice
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 44
44
import com .gitblit .servlet .SyndicationServlet ;
45
45
import com .gitblit .wicket .GitblitWicketFilter ;
46
46
import com .google .common .base .Joiner ;
47
+ import com .google .inject .Scopes ;
47
48
import com .google .inject .servlet .ServletModule ;
49
+ import io .prometheus .client .exporter .MetricsServlet ;
50
+ import io .prometheus .client .hotspot .DefaultExports ;
48
51
49
52
/**
50
53
* Defines all the web servlets & filters.
@@ -79,6 +82,11 @@ protected void configureServlets() {
79
82
serve ("/robots.txt" ).with (RobotsTxtServlet .class );
80
83
serve ("/logo.png" ).with (LogoServlet .class );
81
84
85
+ // Prometheus
86
+ bind (MetricsServlet .class ).in (Scopes .SINGLETON );
87
+ serve ("/prometheus" ).with (MetricsServlet .class );
88
+ DefaultExports .initialize ();
89
+
82
90
/* Prevent accidental access to 'resources' such as GitBlit java classes
83
91
*
84
92
* In the GO setup the JAR containing the application and the WAR injected
You can’t perform that action at this time.
0 commit comments