This is an automated email from the ASF dual-hosted git repository.

avijayan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ambari-metrics.git

commit d27e4865cca0591ea16d92e2e1099ddb32be56fe
Author: Aravindan Vijayan <[email protected]>
AuthorDate: Mon Oct 1 12:56:47 2018 -0700

    [AMBARI-24688] Backend changes for the newer version of AMS Grafana.
---
 ambari-metrics-assembly/pom.xml                    | 13 +++
 .../ambari-metrics/config_ctrl.d.ts                | 18 +++++
 .../ambari-metrics/config_ctrl.js.map              | 18 +++++
 .../ambari-metrics/datasource.js                   |  2 +-
 ambari-metrics-grafana/ambari-metrics/module.js    | 18 +++++
 .../ambari-metrics/module.js.map                   | 18 +++++
 .../partials/annotations.editor.html               | 17 ++++
 ambari-metrics-grafana/ambari-metrics/plugin.json  |  6 +-
 .../ambari-metrics/query_ctrl.d.ts                 | 18 +++++
 .../ambari-metrics/query_ctrl.js.map               | 18 +++++
 ambari-metrics-grafana/conf/unix/ams-grafana.ini   | 93 ++++++++++++++++++++--
 ambari-metrics-grafana/pom.xml                     |  8 +-
 pom.xml                                            |  4 +-
 13 files changed, 231 insertions(+), 20 deletions(-)

diff --git a/ambari-metrics-assembly/pom.xml b/ambari-metrics-assembly/pom.xml
index 6244649..4841f9c 100644
--- a/ambari-metrics-assembly/pom.xml
+++ b/ambari-metrics-assembly/pom.xml
@@ -516,8 +516,20 @@
                       <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>
@@ -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>
diff --git a/ambari-metrics-grafana/ambari-metrics/config_ctrl.d.ts 
b/ambari-metrics-grafana/ambari-metrics/config_ctrl.d.ts
index 33286c8..da4bca7 100644
--- a/ambari-metrics-grafana/ambari-metrics/config_ctrl.d.ts
+++ b/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;
diff --git a/ambari-metrics-grafana/ambari-metrics/config_ctrl.js.map 
b/ambari-metrics-grafana/ambari-metrics/config_ctrl.js.map
index 8c46be5..68d7464 100644
--- a/ambari-metrics-grafana/ambari-metrics/config_ctrl.js.map
+++ b/ambari-metrics-grafana/ambari-metrics/config_ctrl.js.map
@@ -1 +1,19 @@
+/**
+ * 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.
+ */
+
 
{"version":3,"file":"config_ctrl.js","sourceRoot":"","sources":["../../../../../public/app/plugins/datasource/ambari-metrics/config_ctrl.ts"],"names":["AmbariMetricsConfigCtrl","AmbariMetricsConfigCtrl.constructor"],"mappings":"AAAA,oDAAoD;AACpD;;;;;;;;;;;;;;;;GAgBG;;;;;;YAKH;gBAAAA;gBAGAC,CAACA;gBAFUD,mCAAWA,GAAGA,sBAAsBA,CAACA;gBAEhDA,8BAACA;YAADA,CAACA,AAHD,IAGC;YAHD,6DAGC,CAAA"}
\ No newline at end of file
diff --git a/ambari-metrics-grafana/ambari-metrics/datasource.js 
b/ambari-metrics-grafana/ambari-metrics/datasource.js
index e34a1af..9050667 100644
--- a/ambari-metrics-grafana/ambari-metrics/datasource.js
+++ b/ambari-metrics-grafana/ambari-metrics/datasource.js
@@ -52,7 +52,7 @@ define([
         }
 
         options.url = this.url + options.url;
-        options.inspect = {type: 'ambarimetrics'};
+        options.inspect = {type: 'ambari-metrics'};
 
         return backendSrv.datasourceRequest(options);
       };
