Skip to content

OTLP to directly writes to storage.Appender #16855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dashpole
Copy link
Contributor

@dashpole dashpole commented Jul 10, 2025

Remove intermediary OTLP -> PRW 1.0 step before writing to the appender. It also adds a CombinedAppender interface, which consolidates error handling, and may make it possible to re-use the library in Mimir, which currently uses it to translate to PRW 1.0.

Similar to #16827, but maintains existing code structure and unit tests.

Alternative to #16784.

Notable Changes:

  • Add OTLP-specific metrics for metadata and exemplar write failures:
    • otlp_without_metadata_appended_samples_total instead of remote_write_without_metadata_appended_samples_total.
    • otlp_out_of_order_exemplars_total replaces "Error on ingesting out-of-order exemplars" warning log.
  • It now calls appender.UpdateMetadata with metadata. The unit is converted using the otlptranslator library.
  • It now calls appender.AppendHistogramCTZeroSample and appender.AppendCTZeroSample when the created-timestamp-zero-ingestion feature is enabled.

TODO:

  • Unit tests for metadata in write_test.go
  • Unit tests for zero timestamp insertion in write_test.go

Benchmark summary: 36% less CPU, 38% fewer bytes, 19% fewer allocations

$ benchstat main.txt directappender.txt
goos: linux
goarch: amd64
pkg: github.com/prometheus/prometheus/storage/remote/otlptranslator/prometheusremotewrite
cpu: Intel(R) Xeon(R) CPU @ 2.20GHz
                                                                                                                                                              │    main.txt    │         directappender.txt          │
                                                                                                                                                              │     sec/op     │    sec/op     vs base               │
