Overview

Sentry allows you to track logs and error in real time. It provides insight into production deployments and information to reproduce and fix crashes.

The integration here supports error handling and reporting to Sentry, performance monitoring via spans and transactions as well as Sentry logging support.

Configuration

Support is enabled by including the following dependency in the WAR overlay:

1
2
3
4
5
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-sentry</artifactId>
    <version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-sentry:${project.'cas.version'}"
1
2
3
4
5
6
7
8
9
dependencyManagement {
    imports {
        mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
    }
}

dependencies {
    implementation "org.apereo.cas:cas-server-support-sentry"
}
1
2
3
4
5
6
7
8
9
10
dependencies {
    /*
        The following platform references are included automatically and are listed for reference only.

        implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}")
        implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
        
    */
    implementation "org.apereo.cas:cas-server-support-sentry"
}

The Logging configuration file must be adjusted to match the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn">
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
        </Console>
        <!-- Setting minimumBreadcrumbLevel modifies the default minimum level to add breadcrumbs from INFO to DEBUG  -->
        <!-- Setting minimumEventLevel the default minimum level to capture an event from ERROR to WARN  -->
        <Sentry name="Sentry" 
                minimumBreadcrumbLevel="DEBUG"
                minimumEventLevel="WARN"
                dsn="..." />
    </Appenders>
    <Loggers>
        <Root level="INFO">
            <AppenderRef ref="Sentry"/>
            <AppenderRef ref="casConsole"/>
        </Root>
    </Loggers>
</Configuration>

The following settings and properties are available from the CAS configuration catalog:

sentry.app-start-extender
no default
Third party
Type
IAppStartExtender
Default
none
Defined by
SentryProperties
sentry.attach-server-name
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.attach-stacktrace
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.attach-threads
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.backpressure-monitor
no default
Third party
Type
IBackpressureMonitor
Default
none
Defined by
SentryProperties
sentry.bundle-ids
no default
Third party
Type
Set<String>
Default
none
Defined by
SentryProperties
sentry.cache-dir-path
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.capture-open-telemetry-events
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.clients.ok-http-enabledEnable automatic instrumentation of Spring-managed OkHttp clients.
false
Third party

Enable automatic instrumentation of Spring-managed OkHttp clients. Disabled by default.

