Genesys Cloud - Main

 View Only
Discussion Thread View
  • 1.  Angular Issue: oWaiting metric not showing properly

    Posted 01-19-2022 14:29
    Hello,

    I was hoping someone can help. I'm working on a project where we use Angular app to monitor queues and if one "breaks" we alert the team so we can fix it. I've modelled our app using the sample app here: https://developer.genesys.cloud/blueprints/angular-app-with-genesys-cloud-sdk/, but I encountered some metrics not working.

    This is what it looks like when I have oWaiting metric enabled (seems like if number in oWaiting is greater than zero, it breaks and stays loading):


    And this is what it looks like when oWaiting is disabled and other metrics are used:


    This is what I have for `genesys-cloud.service.ts`:
     getQueueObservations(queueId: string): Observable<platformClient.Models.QueueObservationDataContainer>{
        return from(this.analyticsApi.postAnalyticsQueuesObservationsQuery({
          filter: {
            type: 'or',
            predicates: [
             {
              type: 'dimension',
              dimension: 'queueId',
              operator: 'matches',
              value: queueId
             }
            ]
           },
           metrics: [ 'oOnQueueUsers', 'oActiveUsers', 'oOffQueueUsers' ]
        }))
        .pipe(
          map(data => {
            const result = data.results?.find(r => r.group?.queueId === queueId); 
            if(!result) throw new Error(`No results queried for ${queueId}`);
            console.log(result)
    
            return result;
          })
        );
      }​

    This is what I have for `queue-details.component.ts`:
     getQueueObservations(){
        if(!this.queue) throw Error('Invalid queue.');
        this.fetching = true;
    
        this.genesysCloudService.getQueueObservations(this.queue.id!)
          .subscribe(result => {
            if(!result.data) throw new Error('Error in getting observations.')
    
            this.onQueueAgents = result.data
                    .filter(d => d.metric === 'oOnQueueUsers')
                    .reduce((acc, d) => acc + d.stats!.count!, 0)
            this.totalAgents = result.data
                    .find(d => d.metric === 'oActiveUsers')!.stats!.count || 0;
            this.offQueueAgents = result.data
                    .filter(d => d.qualifier === 'ccf3c10a-aa2c-4845-8e8d-f59fa48c58e5')
                    .reduce((acc, d) => acc + d.stats!.count!, 0)
            this.waiting = result.data
                    .filter(d => d.metric === 'oWaiting')
                    .reduce((acc, d) => acc + d.stats!.count!, 0)
    
            this.fetching = false;
          });
      }​

    Is it because oWaiting is in a different group than the rest of the metrics I'm using? How can I fix this?

    Thank you! Have a great day.
    #Unsure/Other


  • 2.  RE: Angular Issue: oWaiting metric not showing properly

    Top 25 Contributor
    Posted 01-19-2022 15:11
    Hi Dianne

    You might have more luck posting this question in the Developer Forum
    https://developer.genesys.cloud/forum/

    ------------------------------
    Anton Vroon
    ------------------------------



  • 3.  RE: Angular Issue: oWaiting metric not showing properly

    Posted 01-19-2022 16:59
    Hello Anton,

    Thank you. I already posted there before I posted here and no luck still unfortunately. Is there a way to contact a Genesys Developer?

    Thank you


  • 4.  RE: Angular Issue: oWaiting metric not showing properly

    Top 25 Contributor
    Posted 01-19-2022 17:26
    I've found the Developer forum usually the pretty reasonable for getting hold of a developer.
    Keeping in mind they might be on different time zones, I usually get a response within a day or two.

    I haven't needed to contact a Developer outside of the forum, so not sure what your other options are besides logging a support case.

    ------------------------------
    Anton Vroon
    ------------------------------



  • 5.  RE: Angular Issue: oWaiting metric not showing properly

    Posted 01-20-2022 08:12
    That makes sense. Thank you so much! Have a great day.


Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources