[ 
https://issues.apache.org/jira/browse/METRON-1337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16269568#comment-16269568
 ] 

ASF GitHub Bot commented on METRON-1337:
----------------------------------------

GitHub user merrimanr opened a pull request:

    https://github.com/apache/metron/pull/853

    METRON-1337: List of facets should not be hardcoded

    ## Contributor Comments
    This PR makes the list of facet fields in the Alerts UI configurable.  
There is now a "search.facet.fields" setting in 
https://github.com/apache/metron/blob/master/metron-interface/metron-rest/src/main/resources/application.yml
 that is a comma-separate list of fields to be used as facets.  Originally a 
comment was made that the "host" field wasn't commonly used so I removed that 
from the default list.
    
    I can think of two options for exposing this configuration: 
    - through an AlertProfile that is specific to each user, stored in a 
relational database and can be edited through REST
    - a setting that is exposed in Ambari
    
    I chose to include the first option in this PR to get the conversation 
going.  Is one of these preferable?  The AlertProfile approach allows this 
setting to be changed at runtime and each user has their own list of facet 
fields.  But it is not versioned like it would if it were in Ambari.  Do we 
prefer one over the other?  Do we want both with Ambari being the default when 
an AlertProfile doesn't exist for a user?  Are there other options I'm not 
thinking of?
    
    This works similar to how default search indices work:  it is managed in 
the REST layer and can be overriden by including facet fields in a search 
request.  However it seemed useful to allow a way to explicitly NOT include 
facets in a query so it works slightly different than indices.  A missing 
facetFields property in the request will use the defaults while an empty array 
will disable facets.  A missing indices property or an empty array will use the 
default indices.  Is this the correct behavior?  
    
    This has been tested in full dev and the UI e2e tests pass when run in 
isolation.  There is currently an effort to stabilize the e2e tests as a follow 
on to https://github.com/apache/metron/pull/803 so I did not try to solve that 
here.  
    
    I will add some documentation around configuring the facet field list and 
facetFields behavior in a search request once we come to a consensus on the 
solution.
    
    Another issue I would like to point out.  When I added facetFields to the 
AlertProfile object it required a database update because that new field needed 
to be added to the database.  This would become an issue if someone were 
upgrading from a previous version.  Is this acceptable if we document it for 
future upgrades?  Is a relational database the right solution or should we 
consider a more flexible storage option?
    
    ## Pull Request Checklist
    
    Thank you for submitting a contribution to Apache Metron.  
    Please refer to our [Development 
Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235)
 for the complete guide to follow for contributions.  
    Please refer also to our [Build Verification 
Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview)
 for complete smoke testing guides.  
    
    
    In order to streamline the review of the contribution we ask you follow 
these guidelines and ask you to double check the following:
    
    ### For all changes:
    - [x] Is there a JIRA ticket associated with this PR? If not one needs to 
be created at [Metron 
Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
 
    - [x] Does your PR title start with METRON-XXXX where XXXX is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
character.
    - [x] Has your PR been rebased against the latest commit within the target 
branch (typically master)?
    
    
    ### For code changes:
    - [x] Have you included steps to reproduce the behavior or problem that is 
being changed or addressed?
    - [x] Have you included steps or a guide to how the change may be verified 
and tested manually?
    - [x] Have you ensured that the full suite of tests and checks have been 
executed in the root metron folder via:
      ```
      mvn -q clean integration-test install && build_utils/verify_licenses.sh 
      ```
    
    - [x] Have you written or updated unit tests and or integration tests to 
verify your changes?
    - [x] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [x] Have you verified the basic functionality of the build by building 
and running locally with Vagrant full-dev environment or the equivalent?
    
    ### For documentation related changes:
    - [x] Have you ensured that format looks appropriate for the output in 
which it is rendered by building and verifying the site-book? If not then run 
the following commands and the verify changes via 
`site-book/target/site/index.html`:
    
      ```
      cd site-book
      mvn site
      ```
    
    #### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.
    It is also recommended that [travis-ci](https://travis-ci.org) is set up 
for your personal repository such that your branches are built there before 
submitting a pull request.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/merrimanr/incubator-metron configurable-facets

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/metron/pull/853.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #853
    
----
commit 8612bc286cd153e1358e405d78516d4bc004201b
Author: merrimanr <merrim...@gmail.com>
Date:   2017-11-28T16:51:09Z

    initial commit

commit 0084af4e29e825d589231cae208f199a75a6c308
Author: merrimanr <merrim...@gmail.com>
Date:   2017-11-28T16:51:28Z

    Merge remote-tracking branch 'mirror/master' into configurable-facets

commit e6fb5ed879cc690d34482224e4fd353d82ecfdc1
Author: merrimanr <merrim...@gmail.com>
Date:   2017-11-28T21:35:28Z

    updated e2e tests

----


> List of facets should not be hardcoded
> --------------------------------------
>
>                 Key: METRON-1337
>                 URL: https://issues.apache.org/jira/browse/METRON-1337
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Ryan Merriman
>            Assignee: Ryan Merriman
>
> Currently the facet fields shown in the left panel of the Alerts UI is hard 
> coded in a javascript file.  This should be configurable.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to