Skip to content

Conversation

@pront
Copy link
Member

@pront pront commented Oct 14, 2025

Summary

  • Added use_json_names option to protobuf serializer and deserializer to support JSON field naming (camelCase vs snake_case)
  • Adopted VRL's Makefile-based approach for generating protobuf test fixtures (deleted custom Python script)

Vector configuration

How did you test this PR?

New test and manually tested with the following config:

api:
  enabled: true
  address: "127.0.0.1:8686"

sources:
  s0:
    type: "opentelemetry"
    grpc:
      address: 0.0.0.0:4317
    http:
      address: 0.0.0.0:4318
      headers: []
    use_otlp_decoding: true

sinks:
  otel_output:
    type: opentelemetry
    inputs:
      - "s0.logs"
    protocol:
      type: http
      uri: http://127.0.0.1:5319/v1/logs
      method: post
      encoding:
        codec: "protobuf"
        protobuf:
          desc_file: /Users/pavlos.rontidis/CLionProjects/vector/pront/otel/proto/opentelemetry-proto.desc
          message_type: "opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"
          use_json_names: true
      request:
        headers:
          content-type: application/x-protobuf
      framing:
        method: bytes

  logs_sink:
    type: console
    inputs:
      - s0.logs
    encoding:
      codec: json

Change Type

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

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

closes: #23971

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details here.

@github-actions github-actions bot added the domain: external docs Anything related to Vector's external, public documentation label Oct 14, 2025
@github-actions github-actions bot added the domain: sinks Anything related to the Vector's sinks label Oct 14, 2025
@pront pront marked this pull request as ready for review October 14, 2025 19:17
@pront pront requested review from a team as code owners October 14, 2025 19:17
@rtrieu rtrieu self-assigned this Oct 14, 2025
Copy link
Contributor

@rtrieu rtrieu left a comment

Choose a reason for hiding this comment

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

my feedback is primarily the following:

  • update "will look" to "looks" (present tense)
  • change "e.g." to "for example" (avoid Latin abbreviations)

can you apply these changes throughout the PR? the first rule is to adhere to our style guide, and the second rule is for translation purposes.

thanks!

@pront pront requested a review from rtrieu October 14, 2025 20:55
@pront
Copy link
Member Author

pront commented Oct 14, 2025

my feedback is primarily the following:

  • update "will look" to "looks" (present tense)
  • change "e.g." to "for example" (avoid Latin abbreviations)

can you apply these changes throughout the PR? the first rule is to adhere to our style guide, and the second rule is for translation purposes.

thanks!

Updated rustdocs and regenerated the CUE files

@pront pront enabled auto-merge October 14, 2025 21:04
@pront pront added this pull request to the merge queue Oct 14, 2025
Merged via the queue into master with commit e1ecf8e Oct 14, 2025
64 checks passed
@pront pront deleted the pront-json-names-codecs branch October 14, 2025 21:49
titaneric pushed a commit to titaneric/vector that referenced this pull request Oct 21, 2025
…dotdev#24002)

* feat(codecs): add 'use_json_names' options to protobuf codecs

* changelog

* update docs

* docs updates

* fix docs

* add job description field and enhance test

* clippy fixes

* docs feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: external docs Anything related to Vector's external, public documentation domain: sinks Anything related to the Vector's sinks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OTLP encoding not working with OpenTelemetry sink

4 participants