<?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 Tie extension metrics to host entity in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/Tie-extension-metrics-to-host-entity/m-p/275130#M6332</link>
    <description>&lt;P&gt;How can I tie prometheus extension metrics to a host entity? I have looked at tons of examples and cant seem to figure this out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to display the collected metrics on a specific host's unified analysis screen. The chart gets displayed but it is filtered for the host so it doesn't show any metrics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am in the beginning stages of figuring this out so any help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of yaml -&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;name: custom:promethius.genai.extension
version: 0.0.13
minDynatraceVersion: "1.307.0"
author:
  name: JR

prometheus:
  - group: metrics
    metrics:
      - key: go_gc_cycles_automatic_gc_cycles_total.count
        value: metric:go_gc_cycles_automatic_gc_cycles_total
        type: count
     
metrics:  
  - key: go_gc_cycles_automatic_gc_cycles_total.count
    metadata:
      displayName: Go Gc Cycles Automatic Gc Cycles Total
      description: Count of completed GC cycles generated by the Go runtime.
      unit: Unspecified
 
screens:
  - entityType: HOST
    detailsInjections:
      - type: CHART_GROUP
        key: genai_metrics
        conditions:
          - entityAttribute|detectedName=hostname.domain.com
    chartsCards:
      - key: genai_metrics
        mode: NORMAL
        displayName: Metrics Scraped from hostname:port/metrics
        numberOfVisibleCharts: 1
        charts:
          - displayName: GO GC Metrics
            visualizationType: GRAPH_CHART
            graphChartConfig:
              metrics:
                - metricSelector: go_gc_cycles_automatic_gc_cycles_total.count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Apr 2025 23:35:39 GMT</pubDate>
    <dc:creator>jordan_rose</dc:creator>
    <dc:date>2025-04-14T23:35:39Z</dc:date>
    <item>
      <title>Tie extension metrics to host entity</title>
      <link>https://community.dynatrace.com/t5/Extensions/Tie-extension-metrics-to-host-entity/m-p/275130#M6332</link>
      <description>&lt;P&gt;How can I tie prometheus extension metrics to a host entity? I have looked at tons of examples and cant seem to figure this out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to display the collected metrics on a specific host's unified analysis screen. The chart gets displayed but it is filtered for the host so it doesn't show any metrics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am in the beginning stages of figuring this out so any help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of yaml -&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;name: custom:promethius.genai.extension
version: 0.0.13
minDynatraceVersion: "1.307.0"
author:
  name: JR

prometheus:
  - group: metrics
    metrics:
      - key: go_gc_cycles_automatic_gc_cycles_total.count
        value: metric:go_gc_cycles_automatic_gc_cycles_total
        type: count
     
metrics:  
  - key: go_gc_cycles_automatic_gc_cycles_total.count
    metadata:
      displayName: Go Gc Cycles Automatic Gc Cycles Total
      description: Count of completed GC cycles generated by the Go runtime.
      unit: Unspecified
 
screens:
  - entityType: HOST
    detailsInjections:
      - type: CHART_GROUP
        key: genai_metrics
        conditions:
          - entityAttribute|detectedName=hostname.domain.com
    chartsCards:
      - key: genai_metrics
        mode: NORMAL
        displayName: Metrics Scraped from hostname:port/metrics
        numberOfVisibleCharts: 1
        charts:
          - displayName: GO GC Metrics
            visualizationType: GRAPH_CHART
            graphChartConfig:
              metrics:
                - metricSelector: go_gc_cycles_automatic_gc_cycles_total.count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 23:35:39 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Tie-extension-metrics-to-host-entity/m-p/275130#M6332</guid>
      <dc:creator>jordan_rose</dc:creator>
      <dc:date>2025-04-14T23:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Tie extension metrics to host entity</title>
      <link>https://community.dynatrace.com/t5/Extensions/Tie-extension-metrics-to-host-entity/m-p/275776#M6343</link>
      <description>&lt;P&gt;This line looks odd to me:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;- entityAttribute|detectedName=hostname.domain.com&lt;/LI-CODE&gt;
&lt;P&gt;There shouldn't be any reason to include conditions for a hardcoded name. If you want to ensure that this card is only displayed on hosts with data there are better conditions e.g this one to filter to only hosts that had this metric.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;- metricAvailable|metric=go_gc_cycles_automatic_gc_cycles_total.count:filter(in("dt.entity.host", entitySelector("entityId($(entityId))")))|lastWrittenWithinDays=5&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming you're doing the 'local' activation (i.e. running from the OA host not an ActiveGate) the host dimensions are added automatically which is what 'ties' them to a host. You shouldn't need to do anything else.&lt;/P&gt;
&lt;P&gt;Do you see this (with the Host entity as a populated dimension) in the Data Explorer? If that is there it should satisfy the requirements to be displayed.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 15:08:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Tie-extension-metrics-to-host-entity/m-p/275776#M6343</guid>
      <dc:creator>JamesKitson</dc:creator>
      <dc:date>2025-04-23T15:08:30Z</dc:date>
    </item>
  </channel>
</rss>

