Skip to content

Move V3 protocol into a separate crate#1920

Draft
StephenWakely wants to merge 3 commits into
mainfrom
stephen/v3_vector
Draft

Move V3 protocol into a separate crate#1920
StephenWakely wants to merge 3 commits into
mainfrom
stephen/v3_vector

Conversation

@StephenWakely

Copy link
Copy Markdown
Contributor

Summary

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

How did you test this PR?

References

…ics-v3 crate

Extract the pure-protocol V3 codec (interner, types, writer, serializer) from
lib/saluki-components into a zero-dependency lib/datadog-metrics-v3 crate. The
serializer is reimplemented using raw protobuf wire-format encoding with no
external deps. saluki-components now re-exports from this crate.
Three issues addressed:

1. compact_values() skipped for Sketch metrics.
   Sketch summary values (sum/min/max) must stay in vals_float64. The old
   code could move them to vals_float32 or vals_sint64 based on magnitude,
   corrupting the payload — the decoder reads these from vals_float64 by
   position, not by type tag.

2. V3MetricBuilder Drop guard.
   Without a Drop impl, forgetting close() silently left value-type bits
   unset in the types column. Now panics in debug builds if close() is not
   called before drop.

3. MetricsV3EndpointEncoder::encode() now writes to buffer.
   The EndpointEncoder contract requires each encode() call to write to
   buffer so the request builder can track sizes. Previously the V3 encoder
   accumulated into self.writer but wrote nothing to buffer, producing empty
   payloads. Fixed by serializing a single-metric V3 payload per encode()
   call. Full cross-metric deduplication requires a batch-flush hook on
   EndpointEncoder (tracked via TODO comment).
…d_numbers module

field_numbers was a duplicate of the private mod field in serializer.rs and
was not referenced anywhere. WIRE_VARINT (protobuf wire type 0) is not used
by the current serializer.
@datadog-official

datadog-official Bot commented Jun 24, 2026

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 3 Pipeline jobs failed

DataDog/saluki | check-docs   View in Datadog   GitLab

DataDog/saluki | check-fmt   View in Datadog   GitLab

Semantic PR Title Check | Check For Semantic PR Title   View in Datadog   GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 845b7b6 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts dd-octo-sts Bot added area/components Sources, transforms, and destinations. encoder/datadog-metrics Datadog Metrics encoder. labels Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/components Sources, transforms, and destinations. encoder/datadog-metrics Datadog Metrics encoder.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant