Skip to content

Conversation

pront
Copy link
Member

@pront pront commented Aug 5, 2025

Summary

The opentelemetry source now supports a new decoding mode which can be enabled by setting use_otlp_decoding to true. In this mode,
all events will preserve the OTLP format. These events can be forwarded directly to
the opentelemetry sink without modifications.

A caveat here is that OTLP metrics and Vector metric format differ and thus we treat as logs as they come out the source. These events
cannot be used with existing metrics transforms. However, these can be ingested by the OTEL collectors as metrics.

Vector configuration

Vector Config:

api:
  enabled: true

sources:
  otel:
    type: opentelemetry
    grpc:
      address: 0.0.0.0:5317
    http:
      address: 0.0.0.0:5318
      keepalive:
        max_connection_age_jitter_factor: 0.1
        max_connection_age_secs: 300
    use_oltp_decoding: true

#  internal_metrics:
#    type: internal_metrics
#    scrape_interval_secs: 60


sinks:
  logs_sink:
    type: console
    inputs:
      - otel.logs
    encoding:
      codec: json

  metrics_sink:
    type: console
    inputs:
      - otel.metrics
    encoding:
      codec: json

  traces_sink:
    type: console
    inputs:
      - otel.traces
    encoding:
      codec: json

  otel_sink_logs:
    inputs:
      - otel.logs
    type: opentelemetry
    protocol:
      type: http
      uri: http://localhost:5318/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
      framing:
        method: "bytes"
      request:
        headers:
          content-type: "application/x-protobuf"

  otel_sink_metrics:
    inputs:
      - otel.metrics
    type: opentelemetry
    protocol:
      type: http
      uri: http://localhost:5318/v1/metrics
      method: post
      encoding:
        codec: protobuf
        protobuf:
          desc_file: /Users/pavlos.rontidis/CLionProjects/vector/pront/otel/proto/opentelemetry-proto.desc
          message_type: opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest
      framing:
        method: "bytes"
      request:
        headers:
          content-type: "application/x-protobuf"

  otel_sink_traces:
    inputs:
      - otel.traces
    type: opentelemetry
    protocol:
      type: http
      uri: http://localhost:5318/v1/traces
      method: post
      encoding:
        codec: protobuf
        protobuf:
          desc_file: /Users/pavlos.rontidis/CLionProjects/vector/pront/otel/proto/opentelemetry-proto.desc
          message_type: opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest
      framing:
        method: "bytes"
      request:
        headers:
          content-type: "application/x-protobuf"


#  metrics_console_sink:
#    type: console
#    inputs:
#      - internal_metrics
#    encoding:
#      codec: json

How did you test this PR?

Added a new E2E environment that exercises the new code for logs.
Metrics and traces were tested manually. I have these documented and will probably follow up with a docs improvement PR.

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

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:
      • cargo fmt --all
      • cargo clippy --workspace --all-targets -- -D warnings
      • cargo nextest run --workspace (alternatively, you can run cargo test --all)
  • 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 cargo vdev 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 labels Aug 5, 2025
@datadog-vectordotdev
Copy link

datadog-vectordotdev bot commented Aug 5, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0980161 | Docs | Was this helpful? Give us feedback!

@github-actions github-actions bot added the domain: core Anything related to core crates i.e. vector-core, core-common, etc label Aug 12, 2025
@pront pront force-pushed the pront/otel-investigation-logs branch from 4d95185 to 3f9e76d Compare August 19, 2025 17:31
@pront pront force-pushed the pront/otel-investigation-logs branch from 3f9e76d to e6dab61 Compare August 19, 2025 18:04
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 2, 2025 15:20
@pront pront requested review from a team as code owners September 2, 2025 15:20
pront and others added 2 commits September 2, 2025 12:21
Co-authored-by: Ursula Chen <58821586+urseberry@users.noreply.github.com>
@pront pront added this pull request to the merge queue Sep 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 2, 2025
Copy link
Contributor

@urseberry urseberry left a comment

Choose a reason for hiding this comment

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

Thanks for the clarification to my feedback on the release note. I didn't understand the language. I assume "emits treats" is a domain-specific phrase that I'm not familiar with. I'll approve the PR.

@pront
Copy link
Member Author

pront commented Sep 2, 2025

Thanks for the clarification to my feedback on the release note. I didn't understand the language. I assume "emits treats" is a domain-specific phrase that I'm not familiar with. I'll approve the PR.

This was a typo, my bad. Fixed in 0980161

@pront pront enabled auto-merge September 2, 2025 19:24
@pront pront added this pull request to the merge queue Sep 2, 2025
github-merge-queue bot pushed a commit that referenced this pull request Sep 2, 2025
* wip

* WIP2

* wip3

* ran cargo fmt

* refactoring otel source

* wip

* ran cargo fmt

* commit the otel proto desc

* refactoring

* fix re-build mess

* unrelated web-playground build fix

* avoid duplication in tests

* dbg tests

* dbg tests

* ran cargo fmt

* chore(dev): cargo vdev build licenses

* wip - cleanup

* ran cargo fmt

* chore(deps): cargo update -p vrl

* chore(dev): cargo vdev build licenses

* e2e - wip

* cleanup

* ran cargo fmt

* set default

* wip

* vdev cruft

* ran cargo fmt

* cleanup

* fix new config

* use JSON names - wip

* ran cargo fmt

* chore(dev): cargo vdev build licenses

* update VRL

* ran cargo fmt

* chore(dev): cargo vdev build licenses

* handle metrics too

* ran cargo fmt

* vrl update fixes

* ran cargo fmt

* wip

* chore(dev): cargo vdev build licenses

* fix typo and add first version of the changelog

* ran cargo fmt

* fix typo and add first version of the changelog

* add author

* Apply suggestions from code review

Co-authored-by: Ursula Chen <58821586+urseberry@users.noreply.github.com>

* tweaks to changelog

* gen comp docs

* fix changelog typo

---------

Co-authored-by: Ursula Chen <58821586+urseberry@users.noreply.github.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 2, 2025
@pront pront added this pull request to the merge queue Sep 2, 2025
Merged via the queue into master with commit cf211d1 Sep 2, 2025
86 checks passed
@pront pront deleted the pront/otel-investigation-logs branch September 2, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: ci Anything related to Vector's CI environment domain: core Anything related to core crates i.e. vector-core, core-common, etc domain: external docs Anything related to Vector's external, public documentation domain: sources Anything related to the Vector's sources
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants