Configure a segment for signals and monitored entities related to multiple Kubernetes clusters in a common stack.
This article is intended for administrators and Kubernetes operators who need to organize and logically structure workloads on Kubernetes clusters.
In this article, you'll learn how to create a segment to conveniently filter observability signals and monitored entities in the Kubernetes domain.
storage:filter-segments:write
and storage:filter-segments:read
permissions. To learn how to set up the permissions, see Permissions in Grail.Create a segment for clusters of a common stack
Include observability signals and monitored entities
Analyze performance and health of entire stack
In our example, a set of a few individual Kubernetes clusters make up a common stack. Together, these clusters form a stack we'll refer to as dtp-dev3
.
dtp-dev3
Signals and entities of K8s clusters of dtp-dev3 deployment
Anyone in the environment
so others can find and use this segmentAt this point, the segment doesn't specify what data it should include. In the next section, we will reference data to be filtered with this segment.
Since Kubernetes observability signals are consistently labelled with k8s.*
dimensions and fields, our segment will make use of that by referencing them directly.
Select Add from data types > All data types
Select Type to filter to include all data matching k8s.cluster.name = dtp-dev3*
Select Run query to get a preview of matching data
Select Save to save your changes
Including observability signals directly doesn't automatically include their emmiting monitored entities. In the next section, we will include those entities specifically.
Select Add from entities and topology > Kubernetes cluster (dt.entity.kubernetes_cluster)
Select Type to filter to include all clusters matching entity.name = dtp-dev3*
Select Run query to get a preview of matching clusters
Select Related entity > Kubernetes namespace
Select Run query for the newly added include block to get a preview of namespaces related to our clusters from above
Select Related entity and select all further related entities of Kubernetes clusters the segment is built around
Currently, monitored entities are included by their individual type. In future, we'll make this more flexible and allow including monitored entities of any type with a single condition.
In this step, we show how to
To analyze general health of our stack in Problems
Go to Problems
Open the segment selector and, in Filter by segments, select the previously created segment dtp-dev3
Select Apply to finish segment selection
Select Update to refresh the problems list
By applying our segment, we get a filtered list of problems affecting any monitored entity of any type in our stack.
To analyze health and performance of services of our stack in Services
Go to Services
Open the segment selector and, in Filter by segments, select the previously created segment dtp-dev3
Select Apply to finish segment selection
By applying our segment, we get a filtered list of services related to any cluster of our stack.
To analyze Kubernetes workloads of our stack in Dashboards
Go to Dashboards
Select Ready-made dashboards
Select Search documents and type Kubernetes
Select Kubernetes Namespaces - Workloads to open the ready-made dashboard
Open the segment selector and, in Filter by segments, select the previously created segment dtp-dev3
Open the dashboard filter Cluster to find clusters filtered for selected segment
By applying our segment, we narrow the context of a dashboard, making it possible to block out all other noise with a single click.
Applying a segment to dashboards will filter for data explicitly included in segment. Some tiles may no longer show results because queried data isn't included in the applied segment.
You’ve configured a segment for a set of Kubernetes clusters that form a common stack. You’ve learned how segments can be applied to conveniently filter data in different apps. You've seen an example how to analyze health and performance of a monitoring environment wihtout having to write or understand a single line of DQL yourself.
Just as for Kubernetes clusters, segments can also be built with the context of Kubernetes namespaces. Simply use k8s.namespace.name
and select all related entities of Kubernetes namespaces (dt.entity.cloud_application_namespace) instead.