diff --git a/ambari-metrics-grafana/ambari-metrics/module.js 
b/ambari-metrics-grafana/ambari-metrics/module.js
index ebc4f8a..f122e8e 100644
--- a/ambari-metrics-grafana/ambari-metrics/module.js
+++ b/ambari-metrics-grafana/ambari-metrics/module.js
@@ -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.
+ */
+
 System.register(['./datasource', './query_ctrl', './config_ctrl'], 
function(exports_1) {
     var datasource_1, query_ctrl_1, config_ctrl_1;
     return {
diff --git a/ambari-metrics-grafana/ambari-metrics/module.js.map 
b/ambari-metrics-grafana/ambari-metrics/module.js.map
index 5bdb60e..7faded7 100644
--- a/ambari-metrics-grafana/ambari-metrics/module.js.map
+++ b/ambari-metrics-grafana/ambari-metrics/module.js.map
@@ -1 +1,19 @@
+/**
+ * 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.
+ */
+
 
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../public/app/plugins/datasource/ambari-metrics/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;YAsB+B,6DAAU;YACX,2DAAS;YACR,8DAAU"}
\ No newline at end of file
diff --git 
a/ambari-metrics-grafana/ambari-metrics/partials/annotations.editor.html 
b/ambari-metrics-grafana/ambari-metrics/partials/annotations.editor.html
index e69de29..1d45f3b 100644
--- a/ambari-metrics-grafana/ambari-metrics/partials/annotations.editor.html
+++ b/ambari-metrics-grafana/ambari-metrics/partials/annotations.editor.html
@@ -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.
+  -->
\ No newline at end of file
diff --git a/ambari-metrics-grafana/ambari-metrics/plugin.json 
b/ambari-metrics-grafana/ambari-metrics/plugin.json
index 643da57..69fef3c 100644
--- a/ambari-metrics-grafana/ambari-metrics/plugin.json
+++ b/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",
@@ -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"
+  }
 }
diff --git a/ambari-metrics-grafana/ambari-metrics/query_ctrl.d.ts 
b/ambari-metrics-grafana/ambari-metrics/query_ctrl.d.ts
index 83363f7..dc5ac8c 100644
--- a/ambari-metrics-grafana/ambari-metrics/query_ctrl.d.ts
+++ b/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 {
diff --git a/ambari-metrics-grafana/ambari-metrics/query_ctrl.js.map 
b/ambari-metrics-grafana/ambari-metrics/query_ctrl.js.map
index 2f80a63..19d0f77 100644
--- a/ambari-metrics-grafana/ambari-metrics/query_ctrl.js.map
+++ b/ambari-metrics-grafana/ambari-metrics/query_ctrl.js.map
@@ -1 +1,19 @@
+/**
+ * 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.
+ */
+
 
{"version":3,"file":"query_ctrl.js","sourceRoot":"","sources":["../../../../../public/app/plugins/datasource/ambari-metrics/query_ctrl.ts"],"names":["AmbariMetricsQueryCtrl","AmbariMetricsQueryCtrl.constructor","AmbariMetricsQueryCtrl.targetBlur","AmbariMetricsQueryCtrl.getTextValues","AmbariMetricsQueryCtrl.getCollapsedText","AmbariMetricsQueryCtrl.validateTarget"],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,oDAAoD;;;;;;;;;;;;;;;;;;YAMpD;gBAA4CA,0CAASA;gBAajDA,iBAAiBA;gBACjBA,gCAAYA,MAAM
 [...]
\ No newline at end of file
diff --git a/ambari-metrics-grafana/conf/unix/ams-grafana.ini 
b/ambari-metrics-grafana/conf/unix/ams-grafana.ini
index 78f30b5..9309d49 100644
--- a/ambari-metrics-grafana/conf/unix/ams-grafana.ini
+++ b/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
@@ -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)
@@ -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]
@@ -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
@@ -55,6 +61,8 @@ 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
@@ -62,8 +70,13 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
 ;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
 
@@ -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.
@@ -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 =
 
@@ -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
@@ -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
@@ -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
@@ -204,6 +280,9 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
 ;key_file =
 ;skip_verify = false
 ;from_address = [email protected]
+;from_name = Grafana
+# EHLO identity in SMTP dialog (defaults to instance_name)
+;ehlo_identity = dashboard.example.com
 
 [emails]
 ;welcome_email_on_sign_up = false
@@ -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]
@@ -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
\ No newline at end of file
diff --git a/ambari-metrics-grafana/pom.xml b/ambari-metrics-grafana/pom.xml
index 6ca4f96..266a245 100644
--- a/ambari-metrics-grafana/pom.xml
+++ b/ambari-metrics-grafana/pom.xml
@@ -28,7 +28,7 @@
   <artifactId>ambari-metrics-grafana</artifactId>
   <name>Ambari Metrics Grafana</name>
   <packaging>pom</packaging>
-  <version>2.1.0.0.0</version>
+  <version>2.0.0.0-SNAPSHOT</version>
   <description>Ambari Metrics Grafana</description>
 
   <build>
@@ -124,12 +124,6 @@
                   dest="${project.build.directory}/grafana"
                   compression="gzip"
                   />
-                <copy
-                  
todir="${project.build.directory}/grafana/${grafana.folder}/public/app/plugins/datasource">
-                  <fileset dir="${project.build.directory}/../">
-                    <include name="ambari-metrics/"/>
-                  </fileset>
-                </copy>
               </target>
             </configuration>
           </execution>
diff --git a/pom.xml b/pom.xml
index a655f9e..63069d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,8 +42,8 @@
     <hbase.folder>hbase-2.0.0.3.0.0.0-1634</hbase.folder>
     
<hadoop.tar>http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.0-1634/tars/hadoop/hadoop-3.1.0.3.0.0.0-1634.tar.gz</hadoop.tar>
     <hadoop.folder>hadoop-3.1.0.3.0.0.0-1634</hadoop.folder>
-    <grafana.folder>grafana-2.6.0</grafana.folder>
-    
<grafana.tar>https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0.linux-x64.tar.gz</grafana.tar>
+    <grafana.folder>grafana-5.2.4</grafana.folder>
+    
<grafana.tar>https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.4.linux-amd64.tar.gz</grafana.tar>
     
<phoenix.tar>http://dev.hortonworks.com.s3.amazonaws.com/HDP/centos7/3.x/BUILDS/3.0.0.0-1634/tars/phoenix/phoenix-5.0.0.3.0.0.0-1634.tar.gz</phoenix.tar>
     <phoenix.folder>phoenix-5.0.0.3.0.0.0-1634</phoenix.folder>
     
<resmonitor.install.dir>/usr/lib/python2.6/site-packages/resource_monitoring</resmonitor.install.dir>

Reply via email to