Skip to content

Commit

Permalink
[AMBARI-24688] Backend changes for the newer version of AMS Grafana.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aravindan Vijayan committed Oct 1, 2018
1 parent aa2dd69 commit d27e486
Show file tree
Hide file tree
Showing 13 changed files with 231 additions and 20 deletions.
13 changes: 13 additions & 0 deletions ambari-metrics-assembly/pom.xml
Expand Up @@ -515,9 +515,21 @@
<mapping>
<directory>/var/lib/ambari-metrics-grafana</directory>
</mapping>
<mapping>
<directory>/var/lib/ambari-metrics-grafana/plugins</directory>
</mapping>
<mapping>
<directory>/var/log/ambari-metrics-grafana</directory>
</mapping>
<mapping>
<directory>/var/lib/ambari-metrics-grafana/plugins/ambari-metrics</directory>
<filemode>755</filemode>
<sources>
<source>
<location>${grafana.dir}/ambari-metrics</location>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</execution>
Expand Down Expand Up @@ -754,6 +766,7 @@
<path>/var/lib/ambari-metrics-collector</path>
<path>/var/lib/ambari-metrics-monitor/lib</path>
<path>/var/lib/ambari-metrics-grafana</path>
<path>/var/lib/ambari-metrics-grafana/plugins</path>
<path>/usr/lib/ambari-metrics-hadoop-sink</path>
<path>/usr/lib/ambari-metrics-kafka-sink</path>
<path>/usr/lib/ambari-metrics-kafka-sink/lib</path>
Expand Down
18 changes: 18 additions & 0 deletions ambari-metrics-grafana/ambari-metrics/config_ctrl.d.ts
@@ -1,3 +1,21 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/// <reference path="../../../../../public/app/headers/common.d.ts" />
export declare class AmbariMetricsConfigCtrl {
static templateUrl: string;
Expand Down
18 changes: 18 additions & 0 deletions ambari-metrics-grafana/ambari-metrics/config_ctrl.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ambari-metrics-grafana/ambari-metrics/datasource.js
Expand Up @@ -52,7 +52,7 @@ define([
}

options.url = this.url + options.url;
options.inspect = {type: 'ambarimetrics'};
options.inspect = {type: 'ambari-metrics'};

return backendSrv.datasourceRequest(options);
};
Expand Down
18 changes: 18 additions & 0 deletions ambari-metrics-grafana/ambari-metrics/module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions ambari-metrics-grafana/ambari-metrics/module.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

@@ -0,0 +1,17 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
6 changes: 3 additions & 3 deletions ambari-metrics-grafana/ambari-metrics/plugin.json
@@ -1,7 +1,7 @@
{
"type": "datasource",
"name": "Ambari Metrics",
"id": "praj-ams-datasource",
"id": "ambari-metrics",
"metrics": true,
"staticRoot": ".",
"defaultMatchFormat": "glob",
Expand All @@ -16,6 +16,6 @@
"small": "img/apache-ambari-logo-sm.png",
"large": "img/apache-ambari-logo.png"
},
"version": "1.0.1",
},
"version": "1.0.1"
}
}
18 changes: 18 additions & 0 deletions ambari-metrics-grafana/ambari-metrics/query_ctrl.d.ts
@@ -1,3 +1,21 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/// <reference path="../../../../../public/app/headers/common.d.ts" />
import { QueryCtrl } from 'app/plugins/sdk';
export declare class AmbariMetricsQueryCtrl extends QueryCtrl {
Expand Down
18 changes: 18 additions & 0 deletions ambari-metrics-grafana/ambari-metrics/query_ctrl.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

93 changes: 86 additions & 7 deletions ambari-metrics-grafana/conf/unix/ams-grafana.ini
@@ -1,4 +1,3 @@

##################### Grafana Configuration Example #####################
#
# Everything has defaults so you only need to uncomment things you want to
Expand All @@ -7,6 +6,9 @@
# possible values : production, development
; app_mode = production

# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty
; instance_name = ${HOSTNAME}

#################################### Paths ####################################
[paths]
# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
Expand All @@ -19,6 +21,11 @@ data = /var/lib/ambari-metrics-grafana
;logs = /var/log/grafana
logs = /var/log/ambari-metrics-grafana

#
# Directory where grafana will automatically scan and look for plugins
#
plugins = /var/lib/ambari-metrics-grafana/plugins


#################################### Server ####################################
[server]
Expand All @@ -45,7 +52,6 @@ logs = /var/log/ambari-metrics-grafana
;router_logging = false

# the path relative working path
;static_root_path = public
static_root_path = /usr/lib/ambari-metrics-grafana/public

# enable gzip
Expand All @@ -55,15 +61,22 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
;cert_file =
;cert_key =

# Unix socket path
;socket =
#################################### Database ####################################
[database]
# Either "mysql", "postgres" or "sqlite3", it's your choice
;type = sqlite3
;host = 127.0.0.1:3306
;name = grafana
;user = root
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
;password =

# Use either URL or the previous fields to configure the database
# Example: mysql://user:secret@host:port/database
;url =

# For "postgres" only, either "disable", "require" or "verify-full"
;ssl_mode = disable

Expand Down Expand Up @@ -92,6 +105,12 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
# Session life time, default is 86400
;session_life_time = 86400

#################################### Data proxy ###########################
[dataproxy]

# This enables data proxy logging, default is false
;logging = false

#################################### Analytics ####################################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
Expand All @@ -100,6 +119,13 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
# Change this option to false to disable reporting.
;reporting_enabled = true

# Set to false to disable all checks to https://grafana.net
# for new vesions (grafana itself and plugins), check is used
# in some UI views to notify that grafana or plugin update exists
# This option does not cause any auto updates, nor send any information
# only a GET request to http://grafana.com to get latest versions
;check_for_updates = true

# Google Analytics universal tracking code, only enabled if you specify an id here
;google_analytics_ua_id =

Expand All @@ -125,6 +151,18 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
# data source proxy whitelist (ip_or_domain:port seperated by spaces)
;data_source_proxy_whitelist =

[snapshots]
# snapshot sharing options
;external_enabled = true
;external_snapshot_url = https://snapshots-origin.raintank.io
;external_snapshot_name = Publish to snapshot.raintank.io

# remove expired snapshot
;snapshot_remove_expired = true

# remove snapshots after 90 days
;snapshot_TTL_days = 90

#################################### Users ####################################
[users]
# disable user signup / registration
Expand All @@ -142,6 +180,21 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
# Background text for the user field on the login page
;login_hint = email or username

# Default UI theme ("dark" or "light")
;default_theme = dark

# External user management, these options affect the organization users view
;external_manage_link_url =
;external_manage_link_name =
;external_manage_info =

[auth]
# Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false
;disable_login_form = false

# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
;disable_signout_menu = false

#################################### Anonymous Auth ##########################
[auth.anonymous]
# enable anonymous access
Expand Down Expand Up @@ -178,6 +231,29 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
;api_url = https://www.googleapis.com/oauth2/v1/userinfo
;allowed_domains =

#################################### Generic OAuth ##########################
[auth.generic_oauth]
;enabled = false
;name = OAuth
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email,read:org
;auth_url = https://foo.bar/login/oauth/authorize
;token_url = https://foo.bar/login/oauth/access_token
;api_url = https://foo.bar/user
;team_ids =
;allowed_organizations =

#################################### Grafana.com Auth ####################
[auth.grafana_com]
;enabled = false
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email
;allowed_organizations =

#################################### Auth Proxy ##########################
[auth.proxy]
;enabled = false
Expand All @@ -204,6 +280,9 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
;key_file =
;skip_verify = false
;from_address = admin@grafana.localhost
;from_name = Grafana
# EHLO identity in SMTP dialog (defaults to instance_name)
;ehlo_identity = dashboard.example.com

[emails]
;welcome_email_on_sign_up = false
Expand All @@ -214,11 +293,11 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
# Use comma to separate multiple modes, e.g. "console, file"
;mode = console, file

# Buffer length of channel, keep it as it is if you don't know what it is.
;buffer_len = 10000
# Either "debug", "info", "warn", "error", "critical", default is "info"
;level = info

# Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
;level = Info
# optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug
;filters =

# For "console" mode only
[log.console]
Expand Down Expand Up @@ -252,4 +331,4 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
[dashboards.json]
;enabled = false
;path = /var/lib/grafana/dashboards
path = /usr/lib/ambari-metrics-grafana/public/dashboards
path = /usr/lib/ambari-metrics-grafana/public/dashboards

0 comments on commit d27e486

Please sign in to comment.