- 1. Overview
- 1. 概述
- 2. Configuration
- 2. 配置方法
- 3. Operations execution
- 3. 程序接口调用方式
- 4. Data serialization
- 4. 数据序列化
- 5. Data partitioning(sharding)
- 5. 单个集合数据分片(Sharding)
- 5.1. Common operations over objects
- 6. Distributed objects
- 6. 分布式对象
- 7. Distributed collections
- 7. 分布式集合
- 8. Distributed locks and synchronizers
- 8. 分布式锁和同步器
- 9. Distributed services
- 9. 分布式服务
- 10. Additional features
- 10. 额外功能
- 11. Redis commands mapping
- 11. Redis 命令和 Redisson 对象匹配列表
- 12. Standalone node
- 12. 独立节点模式
- 13. Tools
- 13. 工具
- 14. Integration with frameworks
- 14. 第三方框架整合
- 15. Dependency list
- 15. 项目依赖列表
- 16. FAQ
- 16. Observability
16. Observability
16.1. Metrics
This feature is available only in Redisson PRO
Redisson provides integration the most popular monitoring systems through Micrometer framework.
1. AppOptics
groupId: io.micrometer
artifactId: micrometer-registry-appoptics
Class: org.redisson.config.metrics.AppOpticsMeterRegistryProvider
Parameters:
uri
- AppOptics host urihostTag
- tag mapped to hostapiToken
- AppOptics api tokennumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
2. Atlas
groupId: io.micrometer
artifactId: micrometer-registry-atlas
Class: org.redisson.config.metrics.AtlasMeterRegistryProvider
Parameters:
uri
- Atlas host uriconfigUri
- Atlas LWC endpoint uri to retrieve current subscriptionsevalUri
- Atlas LWC endpoint uri to evaluate the data for a subscriptionnumThreads
- number of threads used by scheduler (default is 4)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 10000)
3. Azure
groupId: io.micrometer
artifactId: micrometer-registry-azure-monitor
Class: org.redisson.config.metrics.AzureMonitorMeterRegistryProvider
Parameters:
instrumentationKey
- instrumentation keynumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
4. Amazon CloudWatch
groupId: io.micrometer
artifactId: micrometer-registry-cloudwatch
Class: org.redisson.config.metrics.CloudWatchMeterRegistryProvider
Parameters:
accessKey
- AWS access keysecretKey
- AWS secret access keynamespace
- namespace valuenumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
5. Datadog
groupId: io.micrometer
artifactId: micrometer-registry-datadog
Class: org.redisson.config.metrics.DatadogMeterRegistryProvider
Parameters:
uri
- Datadog host urihostTag
- tag mapped to hostapiKey
- api keynumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
6. Dropwizard
Class: org.redisson.config.metrics.DropwizardMeterRegistryProvider
Parameters:
sharedRegistryName
- name used to store instance inSharedMetricRegistries
nameMapper
- custom implementation ofio.micrometer.core.instrument.util.HierarchicalNameMapper
7. Dynatrace
Class: org.redisson.config.metrics.DynatraceMeterRegistryProvider
Parameters:
uri
- Dynatrace host uriapiToken
- api tokendeviceId
- device idnumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
8. Elastic
groupId: io.micrometer
artifactId: micrometer-registry-elastic
Class: org.redisson.config.metrics.ElasticMeterRegistryProvider
Parameters:
host
- Elasticsearch host uriuserName
- user namepassword
- passwordnumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
9. Ganglia
groupId: io.micrometer
artifactId: micrometer-registry-ganglia
Class: org.redisson.config.metrics.GangliaMeterRegistryProvider
Parameters:
host
- Ganglia host addressport
- Ganglia portnumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
10. Graphite
groupId: io.micrometer
artifactId: micrometer-registry-graphite
Class: org.redisson.config.metrics.GraphiteMeterRegistryProvider
Parameters:
host
- Graphite host addressport
- Graphite port
11. Humio
groupId: io.micrometer
artifactId: micrometer-registry-humio
Class: org.redisson.config.metrics.HumioMeterRegistryProvider
Parameters:
uri
- Humio host urirepository
- repository nameapiToken
- api tokennumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
12. Influx
groupId: io.micrometer
artifactId: micrometer-registry-influx
Class: org.redisson.config.metrics.InfluxMeterRegistryProvider
Parameters:
uri
- Influx host uridb
- db nameuserName
- user namepassword
- passwordnumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
13. JMX
groupId: io.micrometer
artifactId: micrometer-registry-jmx
Class: org.redisson.config.metrics.JmxMeterRegistryProvider
Parameters:
domain
- domain namesharedRegistryName
- name used to store instance inSharedMetricRegistries
14. Kairos
groupId: io.micrometer
artifactId: micrometer-registry-kairos
Class: org.redisson.config.metrics.KairosMeterRegistryProvider
Parameters:
uri
- Kairos host uriuserName
- user namepassword
- passwordnumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
15. NewRelic
groupId: io.micrometer
artifactId: micrometer-registry-new-relic
Class: org.redisson.config.metrics.NewRelicMeterRegistryProvider
Parameters:
uri
- NewRelic host uriapiKey
- api keyaccountId
- account idnumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
16. Prometheus
groupId: io.micrometer
artifactId: micrometer-registry-prometheus
Class: org.redisson.config.metrics.MeterRegistryWrapper
Parameters:
registry
- instance ofPrometheusMeterRegistry
object
17. SingnalFx
groupId: io.micrometer
artifactId: micrometer-registry-signalfx
Class: org.redisson.config.metrics.SingnalFxMeterRegistryProvider
Parameters:
apiHost
- SingnalFx host uriaccessToken
- access tokensource
- application instance idnumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 10 secs)batchSize
- number of measurements sent per request (default is 500)
18. Stackdriver
groupId: io.micrometer
artifactId: micrometer-registry-stackdriver
Class: org.redisson.config.metrics.StackdriverMeterRegistryProvider
Parameters:
projectId
- project idnumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
19. Statsd
groupId: io.micrometer
artifactId: micrometer-registry-statsd
Class: org.redisson.config.metrics.StatsdMeterRegistryProvider
Parameters:
host
- Statsd host addressport
- Statsd portflavor
- metrics format ETSY/DATADOG/TELEGRAF/SYSDIG
20. Wavefront
groupId: io.micrometer
artifactId: micrometer-registry-wavefront
Class: org.redisson.config.metrics.WavefrontMeterRegistryProvider
Parameters:
uri
- Wavefront host urisource
- application instance idapiToken
- api tokennumThreads
- number of threads used by scheduler (default is 2)step
- update interval in ISO-8601 format (default is 1 min)batchSize
- number of measurements sent per request (default is 500)
Config examples
JMX config
Config config = ... // Redisson PRO config object
JmxMeterRegistryProvider provider = new JmxMeterRegistryProvider();
provider.setDomain("appStats");
config.setMeterRegistryProvider(provider);
Prometheus config
Config config = ... // Redisson PRO config object
PrometheusMeterRegistry registry = ...
config.setMeterRegistryProvider(new MeterRegistryWrapper(registry));
Dynatrace config
Config config = ... // Redisson PRO config object
DynatraceMeterRegistryProvider p = new DynatraceMeterRegistryProvider();
p.setApiToken("Hg3M0iadsQC2Pcjk6QIW0g");
p.setUri("https://qtd9012301.live.dynatrace.com/");
p.setDeviceId("myHost");
config.setMeterRegistryProvider(p);
Influx config
Config config = ... // Redisson PRO config object
InfluxMeterRegistryProvider provider = new InfluxMeterRegistryProvider();
provider.setUri("http://localhost:8086/");
provider.setDb("myinfluxdb");
provider.setUserName("admin");
provider.setPassword("admin");
config.setMeterRegistryProvider(provider);
YAML config is appended to Redisson config:
JMX YAML config
meterRegistryProvider: !<org.redisson.config.metrics.JmxMeterRegistryProvider>
domain: "appStats"
Dynatrace YAML config
meterRegistryProvider: !<org.redisson.config.metrics.DynatraceMeterRegistryProvider>
apiToken: "Hg3M0iadsQC2Pcjk6QIW0g"
uri: "https://qtd9012301.live.dynatrace.com"
deviceId: "myHost"
Influx YAML config
meterRegistryProvider: !<org.redisson.config.metrics.InfluxMeterRegistryProvider>
uri: "http://localhost:8086/"
db: "myinfluxdb"
userName: "admin"
password: "admin"
The following metrics are available:
Configuration metrics
redisson.license.expiration-year
- A Gauge of the number of the license expiration yearredisson.license.expiration-month
- A Gauge of the number of the license expiration monthredisson.license.expiration-day
- A Gauge of the number of the license expiration dayredisson.license.active-instances
- A Gauge of the number of active Redisson PRO clientsredisson.executor-pool-size
- A Gauge of the number of executor threads pool sizeredisson.netty-pool-size
- A Gauge of the number of netty threads pool sizenetty.eventexecutor.tasks.pending
- Number of pending tasks in Netty event executor
Metrics per Redis node.
Base name: redisson.redis.<host>:<port>
status
- A Gauge of the number value of Redis node status [1 = connected, -1 = disconnected]type
- A Gauge of the number value of Redis node type [1 = MASTER, 2 = SLAVE, 3 = SENTINEL]total-response-bytes
- A Meter of the total amount of bytes received from Redisresponse-bytes
- A Histogram of the number of bytes received from Redistotal-request-bytes
- A Meter of the total amount of bytes sent to Redisrequest-bytes
- A Histogram of the number of bytes sent to Redisconnections.active
- A Counter of the number of busy connectionsconnections.free
- A Counter of the number of free connectionsconnections.max-pool-size
- A Counter of the number of maximum connection pool sizeconnections.reconnected
- A Counter of the number of reconnected connectionsconnections.total
- A Counter of the number of total connections in pooloperations.total
- A Meter of the number of total executed operationsoperations.total-failed
- A Meter of the number of total failed operationsoperations.total-successful
- A Meter of the number of total successful operationsoperations.latency
- A Histogram of the number of operations latency in millisecondsoperations.retry-attempt
- A Histogram of the number of operations retry attemptspublish-subscribe-connections.active
- A Counter of the number of active publish subscribe connectionspublish-subscribe-connections.free
- A Counter of the number of free publish subscribe connectionspublish-subscribe-connections.max-pool-size
- A Counter of the number of maximum publish subscribe connection pool sizepublish-subscribe-connections.total
- A Counter of the number of total publish subscribe connections in pool
Metrics per RRemoteService object
Base name: redisson.remote-service.<name>
invocations.total
- A Meter of the number of total executed invocationsinvocations.total-failed
- A Meter of the number of total failed to execute invocationsinvocations.total-successful
- A Meter of the number of total successful to execute invocations
Metrics per RExecutorService object
Base name: redisson.executor-service.<name>
tasks.submitted
- A Meter of the number of submitted taskstasks.executed
- A Meter of the number of executed tasksworkers.active
- A Gauge of the number of busy task workersworkers.free
- A Gauge of the number of free task workersworkers.total
- A Gauge of the number of total task workersworkers.tasks-executed.total
- A Meter of the number of total executed tasks by workersworkers.tasks-executed.total-failed
- A Meter of the number of total failed to execute tasks by workersworkers.tasks-executed.total-successful
- A Meter of the number of total successful to execute tasks by workers
Metrics per RMap object
Base name: redisson.map.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cache
Metrics per RMapCache object
Base name: redisson.map-cache.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cache
Metrics per RMapCacheV2 object
Base name: redisson.map-cache-v2.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cache
Metrics per RMapCacheNative object
Base name: redisson.map-cache-native.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cache
Metrics per RClusteredMapCache object
Base name: redisson.clustered-map-cache.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cache
Metrics per RClusteredMapCacheNative object
Base name: redisson.clustered-map-cache-native.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cache
Metrics per RLocalCachedMap object
Base name: redisson.local-cached-map.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cachelocal-cache.hits
- A Meter of the number of get requests for data contained in local cachelocal-cache.misses
- A Meter of the number of get requests for data contained in local cachelocal-cache.evictions
- A Meter of the number of evictions for data contained in local cachelocal-cache.size
- A Gauge of the number of local cache size
Metrics per RClusteredLocalCachedMap object
Base name: redisson.clustered-local-cached-map.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cachelocal-cache.hits
- A Meter of the number of get requests for data contained in local cachelocal-cache.misses
- A Meter of the number of get requests for data contained in local cachelocal-cache.evictions
- A Meter of the number of evictions for data contained in local cachelocal-cache.size
- A Gauge of the number of local cache size
Metrics per RLocalCachedMapCache object
Base name: redisson.local-cached-map-cache.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cachelocal-cache.hits
- A Meter of the number of get requests for data contained in local cachelocal-cache.misses
- A Meter of the number of get requests for data contained in local cachelocal-cache.evictions
- A Meter of the number of evictions for data contained in local cachelocal-cache.size
- A Gauge of the number of local cache size
Metrics per RLocalCachedMapCacheV2 object
Base name: redisson.local-cached-map-cache-v2.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cachelocal-cache.hits
- A Meter of the number of get requests for data contained in local cachelocal-cache.misses
- A Meter of the number of get requests for data contained in local cachelocal-cache.evictions
- A Meter of the number of evictions for data contained in local cachelocal-cache.size
- A Gauge of the number of local cache size
Metrics per RLocalCachedMapCacheNative object
Base name: redisson.local-cached-map-cache-native.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cachelocal-cache.hits
- A Meter of the number of get requests for data contained in local cachelocal-cache.misses
- A Meter of the number of get requests for data contained in local cachelocal-cache.evictions
- A Meter of the number of evictions for data contained in local cachelocal-cache.size
- A Gauge of the number of local cache size
Metrics per RClusteredLocalCachedMapCache object
Base name: redisson.clustered-local-cached-map-cache.<name>
hits
- A Meter of the number of get requests for data contained in cachemisses
- A Meter of the number of get requests for data not contained in cacheputs
- A Meter of the number of puts to the cacheremovals
- A Meter of the number of removals from the cachelocal-cache.hits
- A Meter of the number of get requests for data contained in local cachelocal-cache.misses
- A Meter of the number of get requests for data contained in local cachelocal-cache.evictions
- A Meter of the number of evictions for data contained in local cachelocal-cache.size
- A Gauge of the number of local cache size
Metrics per RTopic object
Base name: redisson.topic.<name>
messages-sent
- A Meter of the number of messages sent for topicmessages-received
- A Meter of the number of messages received for topic
Metrics per RBucket object
Base name: redisson.bucket.<name>
gets
- A Meter of the number of get operations executed for bucket objectsets
- A Meter of the number of set operations executed for bucket object
Metrics per JCache object
Base name: redisson.JCache.<name>
cache.evictions
- A Meter of the number of evictions for data contained in JCachecache.puts
- A Meter of the number of puts to the JCachehit.cache.gets
- A Meter of the number of get requests for data contained in JCachemiss.cache.gets
- A Meter of the number of get requests for data contained in JCache
16.2. Tracing
This feature is available only in Redisson PRO
Redisson provides integration with the most popular tracer libraries through Micrometer Observation API and Micrometer Tracing framework. This feature allows to gather extra statistics about invoked Redisson methods: name, arguments, invocation path, duration and frequency.
Configuration metrics per Tracing event.
invocation
- Redisson method with arguments. Arguments are included only ifincludeArgs
settrue
object_name
- Redisson object nameaddress
- Redis server addressusername
- username used to connect to Redis server
1. OpenZipkin Brave
Configuration example:
OkHttpSender sender = OkHttpSender.create("http://localhost:9411/api/v2/spans");
AsyncZipkinSpanHandler zipkinSpanHandler = AsyncZipkinSpanHandler.create(sender);
StrictCurrentTraceContext braveCurrentTraceContext = StrictCurrentTraceContext.create();
Tracing tracing = Tracing.newBuilder()
.localServiceName("myservice")
.currentTraceContext(braveCurrentTraceContext)
.sampler(Sampler.ALWAYS_SAMPLE)
.addSpanHandler(zipkinSpanHandler)
.build();
config.setTracingProvider(new BraveTracingProvider(tracing));
Required dependencies:
groupId: io.zipkin.reporter2
, artifactId: zipkin-sender-okhttp3
groupId: io.zipkin.reporter2
, artifactId: zipkin-reporter-brave
2. OpenTelemetry
Configuration example:
SpanExporter spanExporter = new ZipkinSpanExporterBuilder()
.setSender(URLConnectionSender.create("http://localhost:9411/api/v2/spans"))
.build();
SdkTracerProvider sdkTracerProvider = SdkTracerProvider.builder()
.addSpanProcessor(BatchSpanProcessor.builder(spanExporter).build())
.build();
OpenTelemetrySdk openTelemetrySdk = OpenTelemetrySdk.builder()
.setPropagators(ContextPropagators.create(B3Propagator.injectingSingleHeader()))
.setTracerProvider(sdkTracerProvider)
.build();
io.opentelemetry.api.trace.Tracer otelTracer = openTelemetrySdk.getTracerProvider().get("io.micrometer.micrometer-tracing");
config.setTracingProvider(new OtelTracingProvider(otelTracer, openTelemetrySdk.getPropagators()));
Required dependencies:
groupId: io.opentelemetry
, artifactId: opentelemetry-exporter-zipkin
groupId: io.zipkin.reporter2
, artifactId: zipkin-sender-urlconnection
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论