<?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>article How to set up OpenTelemetry metrics with delta temporality in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/How-to-set-up-OpenTelemetry-metrics-with-delta-temporality/ta-p/269292</link>
    <description>&lt;H1&gt;Problem&lt;/H1&gt;
&lt;P&gt;Dynatrace currently &lt;A href="https://docs.dynatrace.com/docs/shortlink/opentelemetry-metrics-limitations#aggregation-temporality" target="_blank" rel="noopener"&gt;does not support cumulative OpenTelemetry metrics aggregation&lt;/A&gt;. This article describes what kinds of options you have to configure delta temporality in your services or in an OTel collector.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;H1&gt;Troubleshooting Steps&lt;/H1&gt;
&lt;P&gt;You will notice that your temporality is not set up correctly through specific log messages and either outright rejected requests or requests that return with “partial success”. The log message will come up wherever you send your OTLP metrics from, be it an OTel SDK or an OTel Collector.&lt;/P&gt;
&lt;P&gt;If your request only contains OTLP metrics in cumulative temporality, then you will get an HTTP 400 response with a log message like the following:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;All metric data points were rejected. The following issues were encountered while ingesting OTLP metrics:

Errors:

Unsupported metric: 'mymetric' - Reason: UNSUPPORTED_METRIC_TYPE_MONOTONIC_CUMULATIVE_SUM&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your request also contained supported OTLP data, you'll get an HTTP 200 response and a log message like the following:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;The following issues were encountered while ingesting OTLP metrics:

Errors:

Unsupported metric: 'mymetric' - Reason: UNSUPPORTED_METRIC_TYPE_MONOTONIC_CUMULATIVE_SUM&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll also see the &lt;FONT face="courier new,courier"&gt;dsfm:active_gate.metrics.ingest.otlp.datapoints.rejected.count&lt;/FONT&gt; self-monitoring metric increase. You can split it by “reason” to see if the &lt;FONT face="courier new,courier"&gt;UNSUPPORTED_METRIC_TYPE_MONOTONIC_CUMULATIVE_SUM&lt;/FONT&gt; error type is there. Unfortunately, it’s not possible to show the exact metric that caused the error here, only the count of errors for the corresponding error type.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;H1&gt;Resolution&lt;/H1&gt;
&lt;P&gt;To resolve this issue, you need to set the metrics temporality to delta instead of cumulative.&lt;/P&gt;
&lt;P&gt;You can either set the correct temporality directly in your services (which is the preferred way) or in an OTel Collector that processes your OTLP metrics and forwards them to Dynatrace.&lt;/P&gt;
&lt;P&gt;If the OTel SDK for your programming language supports it, you can set the temporality by setting the &lt;FONT face="courier new,courier"&gt;OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta&lt;/FONT&gt; environment variable. Find out if your OTel SDK supports this by checking out the support matrix &lt;A href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md#environment-variables" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If your OTel SDK does not support the environment variable, then you can set it directly in code, where you set up the metrics SDK. An exampe of how to do that in Python can be seen in the screenshot below and also be found on the &lt;A href="https://docs.dynatrace.com/docs/ingest-from/opentelemetry/walkthroughs/python/python-manual" target="_blank" rel="noopener"&gt;documentation page&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mowies_0-1738748258296.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26208i78BBB1EFD22551B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="mowies_0-1738748258296.png" alt="mowies_0-1738748258296.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you don’t have the option to use either of the solutions above, you can alternatively also use an OpenTelemetry Collector like the &lt;A href="https://docs.dynatrace.com/docs/ingest-from/opentelemetry/collector" target="_blank" rel="noopener"&gt;Dynatrace OTel Collector Distribution&lt;/A&gt; to convert cumulative metrics to delta temporality. You can find instructions on how to correctly set up your configuration on the &lt;A href="https://docs.dynatrace.com/docs/ingest-from/opentelemetry/collector/configuration#delta-metrics" target="_blank" rel="noopener"&gt;documentation page&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;H1&gt;Further Support&lt;/H1&gt;
&lt;P&gt;If you have any further questions or encounter any issues not listed above, please feel free to contact our&amp;nbsp;&lt;A href="https://support.dynatrace.com/" target="_blank" rel="noopener"&gt;support team&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Feb 2025 10:12:44 GMT</pubDate>
    <dc:creator>mowies</dc:creator>
    <dc:date>2025-02-05T10:12:44Z</dc:date>
    <item>
      <title>How to set up OpenTelemetry metrics with delta temporality</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/How-to-set-up-OpenTelemetry-metrics-with-delta-temporality/ta-p/269292</link>
      <description>&lt;P&gt;Find out how to set up OpenTelemetry metrics with delta temporality&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 10:12:44 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/How-to-set-up-OpenTelemetry-metrics-with-delta-temporality/ta-p/269292</guid>
      <dc:creator>mowies</dc:creator>
      <dc:date>2025-02-05T10:12:44Z</dc:date>
    </item>
  </channel>
</rss>