ConvertBucketLayout/gap_0-2                                                                                                                                      18.95µ ±   8%   18.19µ ±  4%        ~ (p=0.093 n=6)
ConvertBucketLayout/gap_1-2                                                                                                                                      20.38µ ±  11%   18.13µ ±  5%  -11.07% (p=0.009 n=6)
ConvertBucketLayout/gap_2-2                                                                                                                                      19.05µ ± 140%   18.22µ ± 25%        ~ (p=0.699 n=6)
ConvertBucketLayout/gap_3-2                                                                                                                                      23.75µ ±   4%   10.46µ ±  4%  -55.98% (p=0.002 n=6)
ConvertHistogramBucketsToNHCBLayout/gap_0-2                                                                                                                      14.83µ ±   4%   14.75µ ±  4%        ~ (p=0.699 n=6)
ConvertHistogramBucketsToNHCBLayout/gap_1-2                                                                                                                      14.56µ ±   2%   14.53µ ±  3%        ~ (p=0.784 n=6)
ConvertHistogramBucketsToNHCBLayout/gap_2-2                                                                                                                      14.86µ ±  20%   14.66µ ±  9%        ~ (p=0.132 n=6)
ConvertHistogramBucketsToNHCBLayout/gap_3-2                                                                                                                     19.582µ ±  15%   6.852µ ±  2%  -65.01% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2          18.60m ±   8%   14.76m ±  4%  -20.65% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2          30.10m ±  40%   21.15m ±  5%  -29.75% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2         37.82m ±   6%   27.43m ±  4%  -27.48% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2         71.64m ±  13%   48.32m ±  9%  -32.55% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2         70.99m ±   8%   52.67m ± 18%  -25.81% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2        80.03m ±   3%   61.63m ±  2%  -22.99% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_0-2          25.52m ±   5%   14.77m ± 11%  -42.13% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_5-2          31.44m ±   4%   18.84m ±  3%  -40.08% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_10-2         37.92m ±  23%   23.00m ±  4%  -39.35% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_0-2         75.28m ±   4%   30.67m ±  3%  -59.26% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_5-2         85.59m ±   8%   36.87m ±  3%  -56.92% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_10-2        88.03m ±   7%   41.00m ±  1%  -53.43% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2       43.63m ±   4%   29.28m ±  4%  -32.89% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2       65.93m ±  14%   40.59m ±  3%  -38.44% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2      79.91m ±  18%   51.47m ±  3%  -35.59% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2     146.47m ±  24%   79.46m ±  2%  -45.75% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2     170.66m ±  20%   93.22m ±  8%  -45.37% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2     174.0m ±   7%   102.5m ±  4%  -41.09% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2          18.06m ±   2%   14.80m ±  2%  -18.03% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2          28.28m ±  16%   21.53m ±  3%  -23.86% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2         36.69m ±   3%   28.42m ±  3%  -22.54% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2         62.61m ±   4%   47.47m ±  2%  -24.18% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2         70.21m ±   4%   52.83m ±  2%  -24.76% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2        84.62m ±   3%   62.64m ±  1%  -25.98% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_0-2          24.11m ±   4%   14.76m ±  4%  -38.77% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_5-2          31.24m ±   3%   19.51m ±  4%  -37.54% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_10-2         38.30m ±   4%   23.40m ±  2%  -38.92% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_0-2         75.22m ±   4%   31.72m ±  4%  -57.82% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_5-2         78.43m ±   3%   36.82m ±  4%  -53.05% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_10-2        84.26m ±   8%   41.01m ±  1%  -51.33% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2       43.09m ±   3%   29.98m ±  4%  -30.44% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2       64.92m ±   3%   40.34m ±  3%  -37.87% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2      79.51m ±  11%   51.82m ±  2%  -34.82% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2     139.29m ±   7%   79.55m ±  2%  -42.89% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2     171.15m ±   7%   93.60m ±  3%  -45.31% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2     173.2m ±   3%   102.0m ±  2%  -41.07% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2         18.84m ±   2%   15.49m ±  3%  -17.81% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2         29.38m ±   6%   22.33m ±  2%  -24.00% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2        37.53m ±   6%   28.41m ±  8%  -24.31% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2        60.82m ±   9%   47.81m ±  2%  -21.40% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2        71.37m ±   5%   52.80m ± 10%  -26.02% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2       86.75m ±  24%   62.25m ±  2%  -28.24% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_0-2         24.07m ±   2%   14.97m ±  5%  -37.81% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_5-2         31.65m ±   7%   19.71m ± 13%  -37.71% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_10-2        38.34m ±   3%   23.55m ±  2%  -38.58% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_0-2        74.40m ±   4%   30.92m ±  4%  -58.44% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_5-2        79.92m ±   4%   37.18m ±  5%  -53.48% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_10-2       83.36m ±   9%   41.37m ±  3%  -50.38% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2      44.37m ±   8%   30.61m ±  4%  -31.01% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2      65.65m ±   2%   40.90m ±  3%  -37.69% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2     84.19m ±  14%   53.21m ±  3%  -36.81% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2    135.35m ±   3%   81.49m ±  7%  -39.80% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2    171.30m ±  10%   94.12m ±  8%  -45.06% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2    174.4m ±   6%   101.4m ±  2%  -41.85% (p=0.002 n=6)
geomean                                                                                                                                                          21.19m          13.54m        -36.12%

                                                                                                                                                              │   main.txt    │         directappender.txt          │
                                                                                                                                                              │     B/op      │     B/op      vs base               │
