25 Nov 2025 09:25 AM
I have been looking a bit deeper into segments recently and tried to cover some of the usecases I previously did with management zones. I've used entity selectors and relationships quite extensively to create MZ rules and add all differnet kind of entities to MZs. The entityselector proved quite powerful for that purpose.
While segments have the power to also work on data not only entities, they do lack the flexibility for entities, making them actually less useful for me.
Think about this MZ inclusion rule, based on ownership labels on a K8s Pod belonging to a Workload:
type(service),fromRelationships.isServiceOf(type(cloud_application),cloudApplicationLabels(dt.owner:my-team))
This will add a service entity that is detected within a K8s workload where the user has "just" provided an ownership label to the MZ (that the owner has access to).
I can even take this further and add individual container group instances, by simply knowing the ownership tag from a process group:
type(container_group_instance),fromRelationships.isInstanceOf(type(container_group), toRelationships.isPgOfCg(type(process_group),tag(dt.owner:my-team)))
With Segments I haven't found a way to do this. The "Data" filter syntax is extremely limited, I can do a equals or a in, but not filter for attributes/labels.
I could create a list of variables that maybe mimics the entityselector and returns all the relationship entities that I'm interested in, but do I really want any user to then select all these variables whenever they use the segment in their UI?
I've seen the very basic usecase of using a hostgroup and some basic tags (no key:value) tags to add classic entities to a segment, but advanced usecases seem to be very difficult to handle because of the limited filter capabilities.
IMO the filter should allow the entityselector (or smartscape relationship selection)
25 Nov 2025 02:03 PM - edited 25 Nov 2025 02:04 PM
Oh, and the in() operator in the filter input field is broken. You can use it in preview, works fine but when you save the Segment:
I'm pretty sure it's not a bug, I'm just doing it wrong 🙂
Featured Posts