Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

unable to add component metrics widgets

unable to add component metrics widgets

New Contributor

I wrote a component for ambari and the metrics widgets. However i can't add the widgets for this component. I think i need some help...

my ambari version is 2.5.2 and i check the web problem.
when i open the page of this component page, it shows as

app.js:66933 Uncaught TypeError: Cannot read property 'WidgetLayoutInfo' of undefined    
at Class.createUserWidgetLayout (app.js:66933)    
at Class.<anonymous> (app.js:66874)    
at o (vendor.js:125)   
 at Object.fireWith [as resolveWith] (vendor.js:125)   
at w (vendor.js:127)    
at XMLHttpRequest.d (vendor.js:127)

when i try to add widget.it shows as

app.js:26574 Uncaught TypeError: activeLayout.get is not a function    
at Class.addWidget (app.js:26574)    
at handler (vendor.js:21227)    
at HTMLButtonElement.<anonymous> (vendor.js:13019)    
at HTMLDivElement.dispatch (vendor.js:126)    
at HTMLDivElement.i (vendor.js:126)

finaly i try to create a widgets, the console shows as

app.js:85210 Uncaught TypeError: Cannot read property 'mapProperty' of undefined    
at Class.createServiceWidget (app.js:85210)    
at Class.sendRecursively (vendor.js:17348)    
at Class.sendRecursively (vendor.js:17352)    
at Class.sendRecursively (vendor.js:17352)    
at Class.sendRecursively (vendor.js:17352)    
at Class.send (vendor.js:17333)   
 at Class.createWidget (app.js:26730)    
at Class.createWidget (app.js:26849)   
 at handler (vendor.js:21227)    
at HTMLButtonElement.<anonymous> (vendor.js:13019)

this is my metainfo.xml

<metainfo>
    <schemaVersion>2.0</schemaVersion>
    <services>
        <service>
            <name>REDISCLUSTER</name>
            <displayName>Redis Cluster</displayName>
            <comment>the componment of redis cluster</comment>
            <version>4.0.8</version>
            <components>
                <component>
                    <name>REDIS_SERVER</name>
                    <displayName>redis server</displayName>
                    <category>MASTER</category>
                    <cardinality>1+</cardinality>
                    <timelineAppid>rediscluster</timelineAppid>
                    <commandScript>
                        <script>scripts/server.py</script>
                        <scriptType>PYTHON</scriptType>
                        <timeout>600</timeout>
                    </commandScript>
                </component>
            </components>
            <osSpecifics>
                <osSpecific>
                    <osFamily>any</osFamily>
                </osSpecific>
            </osSpecifics>
        </service>
    </services>
</metainfo>

this is my metrics.json

{
   "REDIS_SERVER": {
      "Component": [
         {
            "type": "ganglia",
            "metrics": {
               "default": {

                  "metrics/redis_cluster_used_memory": {
                     "metric": "redis_cluster_used_memory",
                     "pointInTime": true,
                     "temporal": true
                  },

                  "metrics/redis_cluster_maxmemory": {
                     "metric": "redis_cluster_maxmemory",
                     "pointInTime": true,
                     "temporal": true
                  },

                  "metrics/redis_cluster_used_memory_rss": {
                     "metric": "redis_cluster_used_memory_rss",
                     "pointInTime": true,
                     "temporal": true
                  },

                  "metrics/redis_cluster_used_memory_peak": {
                     "metric": "redis_cluster_used_memory_peak",
                     "pointInTime": true,
                     "temporal": true
                  },

                  "metrics/redis_cluster_mem_fragmentation_ratio": {
                     "metric": "redis_cluster_mem_fragmentation_ratio",
                     "pointInTime": true,
                     "temporal": true
                  },

                  "metrics/redis_cluster_instantaneous_input_kbps": {
                     "metric": "redis_cluster_instantaneous_input_kbps",
                     "pointInTime": true,
                     "temporal": true
                  },

                  "metrics/redis_cluster_instantaneous_output_kbps": {
                     "metric": "redis_cluster_instantaneous_output_kbps",
                     "pointInTime": true,
                     "temporal": true
                  },

                  "metrics/redis_cluster_rejected_connections": {
                     "metric": "redis_cluster_rejected_connections",
                     "pointInTime": true,
                     "temporal": true
                  },

                  "metrics/redis_cluster_keyspace_hits": {
                     "metric": "redis_cluster_keyspace_hits",
                     "pointInTime": true,
                     "temporal": true
                  },

                  "metrics/redis_cluster_keyspace_misses": {
                     "metric": "redis_cluster_keyspace_misses",
                     "pointInTime": true,
                     "temporal": true
                  },

                  "metrics/redis_cluster_used_cpu_sys": {
                     "metric": "redis_cluster_used_cpu_sys",
                     "pointInTime": true,
                     "temporal": true
                  }

               }
            }
         }
      ]
   }
}

