Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
01ea3337
Commit
01ea3337
authored
8 years ago
by
Jeromy Johnson
Committed by
GitHub
8 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3315 from ipfs/fix/metrics-injection
Fix metrics injection
parents
716aa867
06a5381c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
cmd/ipfs/daemon.go
cmd/ipfs/daemon.go
+7
-4
test/sharness/t0600-issues-and-regressions-online.sh
test/sharness/t0600-issues-and-regressions-online.sh
+6
-0
No files found.
cmd/ipfs/daemon.go
View file @
01ea3337
...
...
@@ -181,6 +181,13 @@ func defaultMux(path string) corehttp.ServeOption {
var
fileDescriptorCheck
=
func
()
error
{
return
nil
}
func
daemonFunc
(
req
cmds
.
Request
,
res
cmds
.
Response
)
{
// Inject metrics before we do anything
err
:=
mprome
.
Inject
()
if
err
!=
nil
{
log
.
Errorf
(
"Injecting prometheus handler for metrics failed with message: %s
\n
"
,
err
.
Error
())
}
// let the user know we're going.
fmt
.
Printf
(
"Initializing daemon...
\n
"
)
...
...
@@ -388,10 +395,6 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
}
// initialize metrics collector
err
=
mprome
.
Inject
()
if
err
!=
nil
{
log
.
Warningf
(
"Injecting prometheus handler for metrics failed with message: %s
\n
"
,
err
.
Error
())
}
prometheus
.
MustRegister
(
&
corehttp
.
IpfsNodeCollector
{
Node
:
node
})
fmt
.
Printf
(
"Daemon is ready
\n
"
)
...
...
This diff is collapsed.
Click to expand it.
test/sharness/t0600-issues-and-regressions-online.sh
View file @
01ea3337
...
...
@@ -27,6 +27,12 @@ test_expect_success "no panic traces on daemon" '
test_must_fail grep "nil pointer dereference" daemon_err
'
test_expect_success
"metrics work"
'
curl "$API_ADDR/debug/metrics/prometheus" > pro_data &&
grep "ipfs_bs_cache_arc_hits_total" < pro_data ||
test_fsh cat pro_data
'
test_kill_ipfs_daemon
test_expect_success
"ipfs daemon --offline --mount fails - #2995"
'
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment