This page has instructions for setting up log and metric collection for the Sumo Logic App for Jenkins.
- Configure a Hosted Collector, or select an existing hosted collector to use.
- Add an HTTP Source to the hosted collector you created or selected. Note the HTTP source URL. It will look something like:
- In the Jenkins console, go to Manage Jenkins > Manage Plugins.
- Click the Available tab.
- Search for "Sumologic Publisher".
- Click "Sumologic Publisher".
- Click Download now and install after restart. You may need to restart Jenkins for the plugin to show up.
- Go to Manage Jenkins > Configure System.
- Search for the "Sumologic Jenkins plugin" field.
- Enter the HTTP Source URL from step 2.
- Click Apply.
- Click Save.
- For each Freestyle project that you want to monitor, add a Post Build Action. (Configure > Post Build Actions > Sumologic Build Logger) so that logs can be sent to Sumo Logic Hosted Collector after completion of build.
Build Failure - Outlier (log query)
| json field=_raw "name" as name
| json field=_raw "result" as result
| where result="FAILURE"
| json field=_raw "number" as number
| json field=_raw "duration" as duration_ms
| json field=_raw "start_time" as start_time
| formatDate(fromMillis(start_time), "MM-dd-yyyy HH:mm:ss") as date_time
| timeslice 1h
| count by _timeslice
| outlier _count direction=+
| where _count_violation =1
MaxWaitingTime (metric query)
| json field=_raw "queue.NumItemsInQueue" as NumItemsInQueue
| json field=_raw "queue.NumBlockedItemsInQueue" as NumBlockedItemsInQueue
| json field=_raw "queue.MaxWaitingTime" as MaxWaitingTime
| json field=_raw "queue.AverageWaitingTime" as AverageWaitingTime
| json field=_raw "slaves.numberOfSlaves" as numberOfSlaves
| json field=_raw "slaves.numberOfExecutors" as numberOfExecutors
| json field=_raw "slaves.numberOfFreeExecutors" as numberOfFreeExecutors
| withtime MaxWaitingTime
| most_recent(MaxWaitingTime_withtime) as current_max_waiting_time