Skip to content

Conversation

pront
Copy link
Member

@pront pront commented Sep 24, 2025

Summary

The main purpose of this feature is to simplify OTEL sink configuration from:

otel_sink:
  inputs:
    - otel.logs
  type: opentelemetry
  protocol:
    type: http
    uri: http://localhost:5318/v1/logs
    method: post
  encoding:
     codec: protobuf
     protobuf:
       desc_file: path/to/opentelemetry-proto.desc
       message_type: opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest
    framing:
      method: "bytes"
    request:
      headers:
      content-type: "application/x-protobuf"

to

otel_sink:
  inputs:
    - source0.logs
  type: opentelemetry
  use_otlp_encoding: true
  protocol:
    type: http
    uri: http://otel-collector-sink:5318/v1/logs
    method: post
    batch:
      max_events: 1
    request:
      headers:
        content-type: application/json

I had to implement default for EncodingConfigWithFraming otherwise users would have to set a codec that would always be ignored. Hence the numerous CUE changes.

Vector configuration

How did you test this PR?

E2E tests were adapted.

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

Related: #23524

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 domain: sources Anything related to the Vector's sources domain: sinks Anything related to the Vector's sinks domain: codecs Anything related to Vector's codecs (encoding/decoding) labels Sep 24, 2025
@github-actions github-actions bot added the domain: external docs Anything related to Vector's external, public documentation label Sep 25, 2025
Copy link
Member Author

@pront pront left a comment

Choose a reason for hiding this comment

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

/ci-run-e2e-opentelemetry-logs

@pront pront marked this pull request as ready for review September 26, 2025 14:34
@pront pront requested review from a team as code owners September 26, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: codecs Anything related to Vector's codecs (encoding/decoding) domain: external docs Anything related to Vector's external, public documentation domain: sinks Anything related to the Vector's sinks domain: sources Anything related to the Vector's sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants