import { Observable } from 'rxjs' ; import { filter , distinctUntilChanged } from 'rxjs/operators' ; import { Reporter } from '@osd/analytics' ; /**
 * List of appIds not to report usage from (due to legacy hacks)
 */ const DO_NOT_REPORT = [ 'opensearchDashboards' ] ; export function reportApplicationUsage ( currentAppId$ , reporter ) { currentAppId$ . pipe ( filter ( ( appId ) => typeof appId === 'string' && ! DO_NOT_REPORT . includes ( appId ) ) , distinctUntilChanged ( ) ) . subscribe ( ( appId ) => appId && reporter . reportApplicationUsage ( appId ) ) ; }