[Exporter.Prometheus] Use dictionary to key views

Merged
MA
5mo ago
+1477-206

Changes

  • Instead of maintaining separate fields for reviews and timestamps for scrape responses, key on the PrometheusProtocol to support multiple formats and simplify passing options that affect the serializer around in the future (e.g. for #7156 and #7159).
  • Consolidate the buffer and view into a single state object, rather than storing across four dictionaries.
  • Rename version properties for consistency to V{number}.

Changes are about ~2% regression for the scrape endpoint, but that's still massively improved compared to before #7279.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)