this is my widgets.json

{
   "layouts": [
      {
         "layout_name": "default_redis_cluster_dashboard",
         "display_name": "Standard Redis Cluster Dashboard",
         "section_name": "REDISCLUSTER_SUMMARY",
         "widgetLayoutInfo": [
            {
               "widget_name": "redis_cluster_used_memory",
               "description": "Redis used memory widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_used_memory",
                     "metric_path": "metrics/redis_cluster_used_memory",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_used_memory",
                     "value": "${redis_cluster_used_memory}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            },
            {
               "widget_name": "redis_cluster_maxmemory",
               "description": "Redis maxmemory widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_maxmemory",
                     "metric_path": "metrics/redis_cluster_maxmemory",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_maxmemory",
                     "value": "${redis_cluster_maxmemory}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            },
            {
               "widget_name": "redis_cluster_used_memory_rss",
               "description": "Redis used_memory_rss widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_used_memory_rss",
                     "metric_path": "metrics/redis_cluster_used_memory_rss",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_used_memory_rss",
                     "value": "${redis_cluster_used_memory_rss}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            },
            {
               "widget_name": "redis_cluster_used_memory_peak",
               "description": "Redis used_memory_peak widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_used_memory_peak",
                     "metric_path": "metrics/redis_cluster_used_memory_peak",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_used_memory_peak",
                     "value": "${redis_cluster_used_memory_peak}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            },
            {
               "widget_name": "redis_cluster_mem_fragmentation_ratio",
               "description": "Redis mem_fragmentation_ratio widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_mem_fragmentation_ratio",
                     "metric_path": "metrics/redis_cluster_mem_fragmentation_ratio",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_mem_fragmentation_ratio",
                     "value": "${redis_cluster_mem_fragmentation_ratio}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            },
            {
               "widget_name": "redis_cluster_instantaneous_input_kbps",
               "description": "Redis instantaneous_input_kbps widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_instantaneous_input_kbps",
                     "metric_path": "metrics/redis_cluster_instantaneous_input_kbps",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_instantaneous_input_kbps",
                     "value": "${redis_cluster_instantaneous_input_kbps}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            },
            {
               "widget_name": "redis_cluster_instantaneous_output_kbps",
               "description": "Redis instantaneous_output_kbps widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_instantaneous_output_kbps",
                     "metric_path": "metrics/redis_cluster_instantaneous_output_kbps",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_instantaneous_output_kbps",
                     "value": "${redis_cluster_instantaneous_output_kbps}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            },
            {
               "widget_name": "redis_cluster_rejected_connections",
               "description": "Redis rejected_connections widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_rejected_connections",
                     "metric_path": "metrics/redis_cluster_rejected_connections",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_rejected_connections",
                     "value": "${redis_cluster_rejected_connections}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            },
            {
               "widget_name": "redis_cluster_keyspace_hits",
               "description": "Redis keyspace_hits widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_keyspace_hits",
                     "metric_path": "metrics/redis_cluster_keyspace_hits",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_keyspace_hits",
                     "value": "${redis_cluster_keyspace_hits}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            },
            {
               "widget_name": "redis_cluster_keyspace_misses",
               "description": "Redis keyspace_misses widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_keyspace_misses",
                     "metric_path": "metrics/redis_cluster_keyspace_misses",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_keyspace_misses",
                     "value": "${redis_cluster_keyspace_misses}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            },
            {
               "widget_name": "redis_cluster_used_cpu_sys",
               "description": "Redis used_cpu_sys widget",
               "default_section_name": "REDISCLUSTER_SUMMARY",
               "widget_type": "GRAPH",
               "is_visible": true,
               "metrics": [
                  {
                     "name": "redis_cluster_used_cpu_sys",
                     "metric_path": "metrics/redis_cluster_used_cpu_sys",
                     "service_name": "REDISCLUSTER",
                     "component_name": "REDIS_SERVER"
                  }
               ],
               "values": [
                  {
                     "name": "redis_cluster_used_cpu_sys",
                     "value": "${redis_cluster_used_cpu_sys}"
                  }
               ],
               "properties": {
                  "graph_type": "LINE",
                  "time_range": "1"
               }
            }
         ]
      }
   ]
}
Don't have an account?
Coming from Hortonworks? Activate your account here