DynamicVeiw Topics

DynamicView uses similar concepts from Impact. As you have seen the DynamicView and impact adatpers can be defined in a unified way.

In this section we only use ZPL: https://zenpack-sdk.zenoss.com/en/latest/ implementation.

Adjusting Order of Component Diagrams

Sometimes your DyanamicView diagrams will not be ordered properly from right to left. In order to get the proper order you can set dynamicview_weight on each component class:

dynamicview_weight: 220
dynamicview_relations:
   impacted_by: [k8sNamespace]

Make sure you order your weights from low to high corresponding to least impacted to most impacted components. For example, your device would probably be the most impacted object, and thus have the highest weight.

Creating a Device-Level DynamicView Diagram

Normally when you select the DynamicView link on the Navigation panel, you would only see the device object in isolation. This is because it isn’t usually impacted by any of its components.

In order to see all objects that impact the device, you have to do two things:

  1. Add JavaScript at the device-level that defines links and views
  2. Adjust your zenpack.yaml file
  3. Restart Zope to test

Adjust your zenpack.yaml

Now comes the easy part where you add some entries to your YAML. Note that we’ll be adding entries for the link called k8s_link and a view for the k8s_view. Each visible component and device in DV must be part of the k8s_view:

classes:

  K8sCluster:
    label: Kubernetes Cluster

    properties:
      cluster_uid:
        label: UID

    dynamicview_views: [service_view, k8s_view]
    dynamicview_weight: 240
    dynamicview_relations:
      impacts: [k8sNodes, k8sNamespaces, gcp_cluster]
      k8s_link: [k8sNodes, k8sNamespaces]

  K8sNamespace:
    label: NameSpace

    properties:
      namespace_uid:
        label: UID

    dynamicview_views: [service_view, k8s_view]
    dynamicview_weight: 225
    dynamicview_relations:
      impacted_by: [k8sCluster]
      impacts: [k8sPods, k8sServices, k8sPersistentVolumes]
      k8s_link: [k8sServices]

  K8sService:
    label: Service

    properties:
      service_uid:
        label: UID

    dynamicview_views: [service_view, k8s_view]
    dynamicview_weight: 215
    dynamicview_relations:
      impacts: [k8sPods]
      impacted_by: [k8sNamespace]

Note

Note that K8sService, while not defining any k8s_link, is referenced by K8sNamespace and thus needs the dynamicview_views line to allow K8sService to be visible in the DV display.

  • Now you can restart Zope to test your setup.

Troubleshooting: You see a DV component that looks out of sorts!

If you see a component that looks like its out of place or wrong, it could be that its Plural Label matches that of another device or component. If so, you can set a unique plural label in ZPL like this:

K8sContainer:
  label: Container
  plural_short_label: K8s Containers

In this example we know that there are several ZenPacks with a component whose label is called Container, which could cause DV to render that object instead of the intended K8s entity. Adding the plural_short_label fixes this problem.