ConvertBucketLayout/gap_0-2                                                                                                                                      32.66Ki ± 0%   32.62Ki ± 0%   -0.12% (p=0.002 n=6)
ConvertBucketLayout/gap_1-2                                                                                                                                      32.66Ki ± 0%   32.62Ki ± 0%   -0.12% (p=0.002 n=6)
ConvertBucketLayout/gap_2-2                                                                                                                                      32.66Ki ± 0%   32.62Ki ± 0%   -0.12% (p=0.002 n=6)
ConvertBucketLayout/gap_3-2                                                                                                                                      35.65Ki ± 0%   15.98Ki ± 0%  -55.16% (p=0.002 n=6)
ConvertHistogramBucketsToNHCBLayout/gap_0-2                                                                                                                      24.66Ki ± 0%   24.62Ki ± 0%   -0.16% (p=0.002 n=6)
ConvertHistogramBucketsToNHCBLayout/gap_1-2                                                                                                                      24.66Ki ± 0%   24.62Ki ± 0%   -0.16% (p=0.002 n=6)
ConvertHistogramBucketsToNHCBLayout/gap_2-2                                                                                                                      24.66Ki ± 0%   24.62Ki ± 0%   -0.16% (p=0.002 n=6)
ConvertHistogramBucketsToNHCBLayout/gap_3-2                                                                                                                     27.648Ki ± 0%   7.984Ki ± 0%  -71.12% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2          3.017Mi ± 0%   2.417Mi ± 0%  -19.90% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2          7.235Mi ± 0%   4.486Mi ± 0%  -37.99% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2        11.450Mi ± 0%   6.565Mi ± 0%  -42.66% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2        10.948Mi ± 0%   5.782Mi ± 0%  -47.19% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2        15.168Mi ± 0%   7.868Mi ± 0%  -48.12% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2       19.374Mi ± 0%   9.944Mi ± 0%  -48.67% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_0-2          7.766Mi ± 0%   6.133Mi ± 0%  -21.03% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_5-2         10.644Mi ± 0%   7.757Mi ± 0%  -27.13% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_10-2        13.614Mi ± 0%   9.463Mi ± 0%  -30.49% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_0-2         22.19Mi ± 0%   11.05Mi ± 0%  -50.21% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_5-2         25.07Mi ± 0%   12.67Mi ± 0%  -49.47% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_10-2        28.02Mi ± 0%   14.37Mi ± 0%  -48.71% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2      10.625Mi ± 0%   8.639Mi ± 0%  -18.69% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2       17.70Mi ± 0%   12.34Mi ± 0%  -30.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2      24.87Mi ± 0%   16.14Mi ± 0%  -35.10% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2      32.97Mi ± 0%   16.91Mi ± 0%  -48.72% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2      40.05Mi ± 0%   20.60Mi ± 0%  -48.57% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2     47.21Mi ± 0%   24.41Mi ± 0%  -48.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2          3.017Mi ± 0%   2.413Mi ± 0%  -20.02% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2          7.228Mi ± 0%   4.487Mi ± 0%  -37.92% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2        11.446Mi ± 0%   6.566Mi ± 0%  -42.63% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2        10.952Mi ± 0%   5.782Mi ± 0%  -47.21% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2        15.163Mi ± 0%   7.869Mi ± 0%  -48.11% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2       19.373Mi ± 0%   9.944Mi ± 0%  -48.67% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_0-2          7.769Mi ± 0%   6.135Mi ± 0%  -21.03% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_5-2         10.646Mi ± 0%   7.763Mi ± 0%  -27.08% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_10-2        13.614Mi ± 0%   9.461Mi ± 0%  -30.51% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_0-2         22.21Mi ± 0%   11.05Mi ± 0%  -50.26% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_5-2         25.06Mi ± 0%   12.66Mi ± 0%  -49.48% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_10-2        28.03Mi ± 0%   14.38Mi ± 0%  -48.68% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2      10.621Mi ± 0%   8.645Mi ± 0%  -18.61% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2       17.71Mi ± 0%   12.34Mi ± 0%  -30.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2      24.88Mi ± 0%   16.13Mi ± 0%  -35.18% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2      32.99Mi ± 0%   16.91Mi ± 0%  -48.74% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2      40.06Mi ± 0%   20.60Mi ± 0%  -48.57% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2     47.21Mi ± 0%   24.42Mi ± 0%  -48.28% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2         3.024Mi ± 0%   2.425Mi ± 0%  -19.82% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2         7.237Mi ± 0%   4.499Mi ± 0%  -37.83% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2       11.453Mi ± 0%   6.578Mi ± 0%  -42.57% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2       10.958Mi ± 0%   5.790Mi ± 0%  -47.16% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2       15.171Mi ± 0%   7.877Mi ± 0%  -48.08% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2      19.387Mi ± 0%   9.952Mi ± 0%  -48.66% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_0-2         7.776Mi ± 0%   6.141Mi ± 0%  -21.03% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_5-2        10.653Mi ± 0%   7.764Mi ± 0%  -27.12% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_10-2       13.612Mi ± 0%   9.480Mi ± 0%  -30.36% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_0-2        22.21Mi ± 0%   11.05Mi ± 0%  -50.24% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_5-2        25.06Mi ± 0%   12.67Mi ± 0%  -49.44% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_10-2       28.03Mi ± 0%   14.38Mi ± 0%  -48.71% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2     10.633Mi ± 0%   8.648Mi ± 0%  -18.67% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2      17.71Mi ± 0%   12.35Mi ± 0%  -30.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2     24.89Mi ± 0%   16.16Mi ± 0%  -35.08% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2     32.99Mi ± 0%   16.92Mi ± 0%  -48.72% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2     40.07Mi ± 0%   20.61Mi ± 0%  -48.56% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2    47.23Mi ± 0%   24.43Mi ± 0%  -48.27% (p=0.002 n=6)
geomean                                                                                                                                                          7.021Mi        4.358Mi       -37.93%

                                                                                                                                                              │   main.txt   │          directappender.txt          │
                                                                                                                                                              │  allocs/op   │  allocs/op   vs base                 │
