Skip to content

Conversation

AbhiPrasad
Copy link

Summary

This PR introduces a new sentry sink for sending log events to Sentry for Sentry's structured logging product.

Vector configuration

sinks:
  sentry_sink:
    type: "sentry"
    inputs: ["enrich_logs"]
    dsn: "MY_DSN_HERE"
    encoding:
      codec: "json"
    batch:
      max_events: 10
      timeout_secs: 5

How did you test this PR?

Tested with unit and integration tests, as well as manually building the sink to send logs to Sentry.

image

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

resolves #23325

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.

@AbhiPrasad AbhiPrasad requested review from a team as code owners September 10, 2025 16:05
@github-actions github-actions bot added domain: sinks Anything related to the Vector's sinks domain: ci Anything related to Vector's CI environment domain: external docs Anything related to Vector's external, public documentation labels Sep 10, 2025
@joepeeples
Copy link
Contributor

joepeeples commented Sep 10, 2025

Opened DOCS-12047 to assign a Docs writer and follow up with editorial review.

Copy link
Contributor

@joepeeples joepeeples left a comment

Choose a reason for hiding this comment

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

Approved with a few style & consistency edits to consider, thanks!

required: false
type: object: options: enabled: {
description: """
Whether or not end-to-end acknowledgements are enabled.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Whether or not end-to-end acknowledgements are enabled.
Controls whether or not end-to-end acknowledgements are enabled.

}
device_version: {
description: """
Identifies the version of the problem. The combination of the device product, vendor and this value make up the unique id of the device that sends messages.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Identifies the version of the problem. The combination of the device product, vendor and this value make up the unique id of the device that sends messages.
Identifies the version of the problem. The combination of the device product, vendor, and this value make up the unique id of the device that sends messages.

Comment on lines +152 to +153
This is a path that points to the field of a log event that reflects importance of the event.
Reflects importance of the event.
Copy link
Contributor

Choose a reason for hiding this comment

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

Repetitive; omit the second line?

Suggested change
This is a path that points to the field of a log event that reflects importance of the event.
Reflects importance of the event.
This is a path that points to the field of a log event that reflects importance of the event.

Comment on lines +267 to +268
Sets the capacity (in bytes) of the internal buffer used in the CSV writer.
This defaults to 8KB.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Sets the capacity (in bytes) of the internal buffer used in the CSV writer.
This defaults to 8KB.
Sets the capacity (in bytes) of the internal buffer used in the CSV writer.
This defaults to 8192 bytes (8KB).

relevant_when: "codec = \"json\""
required: false
type: object: options: pretty: {
description: "Whether to use pretty JSON formatting."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: "Whether to use pretty JSON formatting."
description: "Controls whether to use pretty JSON formatting."

description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -I <include path> -o <desc output path> <proto>`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`.

unix_float: "Represent the timestamp as a Unix timestamp in floating point."
unix_ms: "Represent the timestamp as a Unix timestamp in milliseconds."
unix_ns: "Represent the timestamp as a Unix timestamp in nanoseconds."
unix_us: "Represent the timestamp as a Unix timestamp in microseconds"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
unix_us: "Represent the timestamp as a Unix timestamp in microseconds"
unix_us: "Represent the timestamp as a Unix timestamp in microseconds."

description: """
Scale of RTT deviations which are not considered anomalous.

Valid values are greater than or equal to `0`, and we expect reasonable values to range from `1.0` to `3.0`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Valid values are greater than or equal to `0`, and we expect reasonable values to range from `1.0` to `3.0`.
Valid values are greater than or equal to `0`, and reasonable values range from `1.0` to `3.0`.

Comment on lines +484 to +487
When calculating the past RTT average, we also compute a secondary “deviation” value that indicates how variable
those values are. We use that deviation when comparing the past RTT average to the current measurements, so we
can ignore increases in RTT that are within an expected range. This factor is used to scale up the deviation to
an appropriate range. Larger values cause the algorithm to ignore larger increases in the RTT.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When calculating the past RTT average, we also compute a secondary “deviation” value that indicates how variable
those values are. We use that deviation when comparing the past RTT average to the current measurements, so we
can ignore increases in RTT that are within an expected range. This factor is used to scale up the deviation to
an appropriate range. Larger values cause the algorithm to ignore larger increases in the RTT.
When calculating the past RTT average, a secondary “deviation” value is also computed that indicates how variable
those values are. That deviation is used when comparing the past RTT average to the current measurements, so we
can ignore increases in RTT that are within an expected range. This factor is used to scale up the deviation to
an appropriate range. Larger values cause the algorithm to ignore larger increases in the RTT.

description: """
The amount of time to wait before attempting the first retry for a failed request.

After the first retry has failed, the fibonacci sequence is used to select future backoffs.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
After the first retry has failed, the fibonacci sequence is used to select future backoffs.
After the first retry has failed, the Fibonacci sequence is used to select future backoffs.

@AbhiPrasad
Copy link
Author

@joepeeples all the values that reviewed in the sentry.cue file is generated from other parts of the codebase (so not actually added or changed during this PR). I can help address them in a follow-up PR, but I'd rather this PR focus on the new sink and it's implementation.

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: external docs Anything related to Vector's external, public documentation domain: sinks Anything related to the Vector's sinks editorial review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new sink component for Sentry (sentry.io)
2 participants