Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
7cbaf060
Commit
7cbaf060
authored
Jun 03, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(instrumentation): check if enabled in http api metrics route
parent
1059a35b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
pkg/api/metrics.go
+5
-0
pkg/metrics/settings.go
+1
-1
No files found.
pkg/api/metrics.go
View file @
7cbaf060
...
...
@@ -9,6 +9,7 @@ import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/util"
)
func
GetTestMetrics
(
c
*
middleware
.
Context
)
{
...
...
@@ -40,6 +41,10 @@ func GetTestMetrics(c *middleware.Context) {
}
func
GetInternalMetrics
(
c
*
middleware
.
Context
)
Response
{
if
metrics
.
UseNilMetrics
{
return
Json
(
200
,
util
.
DynMap
{
"message"
:
"Metrics disabled"
})
}
snapshots
:=
metrics
.
MetricStats
.
GetSnapshots
()
resp
:=
make
(
map
[
string
]
interface
{})
...
...
pkg/metrics/settings.go
View file @
7cbaf060
...
...
@@ -38,7 +38,7 @@ func readSettings() *MetricSettings {
if
graphitePublisher
,
err
:=
CreateGraphitePublisher
();
err
!=
nil
{
log
.
Error
(
3
,
"Metrics: Failed to init Graphite metric publisher"
,
err
)
}
else
if
graphitePublisher
!=
nil
{
log
.
Info
(
"Metrics:
Internal metrics publisher Graphite
initialized"
)
log
.
Info
(
"Metrics:
Graphite publisher
initialized"
)
settings
.
Publishers
=
append
(
settings
.
Publishers
,
graphitePublisher
)
}
...
...
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