ConvertBucketLayout/gap_0-2                                                                                                                                       14.00 ± 0%    14.00 ± 0%        ~ (p=1.000 n=6) ¹
ConvertBucketLayout/gap_1-2                                                                                                                                       14.00 ± 0%    14.00 ± 0%        ~ (p=1.000 n=6) ¹
ConvertBucketLayout/gap_2-2                                                                                                                                       14.00 ± 0%    14.00 ± 0%        ~ (p=1.000 n=6) ¹
ConvertBucketLayout/gap_3-2                                                                                                                                       19.00 ± 0%    19.00 ± 0%        ~ (p=1.000 n=6) ¹
ConvertHistogramBucketsToNHCBLayout/gap_0-2                                                                                                                       13.00 ± 0%    13.00 ± 0%        ~ (p=1.000 n=6) ¹
ConvertHistogramBucketsToNHCBLayout/gap_1-2                                                                                                                       13.00 ± 0%    13.00 ± 0%        ~ (p=1.000 n=6) ¹
ConvertHistogramBucketsToNHCBLayout/gap_2-2                                                                                                                       13.00 ± 0%    13.00 ± 0%        ~ (p=1.000 n=6) ¹
ConvertHistogramBucketsToNHCBLayout/gap_3-2                                                                                                                       18.00 ± 0%    18.00 ± 0%        ~ (p=1.000 n=6) ¹
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2          82.77k ± 0%   73.71k ± 0%  -10.94% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2          146.8k ± 0%   125.7k ± 0%  -14.35% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2         206.8k ± 0%   175.7k ± 0%  -15.02% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2         140.9k ± 0%   127.7k ± 0%   -9.37% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2         204.9k ± 0%   179.7k ± 0%  -12.31% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2        264.9k ± 0%   229.7k ± 0%  -13.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_0-2          79.12k ± 0%   47.93k ± 0%  -39.42% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_5-2         115.12k ± 0%   77.93k ± 0%  -32.30% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_10-2         146.1k ± 0%   103.9k ± 0%  -28.87% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_0-2         98.42k ± 0%   65.94k ± 0%  -33.00% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_5-2        134.43k ± 0%   95.94k ± 0%  -28.63% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_10-2        165.4k ± 0%   121.9k ± 0%  -26.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2       161.9k ± 0%   121.6k ± 0%  -24.89% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2       261.9k ± 0%   203.6k ± 0%  -22.26% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2      352.9k ± 0%   279.6k ± 0%  -20.77% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2      239.4k ± 0%   193.6k ± 0%  -19.11% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2      339.4k ± 0%   275.6k ± 0%  -18.79% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_0/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2     430.4k ± 0%   351.6k ± 0%  -18.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2          82.78k ± 0%   73.72k ± 0%  -10.94% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2          146.8k ± 0%   125.7k ± 0%  -14.35% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2         206.8k ± 0%   175.7k ± 0%  -15.02% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2         140.9k ± 0%   127.7k ± 0%   -9.38% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2         204.9k ± 0%   179.7k ± 0%  -12.30% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2        264.9k ± 0%   229.7k ± 0%  -13.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_0-2          79.13k ± 0%   47.95k ± 0%  -39.41% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_5-2         115.14k ± 0%   77.95k ± 0%  -32.30% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_10-2         146.1k ± 0%   103.9k ± 0%  -28.87% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_0-2         98.44k ± 0%   65.95k ± 0%  -33.01% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_5-2        134.44k ± 0%   95.95k ± 0%  -28.63% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_10-2        165.4k ± 0%   122.0k ± 0%  -26.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2       161.9k ± 0%   121.6k ± 0%  -24.89% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2       261.9k ± 0%   203.6k ± 0%  -22.26% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2      352.9k ± 0%   279.6k ± 0%  -20.77% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2      239.4k ± 0%   193.6k ± 0%  -19.11% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2      339.4k ± 0%   275.6k ± 0%  -18.79% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_5/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2     430.3k ± 0%   351.6k ± 0%  -18.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2         82.83k ± 0%   73.77k ± 0%  -10.93% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2         146.8k ± 0%   125.8k ± 0%  -14.34% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2        206.8k ± 0%   175.8k ± 0%  -15.01% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2        141.0k ± 0%   127.8k ± 0%   -9.37% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2        205.0k ± 0%   179.8k ± 0%  -12.30% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_0/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2       265.0k ± 0%   229.8k ± 0%  -13.29% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_0-2         79.17k ± 0%   47.99k ± 0%  -39.38% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_5-2        115.18k ± 0%   78.00k ± 0%  -32.28% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_2/exemplars_per_series:_10-2        146.2k ± 0%   104.0k ± 0%  -28.86% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_0-2        98.49k ± 0%   66.00k ± 0%  -32.99% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_5-2       134.48k ± 0%   96.00k ± 0%  -28.62% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_0/labels_per_metric:_20/exemplars_per_series:_10-2       165.5k ± 0%   122.0k ± 0%  -26.28% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_0-2      162.0k ± 0%   121.7k ± 0%  -24.88% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_5-2      262.0k ± 0%   203.7k ± 0%  -22.25% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_2/exemplars_per_series:_10-2     353.0k ± 0%   279.7k ± 0%  -20.77% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_0-2     239.4k ± 0%   193.7k ± 0%  -19.11% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_5-2     339.4k ± 0%   275.7k ± 0%  -18.78% (p=0.002 n=6)
PrometheusConverter_FromMetrics/resource_attribute_count:_50/histogram_count:_1000/non-histogram_count:_1000/labels_per_metric:_20/exemplars_per_series:_10-2    430.4k ± 0%   351.7k ± 0%  -18.30% (p=0.002 n=6)
geomean                                                                                                                                                          52.63k        42.39k       -19.46%
¹ all samples are equal

