-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stuttering removed - GRPCServer renamed to just Server and similarly for http and restproxyserver. grpcserver now accepts 'port' as an argument instead of getting the value from the environment. metricsServer creation is now a single method AB#9031
- Loading branch information
Showing
6 changed files
with
123 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
.viminfo | ||
.local/ | ||
.vscode/ | ||
.bash_history | ||
.viminfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package metrics | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/datatrails/go-datatrails-common/httpserver" | ||
) | ||
|
||
type HTTPServer struct { | ||
*httpserver.Server | ||
metrics *Metrics | ||
} | ||
|
||
func NewServer(log Logger, serviceName string, port string, opts ...MetricsOption) HTTPServer { | ||
m := New( | ||
log, | ||
serviceName, | ||
port, | ||
) | ||
return HTTPServer{ | ||
httpserver.New(log, fmt.Sprintf("metrics %s", serviceName), port, m.newPromHandler()), | ||
m, | ||
} | ||
} | ||
|
||
func (h *HTTPServer) Metrics() *Metrics { | ||
return h.metrics | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.