All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.prometheus.metrics.model.snapshots.DuplicateLabelsException Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package io.prometheus.metrics.model.snapshots;

/**
 * Thrown when a collector tries to create a {@link MetricSnapshot}
 * where multiple data points have the same labels (same label names and label values).
 */
public class DuplicateLabelsException extends IllegalArgumentException {

    private final MetricMetadata metadata;
    private final Labels labels;

    public DuplicateLabelsException(MetricMetadata metadata, Labels labels) {
        super("Duplicate labels for metric \"" + metadata.getName() + "\": " + labels);
        this.metadata = metadata;
        this.labels = labels;
    }

    public MetricMetadata getMetadata() {
        return metadata;
    }

    public Labels getLabels() {
        return labels;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy