@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Metric metric = (Metric) o;

        return name.equals(metric.name);

    }
Two metrics are considered equal if they have the same name.
metrics/src/main/java/ai/vespa/metrics/set/Metric.java