Skip to main content
Version: Next

Sentry

Sentry sink connector

Support Those Engines

Spark
Flink
SeaTunnel Zeta

Key features

Description

Write SeaTunnel rows to Sentry as messages. Each row is sent through the Sentry SDK by calling Sentry.captureMessage(row.toString()). The connector is useful for forwarding SeaTunnel events into Sentry for alerting and aggregation alongside other application events.

Data Type Mapping

All row values are converted with row.toString() before they are passed to the Sentry SDK, so the Sentry message payload is always a string regardless of the underlying field types.

SeaTunnel Data TypeSentry Message Format
stringString
tinyint / smallint / int / bigintString (toString)
float / doubleString (toString)
booleanString (toString)
date / time / timestampString (toString)
bytes / array / map / rowString (toString)

Sink Options

nametyperequireddefault valuedescription
dsnstringyes-Sentry DSN used by the SDK to send events.
envstringno-Sentry environment name, attached to every event.
releasestringno-Sentry release value, attached to every event.
cacheDirPathstringno-Cache directory used by the Sentry SDK to buffer offline events before they are sent.
enableExternalConfigurationbooleanno-Whether the Sentry SDK can load external configuration such as sentry.properties.
maxCacheItemsintno-Maximum number of cached events. Defaults to 30 in the SDK when not set.
flushTimeoutMillislongno-Time in milliseconds to wait while flushing pending events.
maxQueueSizeintno-Maximum queue size before events are flushed to disk.
common-optionsno-Sink plugin common parameters, please refer to Sink Common Options for details.

dsn [string]

The DSN tells the SDK where to send the events to. Format is the standard Sentry DSN, e.g. https://<publicKey>@<host>/<projectId>.

env [string]

Specify the Sentry environment name (for example prod, staging). The value is attached to every event captured through this sink.

release [string]

Specify the Sentry release value (for example my-app@1.2.3). The value is attached to every event captured through this sink.

cacheDirPath [string]

The cache directory path for buffering offline events. Set this to a writable local directory when the sink may run in environments where the Sentry server is not always reachable.

enableExternalConfiguration [boolean]

If loading properties from external sources (such as sentry.properties on the classpath) is enabled. Set this to true to let the Sentry SDK pick up environment-specific configuration files.

maxCacheItems [number]

The maximum number of cached events before the SDK starts dropping older ones. Defaults to 30 when not set.

flushTimeoutMillis [long]

Controls how many milliseconds to wait while flushing pending events when the writer closes.

maxQueueSize [number]

Maximum queue size before events are flushed to disk. Increase this when the sink produces events faster than the network can drain them.

common options

Sink plugin common parameters, please refer to Sink Common Options for details.

Task Example

Simple

sink {
Sentry {
dsn = "https://xxx@sentry.xxx.com:9999/6"
enableExternalConfiguration = true
maxCacheItems = 1000
flushTimeoutMillis = 15000
env = "prod"
}
}

With upstream source

A typical end-to-end job that forwards rows from a fake source to Sentry.

env {
parallelism = 1
job.mode = "BATCH"
}

source {
FakeSource {
schema = {
fields {
event = string
severity = string
}
}
rows = [
{ kind = "INSERT", fields = ["service-restart", "warning"] }
]
}
}

sink {
Sentry {
dsn = "https://xxx@sentry.xxx.com:9999/6"
env = "prod"
release = "seatunnel-job@1.0.0"
enableExternalConfiguration = false
maxCacheItems = 1000
flushTimeoutMillis = 15000
}
}

Changelog

Change Log
ChangeCommitVersion
[improve] sentry options (#9261)https://github.com/apache/seatunnel/commit/4a2f3fa9152.3.11
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786)https://github.com/apache/seatunnel/commit/6b7c53d03c2.3.9
[Improve] Remove use SeaTunnelSink::getConsumedType method and mark it as deprecated (#5755)https://github.com/apache/seatunnel/commit/8de74081002.3.4
[Improve][build] Give the maven module a human readable name (#4114)https://github.com/apache/seatunnel/commit/d7cd6010512.3.1
[Improve][Project] Code format with spotless plugin. (#4101)https://github.com/apache/seatunnel/commit/a2ab1665612.3.1
[Hotfix][OptionRule] Fix option rule about all connectors (#3592)https://github.com/apache/seatunnel/commit/226dc6a1192.3.0
[Improve][Connector-V2][Sentry] Unified exception for sentry sink connector (#3513)https://github.com/apache/seatunnel/commit/94b472b8062.3.0
[Connector][Dependency] Add Miss Dependency Cassandra And Change Kudu Plugin Name (#3432)https://github.com/apache/seatunnel/commit/6ac6a0a0cd2.3.0
[Feature][Sentry Sink V2] Add Sentry Sink Option Rules (#3318)https://github.com/apache/seatunnel/commit/850f4838162.3.0
[Feature][Connector-V2] Add sentry sink connector #2244 (#2584)https://github.com/apache/seatunnel/commit/9fd40390a72.2.0-beta