cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Conditional Display of Chart on OOTB Host Screen

guptasahil942
Participant

I have a metric: node_state , which is used to verify the state of node.

topology:
  types:
    - name: custom:host
      displayName: Host
      rules:
        - idPattern: Custom_host_{host}
          instanceNamePattern: "{host}"
          iconPattern: host
          attributes:
            - key: custom_host
              displayName: Custom_Host
              pattern: "{host}"
            - key: custom_host_id
              displayName: Custom_Host_ID
              pattern: "{host_id}"
          sources:
            - sourceType: Metrics
              condition: $prefix(custom.)
metrics:
  - key: custom.node_state
    metadata:
      displayName: Node State
      unit: Count
      sourceEntityType: custom:host
      dimensions:
        - key: metricstate
          displayName: Metric State
        - key: host
          displayName: Host
screens:
  - entityType: HOST
    detailsInjections:
      - type: CHART_GROUP
        key: node_health_status
        conditions:
          - relatedEntity|entitySelectorTemplate=type(custom:host),fromRelationships.isSameAs($(entityConditions))
 
chartsCards:
      - key: node_health_status
        mode: NORMAL
        displayName:  Node Details
        numberOfVisibleCharts: 4
        charts:
          - displayName: Node Health
            visualizationType: GRAPH_CHART
            graphChartConfig:
              stacked: false
              defaultAggregation: MAX
              metrics:
                - metricSelector: custom.node_state:splitBy(host)
                  visualization:
                    displayName: State
                    seriesType: COLUMN
 
If the value of node_state is 1 , it is marked as Bootstrapping

If the value of node_state is 2 , it is marked as Unhealthy

If the value of node_state is 3, it is marked as Healthy

How can I display the same on UI that whether the node is Healthy or Unhealthy ?

I checked in documentation that there is a type called message and a condition called metricAvailable.

Can you please give an example on how metricAvailable can be used in above condition.

Also, if I want to display Healthy/Unhealthy , is it good to use type:message 

Also, for displaying chart , I used query: - metricSelector: custom.node_state:splitBy(host)

But the above query displays details of all the hosts on host screen.

0 REPLIES 0

Featured Posts