Enabling Metrics

本文介绍了Druid系统的监控配置及指标收集方式,并详细说明了如何设置监控频率、选择监控器及配置不同类型的Emitter模块,包括LoggingEmitter、HttpEmitter等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Enabling Metrics

Druid nodes periodically emit metrics and different metrics monitors can be included. Each node can overwrite the default list of monitors.

PropertyDescriptionDefault
druid.monitoring.emissionPeriodHow often metrics are emitted.PT1m
druid.monitoring.monitorsSets list of Druid monitors used by a node. See below for names and more information. For example, you can specify monitors for a Broker withdruid.monitoring.monitors=["io.druid.java.util.metrics.SysMonitor","io.druid.java.util.metrics.JvmMonitor"].none (no monitors)

The following monitors are available:

NameDescription
io.druid.client.cache.CacheMonitorEmits metrics (to logs) about the segment results cache for Historical and Broker nodes. Reports typical cache statistics include hits, misses, rates, and size (bytes and number of entries), as well as timeouts and and errors.
io.druid.java.util.metrics.SysMonitorThis uses the SIGAR library to report on various system activities and statuses.
io.druid.server.metrics.HistoricalMetricsMonitorReports statistics on Historical nodes.
io.druid.java.util.metrics.JvmMonitorReports various JVM-related statistics.
io.druid.java.util.metrics.JvmCpuMonitorReports statistics of CPU consumption by the JVM.
io.druid.java.util.metrics.CpuAcctDeltaMonitorReports consumed CPU as per the cpuacct cgroup.
io.druid.java.util.metrics.JvmThreadsMonitorReports Thread statistics in the JVM, like numbers of total, daemon, started, died threads.
io.druid.segment.realtime.RealtimeMetricsMonitorReports statistics on Realtime nodes.
io.druid.server.metrics.EventReceiverFirehoseMonitorReports how many events have been queued in the EventReceiverFirehose.
io.druid.server.metrics.QueryCountStatsMonitorReports how many queries have been successful/failed/interrupted.
io.druid.server.emitter.HttpEmitterMonitorReports internal metrics of http or parametrized emitter (see below). Must not be used with another emitter type. See the description of the metrics here: https://github.com/druid-io/druid/pull/4973.

Emitting Metrics

The Druid servers emit various metrics and alerts via something we call an Emitter. There are three emitter implementations included with the code, a "noop" emitter, one that just logs to log4j ("logging", which is used by default if no emitter is specified) and one that does POSTs of JSON events to a server ("http"). The properties for using the logging emitter are described below.

PropertyDescriptionDefault
druid.emitterSetting this value to "noop", "logging", "http" or "parametrized" will initialize one of the emitter modules. value "composing" can be used to initialize multiple emitter modules.noop

Logging Emitter Module

PropertyDescriptionDefault
druid.emitter.logging.loggerClassChoices: HttpPostEmitter, LoggingEmitter, NoopServiceEmitter, ServiceEmitter. The class used for logging.LoggingEmitter
druid.emitter.logging.logLevelChoices: debug, info, warn, error. The log level at which message are logged.info

Http Emitter Module

PropertyDescriptionDefault
druid.emitter.http.flushMillisHow often the internal message buffer is flushed (data is sent).60000
druid.emitter.http.flushCountHow many messages the internal message buffer can hold before flushing (sending).500
druid.emitter.http.basicAuthenticationLogin and password for authentification in "login:password" form, e. g.druid.emitter.http.basicAuthentication=admin:adminpasswordnot specified = no authentification
`druid.emitter.http.flushTimeOutThe timeout after which an event should be sent to the endpoint, even if internal buffers are not filled, in milliseconds.not specified = no timeout
druid.emitter.http.batchingStrategyThe strategy of how the batch is formatted. "ARRAY" means[event1,event2], "NEWLINES" means event1\nevent2, ONLY_EVENTS means event1event2.ARRAY
druid.emitter.http.maxBatchSizeThe maximum batch size, in bytes.the minimum of (10% of JVM heap size divided by 2) or (5191680 (i. e. 5 MB))
druid.emitter.http.batchQueueSizeLimitThe maximum number of batches in emitter queue, if there are problems with emitting.the maximum of (2) or (10% of the JVM heap size divided by 5MB)
druid.emitter.http.minHttpTimeoutMillisIf the speed of filling batches imposes timeout smaller than that, not even trying to send batch to endpoint, because it will likely fail, not being able to send the data that fast. Configure this depending based on emitter/successfulSending/minTimeMs metric. Reasonable values are 10ms..100ms.0
druid.emitter.http.recipientBaseUrlThe base URL to emit messages to. Druid will POST JSON to be consumed at the HTTP endpoint specified by this property.none, required config

Parametrized Http Emitter Module

druid.emitter.parametrized.httpEmitting.* configs correspond to the configs of Http Emitter Modules, see above. ExceptrecipientBaseUrl. E. g. druid.emitter.parametrized.httpEmitting.flushMillis,druid.emitter.parametrized.httpEmitting.flushCount, etc.

The additional configs are:

PropertyDescriptionDefault
druid.emitter.parametrized.recipientBaseUrlPatternThe URL pattern to send an event to, based on the event's feed. E. g. http://foo.bar/{feed}, that will send event tohttp://foo.bar/metrics if the event's feed is "metrics".none, required config

Composing Emitter Module

PropertyDescriptionDefault
druid.emitter.composing.emittersList of emitter modules to load e.g. ["logging","http"].[]

Graphite Emitter

To use graphite as emitter set druid.emitter=graphite. For configuration details please follow this link.

Metadata Storage

These properties specify the jdbc connection and other configuration around the metadata storage. The only processes that connect to the metadata storage with these properties are the CoordinatorIndexing service and Realtime Nodes.

PropertyDescriptionDefault
druid.metadata.storage.typeThe type of metadata storage to use. Choose from "mysql", "postgresql", or "derby".derby
druid.metadata.storage.connector.connectURIThe jdbc uri for the database to connect tonone
druid.metadata.storage.connector.userThe username to connect with.none
druid.metadata.storage.connector.passwordThe Password Provider or String password used to connect with.none
druid.metadata.storage.connector.createTablesIf Druid requires a table and it doesn't exist, create it?true
druid.metadata.storage.tables.baseThe base name for tables.druid
druid.metadata.storage.tables.segmentsThe table to use to look for segments.druid_segments
druid.metadata.storage.tables.rulesThe table to use to look for segment load/drop rules.druid_rules
druid.metadata.storage.tables.configThe table to use to look for configs.druid_config
druid.metadata.storage.tables.tasksUsed by the indexing service to store tasks.druid_tasks
druid.metadata.storage.tables.taskLogUsed by the indexing service to store task logs.druid_taskLog
druid.metadata.storage.tables.taskLockUsed by the indexing service to store task locks.druid_taskLock
druid.metadata.storage.tables.supervisorsUsed by the indexing service to store supervisor configurations.druid_supervisors
druid.metadata.storage.tables.auditThe table to use for audit history of configuration changes e.g. Coordinator rules.druid_audit
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值