Type
Boolean
Default
false
Defined by
SentryProperties$Clients
sentry.composite-performance-collector
no default
Third party
Type
CompositePerformanceCollector
Default
none
Defined by
SentryProperties
sentry.connection-status-provider
no default
Third party
Type
IConnectionStatusProvider
Default
none
Defined by
SentryProperties
sentry.connection-timeout-millis
no default
Third party
Type
Integer
Default
none
Defined by
SentryProperties
sentry.context-tags
no default
Third party
Type
List<String>
Default
none
Defined by
SentryProperties
sentry.continuous-profiler
no default
Third party
Type
IContinuousProfiler
Default
none
Defined by
SentryProperties
sentry.cron.default-checkin-margin
no default
Third party
Type
Long
Default
none
Defined by
SentryOptions$Cron
sentry.cron.default-failure-issue-threshold
no default
Third party
Type
Long
Default
none
Defined by
SentryOptions$Cron
sentry.cron.default-max-runtime
no default
Third party
Type
Long
Default
none
Defined by
SentryOptions$Cron
sentry.cron.default-recovery-threshold
no default
Third party
Type
Long
Default
none
Defined by
SentryOptions$Cron
sentry.cron.default-timezone
no default
Third party
Type
String
Default
none
Defined by
SentryOptions$Cron
sentry.data-collection
no default
Third party
Type
DataCollection
Default
none
Defined by
SentryProperties
sentry.date-provider
no default
Third party
Type
SentryDateProvider
Default
none
Defined by
SentryProperties
sentry.deadline-timeout
no default
Third party
Type
Long
Default
none
Defined by
SentryProperties
sentry.debug
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.debug-meta-loader
no default
Third party
Type
IDebugMetaLoader
Default
none
Defined by
SentryProperties
sentry.default-scope-type
no default
Third party
Type
ScopeType
Default
none
Defined by
SentryProperties
sentry.diagnostic-level
no default
Third party
Type
SentryLevel
Default
none
Defined by
SentryProperties
sentry.dist
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.distinct-id
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.distribution-controller
no default
Third party
Type
IDistributionApi
Default
none
Defined by
SentryProperties
sentry.dsn
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.enable-aot-compatibilityIf set to true, this flag disables all AOP related features (e.g.
false
Third party

If set to true, this flag disables all AOP related features (e.g. io.sentry.spring7.tracing.SentryTransaction, io.sentry.spring7.tracing.SentrySpan) to successfully compile to GraalVM

Type
Boolean
Default
false
Defined by
SentryProperties
sentry.enable-app-start-profiling
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-auto-session-tracking
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-backpressure-handling
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-cache-tracing
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-database-transaction-tracing
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-deduplication
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-event-size-limiting
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-external-configuration
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-legacy-profiling
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-pretty-serialization-output
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-queue-tracing
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-scope-persistence
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-screen-tracking
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-shutdown-hook
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-spotlight
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-time-to-full-display-tracing
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-uncaught-exception-handler
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-user-interaction-breadcrumbs
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enable-user-interaction-tracing
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.enabled
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.envelope-disk-cache
no default
Third party
Type
IEnvelopeCache
Default
none
Defined by
SentryProperties
sentry.envelope-reader
no default
Third party
Type
IEnvelopeReader
Default
none
Defined by
SentryProperties
sentry.environment
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.event-processors
no default
Third party
Type
List<EventProcessor>
Default
none
Defined by
SentryProperties
sentry.exception-resolver-orderReport all or only uncaught web exceptions.
1
Third party

Report all or only uncaught web exceptions.

Type
Integer
Default
1
Defined by
SentryProperties
sentry.executor-service
no default
Third party
Type
ISentryExecutorService
Default
none
Defined by
SentryProperties
sentry.fatal-logger
no default
Third party
Type
ILogger
Default
none
Defined by
SentryProperties
sentry.feedback-options
no default
Third party
Type
SentryFeedbackOptions
Default
none
Defined by
SentryProperties
sentry.flush-timeout-millis
no default
Third party
Type
Long
Default
none
Defined by
SentryProperties
sentry.force-init
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.fully-displayed-reporter
no default
Third party
Type
FullyDisplayedReporter
Default
none
Defined by
SentryProperties
sentry.gesture-target-locators
no default
Third party
Type
List<GestureTargetLocator>
Default
none
Defined by
SentryProperties
sentry.global-hub-mode
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.graphql.ignored-error-typesList of error types the Sentry Graphql integration should ignore.
no default
Third party

List of error types the Sentry Graphql integration should ignore.

Type
List<String>
Default
none
Defined by
SentryProperties$Graphql
sentry.idle-timeout
no default
Third party
Type
Long
Default
none
Defined by
SentryProperties
sentry.ignored-check-ins
no default
Third party
Type
List<FilterString>
Default
none
Defined by
SentryProperties
sentry.ignored-errors
no default
Third party
Type
List<FilterString>
Default
none
Defined by
SentryProperties
sentry.ignored-exceptions-for-type
no default
Third party
Type
Set<Class<? extends Throwable>>
Default
none
Defined by
SentryProperties
sentry.ignored-span-origins
no default
Third party
Type
List<FilterString>
Default
none
Defined by
SentryProperties
sentry.ignored-transactions
no default
Third party
Type
List<FilterString>
Default
none
Defined by
SentryProperties
sentry.in-app-excludes
no default
Third party
Type
List<String>
Default
none
Defined by
SentryProperties
sentry.in-app-includes
no default
Third party
Type
List<String>
Default
none
Defined by
SentryProperties
sentry.init-priority
no default
Third party
Type
InitPriority
Default
none
Defined by
SentryProperties
sentry.instrumenter
no default
Third partyDeprecated
Type
Instrumenter
Default
none
Defined by
SentryProperties
Deprecation
WARNING, no replacement
sentry.integrations
no default
Third party
Type
List<Integration>
Default
none
Defined by
SentryProperties
sentry.keep-transactions-open-for-async-responses
false
Third party
Type
Boolean
Default
false
Defined by
SentryProperties
sentry.logger
no default
Third party
Type
ILogger
Default
none
Defined by
SentryProperties
sentry.logging.enabledEnable/Disable logging auto-configuration.
true
Third party

Enable/Disable logging auto-configuration.

Type
Boolean
Default
true
Defined by
SentryProperties$Logging
sentry.logging.loggersList of loggers the SentryAppender should be added to.
no default
Third party

List of loggers the SentryAppender should be added to.

Type
List<String>
Default
none
Defined by
SentryProperties$Logging
sentry.logging.minimum-breadcrumb-levelMinimum logging level for recording breadcrumbs.
no default
Third party

Minimum logging level for recording breadcrumbs.

Type
Level
Default
none
Defined by
SentryProperties$Logging
sentry.logging.minimum-event-levelMinimum logging level for recording events.
no default
Third party

Minimum logging level for recording events.

Type
Level
Default
none
Defined by
SentryProperties$Logging
sentry.logging.minimum-levelMinimum logging level for recording log events.
no default
Third party

Minimum logging level for recording log events.

Type
Level
Default
none
Defined by
SentryProperties$Logging
sentry.logs.enabled
no default
Third party
Type
Boolean
Default
none
Defined by
SentryOptions$Logs
sentry.logs.logger-batch-processor-factory
no default
Third party
Type
ILoggerBatchProcessorFactory
Default
none
Defined by
SentryOptions$Logs
sentry.max-attachment-size
no default
Third party
Type
Long
Default
none
Defined by
SentryProperties
sentry.max-breadcrumbs
no default
Third party
Type
Integer
Default
none
Defined by
SentryProperties
sentry.max-cache-items
no default
Third party
Type
Integer
Default
none
Defined by
SentryProperties
sentry.max-depth
no default
Third party
Type
Integer
Default
none
Defined by
SentryProperties
sentry.max-feature-flags
no default
Third party
Type
Integer
Default
none
Defined by
SentryProperties
sentry.max-queue-size
no default
Third party
Type
Integer
Default
none
Defined by
SentryProperties
sentry.max-request-body-size
no default
Third party
Type
SentryOptions.RequestSize
Default
none
Defined by
SentryProperties
sentry.max-spans
no default
Third party
Type
Integer
Default
none
Defined by
SentryProperties
sentry.max-trace-file-size
no default
Third party
Type
Long
Default
none
Defined by
SentryProperties
sentry.metrics.enabled
no default
Third party
Type
Boolean
Default
none
Defined by
SentryOptions$Metrics
sentry.metrics.metrics-batch-processor-factory
no default
Third party
Type
IMetricsBatchProcessorFactory
Default
none
Defined by
SentryOptions$Metrics
sentry.modules-loader
no default
Third party
Type
IModulesLoader
Default
none
Defined by
SentryProperties
sentry.open-telemetry-mode
no default
Third party
Type
SentryOpenTelemetryMode
Default
none
Defined by
SentryProperties
sentry.options-observers
no default
Third party
Type
List<IOptionsObserver>
Default
none
Defined by
SentryProperties
sentry.org-id
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.performance-collectors
no default
Third party
Type
List<IPerformanceCollector>
Default
none
Defined by
SentryProperties
sentry.print-uncaught-stack-trace
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.profile-lifecycle
no default
Third party
Type
ProfileLifecycle
Default
none
Defined by
SentryProperties
sentry.profile-session-sample-rate
no default
Third party
Type
Double
Default
none
Defined by
SentryProperties
sentry.profiler-converter
no default
Third party
Type
IProfileConverter
Default
none
Defined by
SentryProperties
sentry.profiles-sample-rate
no default
Third party
Type
Double
Default
none
Defined by
SentryProperties
sentry.profiling-traces-dir-path
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.profiling-traces-hz
no default
Third party
Type
Integer
Default
none
Defined by
SentryProperties
sentry.proguard-uuid
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.propagate-traceparent
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.proxy.host
no default
Third party
Type
String
Default
none
Defined by
SentryOptions$Proxy
sentry.proxy.pass
no default
Third party
Type
String
Default
none
Defined by
SentryOptions$Proxy
sentry.proxy.port
no default
Third party
Type
String
Default
none
Defined by
SentryOptions$Proxy
sentry.proxy.type
no default
Third party
Type
Proxy.Type
Default
none
Defined by
SentryOptions$Proxy
sentry.proxy.user
no default
Third party
Type
String
Default
none
Defined by
SentryOptions$Proxy
sentry.reactive.thread-local-accessor-enabledEnable/Disable usage of io.micrometer.context.ThreadLocalAccessor for Scopes propagation
true
Third party

Enable/Disable usage of io.micrometer.context.ThreadLocalAccessor for Scopes propagation

Type
Boolean
Default
true
Defined by
SentryProperties$Reactive
sentry.read-timeout-millis
no default
Third party
Type
Integer
Default
none
Defined by
SentryProperties
sentry.release
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.replay-controller
no default
Third party
Type
ReplayController
Default
none
Defined by
SentryProperties
sentry.sample-rate
no default
Third party
Type
Double
Default
none
Defined by
SentryProperties
sentry.scope-observers
no default
Third party
Type
List<IScopeObserver>
Default
none
Defined by
SentryProperties
sentry.scopes-storage-factory
no default
Third party
Type
IScopesStorageFactory
Default
none
Defined by
SentryProperties
sentry.sdk-version
no default
Third party
Type
SdkVersion
Default
none
Defined by
SentryProperties
sentry.send-client-reports
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.send-default-pii
no default
Third partyDeprecated
Type
Boolean
Default
none
Defined by
SentryProperties
Deprecation
WARNING, no replacement
sentry.send-modules
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.sentry-client-name
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.serializer
no default
Third party
Type
ISerializer
Default
none
Defined by
SentryProperties
sentry.server-name
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.session-flush-timeout-millis
no default
Third party
Type
Long
Default
none
Defined by
SentryProperties
sentry.session-replay
no default
Third party
Type
SentryReplayOptions
Default
none
Defined by
SentryProperties
sentry.session-tracking-interval-millis
no default
Third party
Type
Long
Default
none
Defined by
SentryProperties
sentry.shutdown-timeout-millis
no default
Third party
Type
Long
Default
none
Defined by
SentryProperties
sentry.socket-tagger
no default
Third party
Type
ISocketTagger
Default
none
Defined by
SentryProperties
sentry.span-factory
no default
Third party
Type
ISpanFactory
Default
none
Defined by
SentryProperties
sentry.spotlight-connection-url
no default
Third party
Type
String
Default
none
Defined by
SentryProperties
sentry.ssl-socket-factory
no default
Third party
Type
SSLSocketFactory
Default
none
Defined by
SentryProperties
sentry.start-profiler-on-app-start
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.strict-trace-continuation
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.tags
no default
Third party
Type
Map<String,String>
Default
none
Defined by
SentryProperties
sentry.thread-checker
no default
Third party
Type
IThreadChecker
Default
none
Defined by
SentryProperties
sentry.timer-executor-service
no default
Third party
Type
ISentryExecutorService
Default
none
Defined by
SentryProperties
sentry.trace-options-requests
no default
Third party
Type
Boolean
Default
none
Defined by
SentryProperties
sentry.trace-propagation-targets
no default
Third party
Type
List<String>
Default
none
Defined by
SentryProperties
sentry.trace-sampling
no default
Third partyDeprecated
Type
Boolean
Default
none
Defined by
SentryProperties
Deprecation
WARNING, no replacement
sentry.traces-sample-rate
no default
Third party
Type
Double
Default
none
Defined by
SentryProperties
sentry.transaction-profiler
no default
Third party
Type
ITransactionProfiler
Default
none
Defined by
SentryProperties
sentry.transport-factory
no default
Third party
Type
ITransportFactory
Default
none
Defined by
SentryProperties
sentry.transport-gate
no default
Third party
Type
ITransportGate
Default
none
Defined by
SentryProperties
sentry.use-git-commit-id-as-releaseWhether to use Git commit id as a release.
true
Third party

Whether to use Git commit id as a release.

Type
Boolean
Default
true
Defined by
SentryProperties
sentry.user-filter-orderDefines the io.sentry.spring.SentryUserFilter order.
no default
Third party

Defines the io.sentry.spring.SentryUserFilter order. The default value is org.springframework.core.Ordered.LOWEST_PRECEDENCE, if Spring Security is auto-configured, its guaranteed to run after Spring Security filter chain.

Type
Integer
Default
none
Defined by
SentryProperties
sentry.version-detector
no default
Third party
Type
IVersionDetector
Default
none
Defined by
SentryProperties
sentry.view-hierarchy-exporters
no default
Third party
Type
List<ViewHierarchyExporter>
Default
none
Defined by
SentryProperties

Required settings may be needed to activate or affect the feature; review them even when they have a default. Optional settings only need to be set to change a default or to turn on the behavior they control. Third party settings belong to libraries such as Spring Boot that CAS builds on; their own documentation may have more detail.

Notes on configuration

Configuration Metadata

The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.

Be Selective

This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.

YAGNI

Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.

Naming Convention

Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those that might be presented to the system via an external library or framework such as Spring Boot, etc.

:information_source: Note

When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value. The only possible exception to this rule is when naming actuator endpoints; The name of the actuator endpoints (i.e. ssoSessions) MUST remain in camelCase mode.

Settings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the way you intend.

Validation

Configuration properties are automatically validated on CAS startup to report issues with configuration binding, especially if defined CAS settings cannot be recognized or validated by the configuration schema. Additional validation processes are also handled via Configuration Metadata and property migrations applied automatically on startup by Spring Boot and family.

Indexed Settings

CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be incremented by the adopter to allow for distinct multiple configuration blocks.

Breadcrumbs are kept in memory (by default the last 100 records) and are sent with events. For example, by default, if you log 100 entries with logger.info or logger.warn, no event is sent to Sentry. If you then log with logger.error, an event is sent to Sentry that includes those 100 info or warn messages. For this to work, SentryAppender needs to receive all log entries to decide what to keep as breadcrumb or send as event. Set the SentryAppender log level configuration to a value lower than what is set for the minimumBreadcrumbLevel and minimumEventLevel so that it receives these log messages.

Finally, you will need to configure your DSN (client key) and optionally other values such as environment and release.

You can do so in a src/main/resources/sentry.properties file:

1
dsn=https://12345@12345.ingest.sentry.io/12345

Or via system properties when you launch CAS:

1
java -Dsentry.dsn=https://12345@12345.ingest.sentry.io/12345 ...

Or via environment variables before you launch CAS:

1
export SENTRY_DSN=https://12345@12345.ingest.sentry.io/12345