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
c9bfa781
Commit
c9bfa781
authored
Oct 22, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
datasource as cfg: improve name for this feature
parent
ba4bbd1d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
14 deletions
+35
-14
conf/datasources.yaml
+31
-10
pkg/cmd/grafana-server/server.go
+3
-3
pkg/setting/datasources/datasources.go
+1
-1
No files found.
conf/datasources.yaml
View file @
c9bfa781
# purge data source not listed in configuration.
# not recommended in HA setups if config can
# can differ between instances.
purge_other_datasources
:
false
# list of datasources to insert/update depending
# whats available in the datbase
datasources
:
# <string, required> name of the datasource. Required
-
name
:
Graphite
# <string, required> datasource type. Required
type
:
graphite
# <string, required> access mode. direct or proxy. Required
access
:
proxy
# <string, required> url
url
:
http://localhost:8080
password
:
#string
user
:
#string
database
:
#string
basic_auth
:
#bool
basic_authUser
:
#string
basic_auth_password
:
#string
with_credentials
:
#bool
is_default
:
true
#bool
json_data
:
'
{"graphiteVersion":"0.9"}'
# string json
secure_json_fields
:
'
'
#string json
# <string> database password, if used
password
:
# <string> database user, if used
user
:
# <string> database name, if used
database
:
# <bool> enable/disable basic auth
basic_auth
:
# <string> basic auth username
basic_authUser
:
# <string> basic auth password
basic_auth_password
:
# <bool> enable/disable with credentials headers
with_credentials
:
# <bool> mark as default datasource. Max one per org
is_default
:
# <string> json data
json_data
:
'
{"graphiteVersion":"0.9"}'
# <string> json object of data that will be encrypted in UI.
secure_json_fields
:
'
'
-
name
:
Prometheus
type
:
prometheus
access
:
proxy
url
:
http://localhost:9090
pkg/cmd/grafana-server/server.go
View file @
c9bfa781
...
...
@@ -23,7 +23,7 @@ import (
"github.com/grafana/grafana/pkg/services/search"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/setting"
d
sSettings
"github.com/grafana/grafana/pkg/setting/datasources"
d
atasourcesFromConfig
"github.com/grafana/grafana/pkg/setting/datasources"
"github.com/grafana/grafana/pkg/social"
"github.com/grafana/grafana/pkg/tracing"
)
...
...
@@ -56,9 +56,9 @@ func (g *GrafanaServerImpl) Start() {
g
.
writePIDFile
()
initSql
()
err
:=
d
sSettings
.
Init
(
filepath
.
Join
(
setting
.
HomePath
,
"conf/datasources.yaml"
))
err
:=
d
atasourcesFromConfig
.
Apply
(
filepath
.
Join
(
setting
.
HomePath
,
"conf/datasources.yaml"
))
if
err
!=
nil
{
g
.
log
.
Error
(
"Failed to
load
datasources from config"
,
"error"
,
err
)
g
.
log
.
Error
(
"Failed to
configure
datasources from config"
,
"error"
,
err
)
g
.
Shutdown
(
1
,
"Startup failed"
)
return
}
...
...
pkg/setting/datasources/datasources.go
View file @
c9bfa781
...
...
@@ -16,7 +16,7 @@ var (
ErrInvalidConfigToManyDefault
=
errors
.
New
(
"datasource.yaml config is invalid. Only one datasource can be marked as default"
)
)
func
Init
(
configPath
string
)
error
{
func
Apply
(
configPath
string
)
error
{
dc
:=
NewDatasourceConfiguration
()
return
dc
.
applyChanges
(
configPath
)
}
...
...
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