pub struct Config { /* private fields */ }
Expand description
Config struct.
Implementations§
source§impl Config
impl Config
sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<Config>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Config>
Loads a config from a given config folder.
sourcepub fn from_json_value(value: Value) -> Result<Config>
pub fn from_json_value(value: Value) -> Result<Config>
Creates a config from a JSON value.
This is mostly useful for tests.
sourcepub fn apply_override(
&mut self,
overrides: OverridableConfig,
) -> Result<&mut Self>
pub fn apply_override( &mut self, overrides: OverridableConfig, ) -> Result<&mut Self>
Override configuration with values coming from other sources (e.g. env variables or command line parameters)
sourcepub fn config_exists<P: AsRef<Path>>(path: P) -> bool
pub fn config_exists<P: AsRef<Path>>(path: P) -> bool
Checks if the config is already initialized.
sourcepub fn to_yaml_string(&self) -> Result<String>
pub fn to_yaml_string(&self) -> Result<String>
Dumps out a YAML string of the values.
sourcepub fn regenerate_credentials(&mut self, save: bool) -> Result<()>
pub fn regenerate_credentials(&mut self, save: bool) -> Result<()>
Regenerates the relay credentials.
This also writes the credentials back to the file.
sourcepub fn credentials(&self) -> Option<&Credentials>
pub fn credentials(&self) -> Option<&Credentials>
Return the current credentials
sourcepub fn replace_credentials(
&mut self,
credentials: Option<Credentials>,
) -> Result<bool>
pub fn replace_credentials( &mut self, credentials: Option<Credentials>, ) -> Result<bool>
Set new credentials.
This also writes the credentials back to the file.
sourcepub fn has_credentials(&self) -> bool
pub fn has_credentials(&self) -> bool
Returns true
if the config is ready to use.
sourcepub fn secret_key(&self) -> Option<&SecretKey>
pub fn secret_key(&self) -> Option<&SecretKey>
Returns the secret key if set.
sourcepub fn public_key(&self) -> Option<&PublicKey>
pub fn public_key(&self) -> Option<&PublicKey>
Returns the public key if set.
sourcepub fn relay_mode(&self) -> RelayMode
pub fn relay_mode(&self) -> RelayMode
Returns the relay mode.
sourcepub fn relay_instance(&self) -> RelayInstance
pub fn relay_instance(&self) -> RelayInstance
Returns the instance type of relay.
sourcepub fn upstream_descriptor(&self) -> &UpstreamDescriptor<'_>
pub fn upstream_descriptor(&self) -> &UpstreamDescriptor<'_>
Returns the upstream target as descriptor.
sourcepub fn http_host_header(&self) -> Option<&str>
pub fn http_host_header(&self) -> Option<&str>
Returns the custom HTTP “Host” header.
sourcepub fn listen_addr(&self) -> SocketAddr
pub fn listen_addr(&self) -> SocketAddr
Returns the listen address.
sourcepub fn tls_listen_addr(&self) -> Option<SocketAddr>
pub fn tls_listen_addr(&self) -> Option<SocketAddr>
Returns the TLS listen address.
sourcepub fn tls_identity_path(&self) -> Option<&Path>
pub fn tls_identity_path(&self) -> Option<&Path>
Returns the path to the identity bundle
sourcepub fn tls_identity_password(&self) -> Option<&str>
pub fn tls_identity_password(&self) -> Option<&str>
Returns the password for the identity bundle
sourcepub fn override_project_ids(&self) -> bool
pub fn override_project_ids(&self) -> bool
Returns true
when project IDs should be overriden rather than validated.
Defaults to false
, which requires project ID validation.
sourcepub fn requires_auth(&self) -> bool
pub fn requires_auth(&self) -> bool
Returns true
if Relay requires authentication for readiness.
See ReadinessCondition
for more information.
sourcepub fn http_auth_interval(&self) -> Option<Duration>
pub fn http_auth_interval(&self) -> Option<Duration>
Returns the interval at which Realy should try to re-authenticate with the upstream.
Always disabled in processing mode.
sourcepub fn http_outage_grace_period(&self) -> Duration
pub fn http_outage_grace_period(&self) -> Duration
The maximum time of experiencing uninterrupted network failures until Relay considers that it has encountered a network outage.
sourcepub fn http_retry_delay(&self) -> Duration
pub fn http_retry_delay(&self) -> Duration
Time Relay waits before retrying an upstream request.
Before going into a network outage, Relay may fail to make upstream requests. This is the time Relay waits before retrying the same request.
sourcepub fn http_project_failure_interval(&self) -> Duration
pub fn http_project_failure_interval(&self) -> Duration
Time of continued project request failures before Relay emits an error.
sourcepub fn http_encoding(&self) -> HttpEncoding
pub fn http_encoding(&self) -> HttpEncoding
Content encoding of upstream requests.
sourcepub fn http_global_metrics(&self) -> bool
pub fn http_global_metrics(&self) -> bool
Returns whether metrics should be sent globally through a shared endpoint.
sourcepub fn emit_outcomes(&self) -> EmitOutcomes
pub fn emit_outcomes(&self) -> EmitOutcomes
Returns whether this Relay should emit outcomes.
This is true
either if outcomes.emit_outcomes
is explicitly enabled, or if this Relay is
in processing mode.
sourcepub fn emit_client_outcomes(&self) -> bool
pub fn emit_client_outcomes(&self) -> bool
Returns whether this Relay should emit client outcomes
Relays that do not emit client outcomes will forward client recieved outcomes directly to the next relay in the chain as client report envelope. This is only done if this relay emits outcomes at all. A relay that will not emit outcomes will forward the envelope unchanged.
This flag can be explicitly disabled on processing relays as well to prevent the emitting of client outcomes to the kafka topic.
sourcepub fn outcome_batch_size(&self) -> usize
pub fn outcome_batch_size(&self) -> usize
Returns the maximum number of outcomes that are batched before being sent
sourcepub fn outcome_batch_interval(&self) -> Duration
pub fn outcome_batch_interval(&self) -> Duration
Returns the maximum interval that an outcome may be batched
sourcepub fn outcome_source(&self) -> Option<&str>
pub fn outcome_source(&self) -> Option<&str>
The originating source of the outcome
sourcepub fn outcome_aggregator(&self) -> &OutcomeAggregatorConfig
pub fn outcome_aggregator(&self) -> &OutcomeAggregatorConfig
Returns the width of the buckets into which outcomes are aggregated, in seconds.
sourcepub fn sentry(&self) -> &SentryConfig
pub fn sentry(&self) -> &SentryConfig
Returns logging configuration.
sourcepub fn statsd_addrs(&self) -> Result<Vec<SocketAddr>>
pub fn statsd_addrs(&self) -> Result<Vec<SocketAddr>>
Returns the socket addresses for statsd.
If stats is disabled an empty vector is returned.
sourcepub fn metrics_prefix(&self) -> &str
pub fn metrics_prefix(&self) -> &str
Return the prefix for statsd metrics.
Returns the default tags for statsd metrics.
sourcepub fn metrics_hostname_tag(&self) -> Option<&str>
pub fn metrics_hostname_tag(&self) -> Option<&str>
Returns the name of the hostname tag that should be attached to each outgoing metric.
sourcepub fn metrics_sample_rate(&self) -> f32
pub fn metrics_sample_rate(&self) -> f32
Returns the global sample rate for all metrics.
sourcepub fn metrics_aggregate(&self) -> bool
pub fn metrics_aggregate(&self) -> bool
Returns whether local metric aggregation should be enabled.
sourcepub fn metrics_periodic_interval(&self) -> Option<Duration>
pub fn metrics_periodic_interval(&self) -> Option<Duration>
Returns the interval for periodic metrics emitted from Relay.
None
if periodic metrics are disabled.
sourcepub fn http_timeout(&self) -> Duration
pub fn http_timeout(&self) -> Duration
Returns the default timeout for all upstream HTTP requests.
sourcepub fn http_connection_timeout(&self) -> Duration
pub fn http_connection_timeout(&self) -> Duration
Returns the connection timeout for all upstream HTTP requests.
sourcepub fn http_max_retry_interval(&self) -> Duration
pub fn http_max_retry_interval(&self) -> Duration
Returns the failed upstream request retry interval.
sourcepub fn project_cache_expiry(&self) -> Duration
pub fn project_cache_expiry(&self) -> Duration
Returns the expiry timeout for cached projects.
sourcepub fn request_full_project_config(&self) -> bool
pub fn request_full_project_config(&self) -> bool
Returns true
if the full project state should be requested from upstream.
sourcepub fn relay_cache_expiry(&self) -> Duration
pub fn relay_cache_expiry(&self) -> Duration
Returns the expiry timeout for cached relay infos (public keys).
sourcepub fn envelope_buffer_size(&self) -> usize
pub fn envelope_buffer_size(&self) -> usize
Returns the maximum number of buffered envelopes
sourcepub fn cache_miss_expiry(&self) -> Duration
pub fn cache_miss_expiry(&self) -> Duration
Returns the expiry timeout for cached misses before trying to refetch.
sourcepub fn project_grace_period(&self) -> Duration
pub fn project_grace_period(&self) -> Duration
Returns the grace period for project caches.
sourcepub fn query_batch_interval(&self) -> Duration
pub fn query_batch_interval(&self) -> Duration
Returns the duration in which batchable project config queries are collected before sending them in a single request.
sourcepub fn downstream_relays_batch_interval(&self) -> Duration
pub fn downstream_relays_batch_interval(&self) -> Duration
Returns the duration in which downstream relays are requested from upstream.
sourcepub fn local_cache_interval(&self) -> Duration
pub fn local_cache_interval(&self) -> Duration
Returns the interval in seconds in which local project configurations should be reloaded.
sourcepub fn global_config_fetch_interval(&self) -> Duration
pub fn global_config_fetch_interval(&self) -> Duration
Returns the interval in seconds in which fresh global configs should be fetched from upstream.
sourcepub fn spool_envelopes_path(&self, partition_id: u8) -> Option<PathBuf>
pub fn spool_envelopes_path(&self, partition_id: u8) -> Option<PathBuf>
Returns the path of the buffer file if the cache.persistent_envelope_buffer.path
is configured.
In case a partition with id > 0 is supplied, the filename of the envelopes path will be
suffixed with .{partition_id}
.
sourcepub fn spool_envelopes_max_disk_size(&self) -> usize
pub fn spool_envelopes_max_disk_size(&self) -> usize
The maximum size of the buffer, in bytes.
sourcepub fn spool_envelopes_batch_size_bytes(&self) -> usize
pub fn spool_envelopes_batch_size_bytes(&self) -> usize
Number of encoded envelope bytes that need to be accumulated before flushing one batch to disk.
sourcepub fn spool_envelopes_max_age(&self) -> Duration
pub fn spool_envelopes_max_age(&self) -> Duration
Returns the time after which we drop envelopes as a Duration
object.
sourcepub fn spool_disk_usage_refresh_frequency_ms(&self) -> Duration
pub fn spool_disk_usage_refresh_frequency_ms(&self) -> Duration
Returns the refresh frequency for disk usage monitoring as a Duration
object.
sourcepub fn spool_max_backpressure_envelopes(&self) -> usize
pub fn spool_max_backpressure_envelopes(&self) -> usize
Returns the maximum number of envelopes that can be put in the bounded buffer.
sourcepub fn spool_max_backpressure_memory_percent(&self) -> f32
pub fn spool_max_backpressure_memory_percent(&self) -> f32
Returns the relative memory usage up to which the disk buffer will unspool envelopes.
sourcepub fn spool_partitions(&self) -> NonZeroU8
pub fn spool_partitions(&self) -> NonZeroU8
Returns the number of partitions for the buffer.
sourcepub fn max_event_size(&self) -> usize
pub fn max_event_size(&self) -> usize
Returns the maximum size of an event payload in bytes.
sourcepub fn max_attachment_size(&self) -> usize
pub fn max_attachment_size(&self) -> usize
Returns the maximum size of each attachment.
sourcepub fn max_attachments_size(&self) -> usize
pub fn max_attachments_size(&self) -> usize
Returns the maximum combined size of attachments or payloads containing attachments (minidump, unreal, standalone attachments) in bytes.
sourcepub fn max_client_reports_size(&self) -> usize
pub fn max_client_reports_size(&self) -> usize
Returns the maximum combined size of client reports in bytes.
sourcepub fn max_check_in_size(&self) -> usize
pub fn max_check_in_size(&self) -> usize
Returns the maximum payload size of a monitor check-in in bytes.
sourcepub fn max_span_size(&self) -> usize
pub fn max_span_size(&self) -> usize
Returns the maximum payload size of a span in bytes.
sourcepub fn max_envelope_size(&self) -> usize
pub fn max_envelope_size(&self) -> usize
Returns the maximum size of an envelope payload in bytes.
Individual item size limits still apply.
sourcepub fn max_session_count(&self) -> usize
pub fn max_session_count(&self) -> usize
Returns the maximum number of sessions per envelope.
sourcepub fn max_statsd_size(&self) -> usize
pub fn max_statsd_size(&self) -> usize
Returns the maximum payload size of a statsd metric in bytes.
sourcepub fn max_metric_buckets_size(&self) -> usize
pub fn max_metric_buckets_size(&self) -> usize
Returns the maximum payload size of metric buckets in bytes.
sourcepub fn metric_stats_enabled(&self) -> bool
pub fn metric_stats_enabled(&self) -> bool
Whether metric stats are collected and emitted.
Metric stats are always collected and emitted when processing is enabled.
sourcepub fn max_api_payload_size(&self) -> usize
pub fn max_api_payload_size(&self) -> usize
Returns the maximum payload size for general API requests.
sourcepub fn max_api_file_upload_size(&self) -> usize
pub fn max_api_file_upload_size(&self) -> usize
Returns the maximum payload size for file uploads and chunks.
sourcepub fn max_api_chunk_upload_size(&self) -> usize
pub fn max_api_chunk_upload_size(&self) -> usize
Returns the maximum payload size for chunks
sourcepub fn max_profile_size(&self) -> usize
pub fn max_profile_size(&self) -> usize
Returns the maximum payload size for a profile
sourcepub fn max_replay_compressed_size(&self) -> usize
pub fn max_replay_compressed_size(&self) -> usize
Returns the maximum payload size for a compressed replay.
sourcepub fn max_replay_uncompressed_size(&self) -> usize
pub fn max_replay_uncompressed_size(&self) -> usize
Returns the maximum payload size for an uncompressed replay.
sourcepub fn max_replay_message_size(&self) -> usize
pub fn max_replay_message_size(&self) -> usize
Returns the maximum message size for an uncompressed replay.
This is greater than max_replay_compressed_size because it can include additional metadata about the replay in addition to the recording.
sourcepub fn max_concurrent_requests(&self) -> usize
pub fn max_concurrent_requests(&self) -> usize
Returns the maximum number of active requests
sourcepub fn max_concurrent_queries(&self) -> usize
pub fn max_concurrent_queries(&self) -> usize
Returns the maximum number of active queries
sourcepub fn query_timeout(&self) -> Duration
pub fn query_timeout(&self) -> Duration
The maximum number of seconds a query is allowed to take across retries.
sourcepub fn shutdown_timeout(&self) -> Duration
pub fn shutdown_timeout(&self) -> Duration
The maximum number of seconds to wait for pending envelopes after receiving a shutdown signal.
sourcepub fn keepalive_timeout(&self) -> Duration
pub fn keepalive_timeout(&self) -> Duration
Returns the server keep-alive timeout in seconds.
By default keep alive is set to a 5 seconds.
sourcepub fn idle_timeout(&self) -> Option<Duration>
pub fn idle_timeout(&self) -> Option<Duration>
Returns the server idle timeout in seconds.
sourcepub fn tcp_listen_backlog(&self) -> u32
pub fn tcp_listen_backlog(&self) -> u32
TCP listen backlog to configure on Relay’s listening socket.
sourcepub fn cpu_concurrency(&self) -> usize
pub fn cpu_concurrency(&self) -> usize
Returns the number of cores to use for thread pools.
sourcepub fn query_batch_size(&self) -> usize
pub fn query_batch_size(&self) -> usize
Returns the maximum size of a project config query.
sourcepub fn project_configs_path(&self) -> PathBuf
pub fn project_configs_path(&self) -> PathBuf
Get filename for static project config.
sourcepub fn processing_enabled(&self) -> bool
pub fn processing_enabled(&self) -> bool
True if the Relay should do processing.
sourcepub fn normalization_level(&self) -> NormalizationLevel
pub fn normalization_level(&self) -> NormalizationLevel
Level of normalization for Relay to apply to incoming data.
sourcepub fn geoip_path(&self) -> Option<&Path>
pub fn geoip_path(&self) -> Option<&Path>
The path to the GeoIp database required for event processing.
sourcepub fn max_secs_in_future(&self) -> i64
pub fn max_secs_in_future(&self) -> i64
Maximum future timestamp of ingested data.
Events past this timestamp will be adjusted to now()
. Sessions will be dropped.
sourcepub fn max_session_secs_in_past(&self) -> i64
pub fn max_session_secs_in_past(&self) -> i64
Maximum age of ingested sessions. Older sessions will be dropped.
sourcepub fn kafka_config(
&self,
topic: KafkaTopic,
) -> Result<KafkaParams<'_>, KafkaConfigError>
pub fn kafka_config( &self, topic: KafkaTopic, ) -> Result<KafkaParams<'_>, KafkaConfigError>
Configuration name and list of Kafka configuration parameters for a given topic.
sourcepub fn kafka_validate_topics(&self) -> bool
pub fn kafka_validate_topics(&self) -> bool
Whether to validate the topics against Kafka.
sourcepub fn unused_topic_assignments(&self) -> &BTreeMap<String, TopicAssignment>
pub fn unused_topic_assignments(&self) -> &BTreeMap<String, TopicAssignment>
All unused but configured topic assignments.
sourcepub fn redis(&self) -> Option<RedisPoolConfigs<'_>>
pub fn redis(&self) -> Option<RedisPoolConfigs<'_>>
Redis servers to connect to for project configs, cardinality limits, rate limiting, and metrics metadata.
sourcepub fn attachment_chunk_size(&self) -> usize
pub fn attachment_chunk_size(&self) -> usize
Chunk size of attachments in bytes.
sourcepub fn metrics_max_batch_size_bytes(&self) -> usize
pub fn metrics_max_batch_size_bytes(&self) -> usize
Maximum metrics batch size in bytes.
sourcepub fn projectconfig_cache_prefix(&self) -> &str
pub fn projectconfig_cache_prefix(&self) -> &str
Default prefix to use when looking up project configs in Redis. This is only done when Relay is in processing mode.
sourcepub fn max_rate_limit(&self) -> Option<u64>
pub fn max_rate_limit(&self) -> Option<u64>
Maximum rate limit to report to clients in seconds.
sourcepub fn cardinality_limiter_cache_vacuum_interval(&self) -> Duration
pub fn cardinality_limiter_cache_vacuum_interval(&self) -> Duration
Cache vacuum interval for the cardinality limiter in memory cache.
The cache will scan for expired values based on this interval.
sourcepub fn health_refresh_interval(&self) -> Duration
pub fn health_refresh_interval(&self) -> Duration
Interval to refresh internal health checks.
sourcepub fn health_max_memory_watermark_bytes(&self) -> u64
pub fn health_max_memory_watermark_bytes(&self) -> u64
Maximum memory watermark in bytes.
sourcepub fn health_max_memory_watermark_percent(&self) -> f32
pub fn health_max_memory_watermark_percent(&self) -> f32
Maximum memory watermark as a percentage of maximum system memory.
sourcepub fn health_probe_timeout(&self) -> Duration
pub fn health_probe_timeout(&self) -> Duration
Health check probe timeout.
sourcepub fn memory_stat_refresh_frequency_ms(&self) -> u64
pub fn memory_stat_refresh_frequency_ms(&self) -> u64
Refresh frequency for polling new memory stats.
sourcepub fn cogs_max_queue_size(&self) -> u64
pub fn cogs_max_queue_size(&self) -> u64
Maximum amount of COGS measurements buffered in memory.
sourcepub fn cogs_relay_resource_id(&self) -> &str
pub fn cogs_relay_resource_id(&self) -> &str
Resource ID to use for Relay COGS measurements.
sourcepub fn default_aggregator_config(&self) -> &AggregatorServiceConfig
pub fn default_aggregator_config(&self) -> &AggregatorServiceConfig
Returns configuration for the default metrics aggregator.
sourcepub fn secondary_aggregator_configs(&self) -> &Vec<ScopedAggregatorConfig>
pub fn secondary_aggregator_configs(&self) -> &Vec<ScopedAggregatorConfig>
Returns configuration for non-default metrics aggregator.
sourcepub fn aggregator_config_for(
&self,
namespace: MetricNamespace,
) -> &AggregatorServiceConfig
pub fn aggregator_config_for( &self, namespace: MetricNamespace, ) -> &AggregatorServiceConfig
Returns aggregator config for a given metrics namespace.
sourcepub fn static_relays(&self) -> &HashMap<RelayId, RelayInfo>
pub fn static_relays(&self) -> &HashMap<RelayId, RelayInfo>
Return the statically configured Relays.
sourcepub fn accept_unknown_items(&self) -> bool
pub fn accept_unknown_items(&self) -> bool
Returns true
if unknown items should be accepted and forwarded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more