<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Segments: include entities and related metrics/traces in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Segments-include-entities-and-related-metrics-traces/m-p/294706#M3150</link>
    <description>&lt;P&gt;I have just started to play around with segments and I hope that someone could help me how to include metrics and traces from entities to be part of segment definition.&lt;BR /&gt;&lt;BR /&gt;I have currently the following variable in place on my segment definition and it picks the SAMPLE_TAG values correctly.&lt;BR /&gt;&lt;BR /&gt;fetch dt.entity.service, from: -10d&lt;BR /&gt;| expand tag = tags&lt;BR /&gt;| fields tag&lt;BR /&gt;| filter startsWith(tag, "SAMPLE_TAG")&lt;BR /&gt;| dedup tag&lt;BR /&gt;| parse tag, "LD ':' LD:Service"&lt;BR /&gt;| fields Service,tag&lt;BR /&gt;&lt;BR /&gt;And I have the following filter definition in place to pick the entities which are containing the SAMPLE_TAG.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="janneolkoniemi_1-1770969469694.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/32005i65445C1ADAA37E17/image-size/medium?v=v2&amp;amp;px=400" role="button" title="janneolkoniemi_1-1770969469694.png" alt="janneolkoniemi_1-1770969469694.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But I'm kind of lost that how I could include the metrics and traces from the entities which are having the tag&amp;nbsp;&lt;STRONG&gt;SAMPLE_TAG&lt;/STRONG&gt;. Is there some way with segments to include metrics and traces from entities which are containing a certain tag?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Feb 2026 08:01:09 GMT</pubDate>
    <dc:creator>janne-olkoniemi</dc:creator>
    <dc:date>2026-02-13T08:01:09Z</dc:date>
    <item>
      <title>Segments: include entities and related metrics/traces</title>
      <link>https://community.dynatrace.com/t5/DQL/Segments-include-entities-and-related-metrics-traces/m-p/294706#M3150</link>
      <description>&lt;P&gt;I have just started to play around with segments and I hope that someone could help me how to include metrics and traces from entities to be part of segment definition.&lt;BR /&gt;&lt;BR /&gt;I have currently the following variable in place on my segment definition and it picks the SAMPLE_TAG values correctly.&lt;BR /&gt;&lt;BR /&gt;fetch dt.entity.service, from: -10d&lt;BR /&gt;| expand tag = tags&lt;BR /&gt;| fields tag&lt;BR /&gt;| filter startsWith(tag, "SAMPLE_TAG")&lt;BR /&gt;| dedup tag&lt;BR /&gt;| parse tag, "LD ':' LD:Service"&lt;BR /&gt;| fields Service,tag&lt;BR /&gt;&lt;BR /&gt;And I have the following filter definition in place to pick the entities which are containing the SAMPLE_TAG.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="janneolkoniemi_1-1770969469694.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/32005i65445C1ADAA37E17/image-size/medium?v=v2&amp;amp;px=400" role="button" title="janneolkoniemi_1-1770969469694.png" alt="janneolkoniemi_1-1770969469694.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But I'm kind of lost that how I could include the metrics and traces from the entities which are having the tag&amp;nbsp;&lt;STRONG&gt;SAMPLE_TAG&lt;/STRONG&gt;. Is there some way with segments to include metrics and traces from entities which are containing a certain tag?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 08:01:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Segments-include-entities-and-related-metrics-traces/m-p/294706#M3150</guid>
      <dc:creator>janne-olkoniemi</dc:creator>
      <dc:date>2026-02-13T08:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Segments: include entities and related metrics/traces</title>
      <link>https://community.dynatrace.com/t5/DQL/Segments-include-entities-and-related-metrics-traces/m-p/294720#M3151</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Segments don’t automatically “bring metrics and traces along” when you include only entities. You need separate Include blocks for the signals you want (e.g., Spans and Metrics) and scope them to the same entity set.&lt;BR /&gt;try subqueries filters:&lt;BR /&gt;Spans (traces) for services tagged some_tag&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch spans, from: -10d
| filter dt.entity.service in [
    fetch dt.entity.service, from: -10d
    | expand tags
    | filter startsWith(tags, "OpenTelemetry")
    | fields id
    | dedup id
  ]&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t_pawlak_0-1770987448082.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/32008i9AB81EF301BF55E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="t_pawlak_0-1770987448082.png" alt="t_pawlak_0-1770987448082.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Metrics for the same services:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries req = sum(dt.service.request.count), by: {dt.entity.service}, from: -10d
| filter dt.entity.service in [
    fetch dt.entity.service, from: -10d
    | expand tags
    | filter startsWith(tags, "OpenTelemetry")
    | fields id
    | dedup id
  ]&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="t_pawlak_1-1770987507567.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/32009iCED236805EF11B40/image-size/medium?v=v2&amp;amp;px=400" role="button" title="t_pawlak_1-1770987507567.png" alt="t_pawlak_1-1770987507567.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You must explicitly include &lt;STRONG&gt;metrics/spans&lt;/STRONG&gt; in the Segment; selecting entities alone won’t scope those signals automatically&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 12:58:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Segments-include-entities-and-related-metrics-traces/m-p/294720#M3151</guid>
      <dc:creator>t_pawlak</dc:creator>
      <dc:date>2026-02-13T12:58:58Z</dc:date>
    </item>
  </channel>
</rss>

