Skip to content

io microsphere metrics prometheus client sentinel SentinelCollector

github-actions[bot] edited this page Jul 17, 2026 · 2 revisions

SentinelCollector

Type: Class | Module: microsphere-observability-prometheus-metrics | Package: io.microsphere.metrics.prometheus.client.sentinel | Since: 1.0.0

Source: microsphere-observability-prometheus-metrics/src/main/java/io/microsphere/metrics/prometheus/client/sentinel/SentinelCollector.java

Overview

Prometheus Collector based on Sentinel Metrics

Declaration

public class SentinelCollector extends Collector implements ProcessorSlotEntryCallback<DefaultNode>

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.0-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-observability-prometheus-metrics</artifactId>
    <version>${microsphere-observability.version}</version>
</dependency>

Tip: Use the BOM (microsphere-observability-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.metrics.prometheus.client.sentinel.SentinelCollector;

API Reference

Public Methods

Method Description
commonLabel The interval time of metrics collection in milliseconds.
collect

Method Details

commonLabel

public SentinelCollector commonLabel(String labelName, String labelValue)

The interval time of metrics collection in milliseconds. / private final long interval;

private final List commonLabelNames;

private final List commonLabelValues;

private final ConcurrentMap resourceToContextMapping = newConcurrentHashMap(256);

private volatile MetricSearcher metricSearcher;

public SentinelCollector(long interval) { this(interval, emptyMap()); }

public SentinelCollector(long interval, Map commonLabels) { this.interval = interval; this.commonLabelNames = initCommonLabelNames(commonLabels); this.commonLabelValues = initCommonLabelValues(commonLabels); }

See Also

  • Collector
  • ClusterBuilderSlot
  • ClusterNode
  • MetricTimerListener
  • io.microsphere.metrics.micrometer.instrument.binder.sentinel.SentinelMetrics

This documentation was auto-generated from the source code of microsphere-observability.

Clone this wiki locally