mirror of
https://github.com/prometheus/prometheus.git
synced 2026-02-03 20:39:32 -05:00
* otlptranslator: add label caching for OTLP-to-Prometheus conversion Add per-request caching to reduce redundant computation and allocations during OTLP metric conversion: 1. Per-request label sanitization cache: Cache sanitized label names within a request to avoid repeated string allocations for commonly repeated labels like __name__, job, instance. 2. Resource-level label caching: Precompute and cache job, instance, promoted resource attributes, and external labels once per ResourceMetrics boundary instead of for each datapoint. 3. Scope-level label caching: Precompute and cache scope metadata labels (otel_scope_name, otel_scope_version, etc.) once per ScopeMetrics boundary. 4. LabelNamer instance caching: Reuse the LabelNamer struct across datapoints within the same resource context. These optimizations significantly reduce allocations and improve latency for OTLP ingestion workloads with many datapoints per resource/scope. --------- Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| azuread | ||
| googleiam | ||
| otlptranslator/prometheusremotewrite | ||
| chunked.go | ||
| chunked_test.go | ||
| client.go | ||
| client_test.go | ||
| codec.go | ||
| codec_test.go | ||
| dial_context.go | ||
| dial_context_test.go | ||
| ewma.go | ||
| intern.go | ||
| intern_test.go | ||
| max_timestamp.go | ||
| metadata_watcher.go | ||
| metadata_watcher_test.go | ||
| queue_manager.go | ||
| queue_manager_test.go | ||
| read.go | ||
| read_handler.go | ||
| read_handler_test.go | ||
| read_test.go | ||
| stats.go | ||
| storage.go | ||
| storage_test.go | ||
| write.go | ||
| write_handler.go | ||
| write_handler_test.go | ||
| write_test.go | ||