@dashpole dashpole force-pushed the otlp_to_labels branch 2 times, most recently from ef9614b to 119c500 Compare July 10, 2025 17:16
Signed-off-by: David Ashpole <[email protected]>
@krajorama krajorama self-requested a review July 15, 2025 08:22
Copy link
Member

@krajorama krajorama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've started to adopt this into a branch in mimir-prometheus to POC it there as well

}
}

// CombinedAppender is similar to storage.Appender, but combines updates to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's have this on the top, this is the important bit :)

@krajorama
Copy link
Member

When adopting to mimir-prometheus, I've ran into a problem where I have many conflicts with the customizations done in mimir-prometheus. Turns out most of it will go away with this PR, since we can hide behind interface, so I'd like to throw them away and resync the storage/remote/otlptranslator to upstream, but at which point?

In the mean time #16842 came in from 3.5 release branch, which is why this PR is also conflicting.

Was it intentional to have #16842 on main @ArthurSens ? I don't want to start before this is sorted out and maybe this PR #16855 is rebased @dashpole ?

@ArthurSens
Copy link
Member

When adopting to mimir-prometheus, I've ran into a problem where I have many conflicts with the customizations done in mimir-prometheus. Turns out most of it will go away with this PR, since we can hide behind interface, so I'd like to throw them away and resync the storage/remote/otlptranslator to upstream, but at which point?

In the mean time #16842 came in from 3.5 release branch, which is why this PR is also conflicting.

Was it intentional to have #16842 on main @ArthurSens ? I don't want to start before this is sorted out and maybe this PR #16855 is rebased @dashpole ?

Yes, it was intentional. We probably will revert the revert now, but there were some unfortunate misalignments on the spec while 3.5 was being released, so we removed the feature. We'll get it back now

@krajorama
Copy link
Member

Was it intentional to have #16842 on main @ArthurSens ? I don't want to start before this is sorted out and maybe this PR #16855 is rebased @dashpole ?

Yes, it was intentional. We probably will revert the revert now, but there were some unfortunate misalignments on the spec while 3.5 was being released, so we removed the feature. We'll get it back now

Ack, so we don't need to rebase this PR now and I can essentially sync with upstream at the same base as this PR. And we'll just wait for the revert-revert to move forward.

}

// NewOTLPWriteHandler creates a http.Handler that accepts OTLP write requests and
// writes them to the provided appendable.
func NewOTLPWriteHandler(logger *slog.Logger, _ prometheus.Registerer, appendable storage.Appendable, configFunc func() config.Config, opts OTLPOptions) http.Handler {
func NewOTLPWriteHandler(logger *slog.Logger, reg prometheus.Registerer, appendable storage.Appendable, configFunc func() config.Config, opts OTLPOptions) http.Handler {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should take an appendable CombinedAppender interface , not storage.Appendable so we can seed it with a different implementation.

Of course it would mean that in api.go NewAPI should also take it as an input parameter (dependency inject) so we can implement in Mimir and not in mimir-prometheus - removing the deviation from upstream completely.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What public function does mimir use? NewAPI? Or NewOTLPWriteHandler?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in the SIG meeting. They use NewAPI.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hold on for now, I might be able to use NewPrometheusConverter directly. Working on it.

krajorama added a commit to grafana/mimir that referenced this pull request Jul 21, 2025
Adopt prometheus/prometheus#16855

Initial code with samples and exemplars only, very basic.

Signed-off-by: György Krajcsovits <[email protected]>
@krajorama
Copy link
Member

I've finally had time to get started in Mimir: https://github.com/grafana/mimir/pull/12152/files#diff-077c782fc5e14926d78007578f8fed1d4f760875ee2311b41e8391fb16f3270dR28

The good: delete the code duplication from Prometheus and move Mimir specific code 100% into Mimir.

The not so good:

  1. When appending a sample I need to compare the labels that I have already in the output to the labels coming in to decide if I can use the same output time series. I'd rather we kept a supplying and returning a storage.SeriesRef number to/from the Combined Appender, so the appender can know if it's working on a timeseries it has already or not. So supply 0 on first sample and non-zero for subsequent samples.
  2. As Bryan (@bboreham ) pointed out, we'll be doing a lot of back end forth with labels :( The OTLP converter in Prometheus will turn lists of strings into stringlabels (strings encoded into a single string) , but the write request we convert into needs list of strings.
    I'm not sure we could pass stringlabels along directly, and even then we'll be doing validation and possibly relabelling, so list of strings would be better.

@dashpole
Copy link
Contributor Author

It should be easy enough to add the storage.SeriesRef.

Were you able to measure the performance impact of #2? Would using the slicelabels implementation of labels mitigate that? Or maybe it will just make other things slower?

@krajorama
Copy link
Member

krajorama commented Jul 21, 2025

It should be easy enough to add the storage.SeriesRef.

👍

Were you able to measure the performance impact of #2? Would using the slicelabels implementation of labels mitigate that? Or maybe it will just make other things slower?

That's fair, I'm not basing this on measurement, just simple deduction from looking at what the code does. Slicelabels is a build tag as far as I understand, so not that easy use? Anyway, I'll add seriesref on my branch and try to do some measurements.

@krajorama
Copy link
Member

It should be easy enough to add the storage.SeriesRef.

👍
Anyway, I'll add seriesref on my branch and try to do some measurements.

Well, this turned out to not that easy actually. Nothing in the API says that data points for a metric share the same attributes, so I would have to remember the labels and compare to the previous labels to know if I can reuse the reference and also we turn histogram data points into multiple series so keeping track of those is even more complicated. It's much simpler, what you did to keep track of hashes (and later conflict overflow). I'll do the same instead and do a map of labels hash -> position in the write request.

outOfOrderExemplars prometheus.Counter
ingestCTZeroSample bool
// Used to ensure we only update metadata and created timestamps once, and to share storage.SeriesRefs.
refs map[uint64]storage.SeriesRef
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To deal with collisions, you also need to keep track of the labels.

@krajorama
Copy link
Member

I've updated my PR . So far my results are too good to believe them, so I'm trying to figure out if it's true or I missed something. grafana/mimir#12152

@krajorama
Copy link
Member

I thought there was a bug as I got some duplicate sample errors in Mimir when using OTEL collector+Prometheus receiver -> OTLP exporter -> Mimir.

Turns out it was the Prometheus receiver faking start times that sometimes coincided with actual sample timestamps. I turned off this by using --feature-gates=receiver.prometheusreceiver.RemoveStartTimeAdjustment on the collector.

@dashpole
Copy link
Contributor Author

I'll rebase, re-run benchmarks, and mark this ready for review once @krajorama has confirmed that this approach will work for Mimir.

refs map[uint64]storage.SeriesRef
}

func (b *combinedAppender) AppendSample(ls labels.Labels, meta metadata.Metadata, t, ct int64, v float64, es []exemplar.Exemplar) (err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When adding the metadata to remote write, we need to use the metric family name and the old code simply set the name in the metadata to the OTEL name which doesn't have the magic _count, _bucket, _sum suffixes. However now I get the full name only, not the base name. And there will be metadata for individual series, not families, which confuses Grafana:
image

The interface should pass the base name as well, so we don't have to calculate it. For cases where the storage does not yet support per series metadata.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest:

// CombinedAppender is similar to storage.Appender, but combines updates to
// metadata, created timestamps, exemplars and samples into a single call.
type CombinedAppender interface {
	// AppendSample appends a sample and related exemplars, metadata, and
	// created timestamp to the storage.
	AppendSample(metricFamily string, ls labels.Labels, meta metadata.Metadata, t, ct int64, v float64, es []exemplar.Exemplar) error
	// AppendSample appends a histogram and related exemplars, metadata, and
	// created timestamp to the storage.
	AppendHistogram(metricFamily string, ls labels.Labels, meta metadata.Metadata, t, ct int64, h *histogram.Histogram, es []exemplar.Exemplar) error
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need it for AppendHistogram?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants