|
Monitoring and Notifications
What
is a monitor?
A monitor defines conditions
to be periodically checked by AP Media API along with one or more email
addresses to which an alert
notification will be sent if the check fails. A monitor is correlated
with a specific session.
What
is a session?
If you
are programmatically integrating with AP Media API, you will
have a session created for you when you make an initial feed request.
All links returned in that first response are considered to belong
to the same session. To maintain that session, you must
use the returned "next_page" link
to get the next set of content.
If
you are using AP Media Agent, you do not
need to manage sessions because each agent uses a single session that
covers its main feed and content ingestion activities. The Agent
Details page on the configuration dashboard in AP Newsroom allows
you to assign and manage an agent monitor.
What is
an alert?
An alert is automatically generated by AP Media API when a session with
a monitor fails one of its configured checks. An alert in turn generates
a notification email.
How does it work?
Whether you are using AP Media Agent or programmatically integrating
with AP Media API using your own client application, you can configure
monitors to
check for certain conditions in your Media API activity (for example,
content ingestion interruptions or a significant number of ingestion errors)
and get email alerts
if the configured checks fail.
Important |
|
If your client application
does not follow "next_page" links, it cannot use monitors
because there is no single meaningful session to correlate activity. |
|
|
|
Where can I manage monitors, sessions and alerts?
The Notifications
section on the configuration dashboard in AP Newsroom contains the following
tabs:
Monitors.
Create
a monitor to check for certain conditions in your Media API activity.
You can then assign
the monitor to an agent or your initial
feed request (if you are programmatically integrating with the
API) and be alerted when those conditions occur.
Alerts.
Alerts are sent to the email addresses that you have configured. This
tab lists all recently sent alerts for your organization:
Sessions.
If you are programmatically integrating with the API, view and manage
sessions in your Media API activity, including current and recent
sessions to which you have a monitor attached. The Sessions
tab lists monitored sessions and allows you to enable or disable monitoring
of a session.
Which
conditions can be monitored?
Currently, the supported conditions are:
Idle
Feed. Your agent or feed ingest application session stops issuing
feed calls to Media API for a certain length of time.
Quality.
A significant number of errors associated with your feed session activity
is detected within a recent five minute period.
How
do I create a monitor?
Sign in to AP Newsroom and
go to the configuration dashboard. See
the steps >>
Click Notifications
at top to display the Monitors
tab.
Click Create
Monitor at right to open the Create
Monitor window:
Fill out the following fields:
Name.
The monitor name. No spaces are allowed; for example: "SampleAgent".
Description
(optional). A brief description of the monitor; for example, "Check
feeds."
Troubleshooting
steps (optional). Any additional information; for example:
"Check if the agent is running and restart if necessary. Call
Tim if alerts persist."
Notify
By: Email. One or more email addresses for alert notifications.
Multiple email addresses must be separated by semi-colons; no
spaces are allowed; for example: "user1@example.org;user2@example.org".
Notify
on conditions: Choose the conditions for which you want
to receive an alert notification:
Idle
Feed. Select the slider if you want to get notified
when your agent or feed ingest application session stops issuing
feed calls to Media API for a certain length of time, and
then select the period from the Idle
Time menu.
Quality. Select
the slider if you want to get notified when a significant
number of errors associated with your feed session activity
is detected within a recent five minute period.
Repeat
Alerts. Select an option from the menu to have the
alert periodically sent to you if the condition persists.
Click OK.
The monitor now appears on the Monitors
tab in the Notifications section:
How can I assign
a monitor to an agent?
Important |
|
If you are running older
versions of the agent, we strongly urge you to automatically upgrade to the latest
version. |
|
|
|
On the configuration
dashboard in AP Newsroom, create
a monitor or note the name of an existing monitor you want to
use on the Monitors tab in
the Notifications section.
Click Agent
Configuration at top to display the configuration dashboard,
and then click the name of the agent you want to monitor to go to
the Agent Details page.
Select a monitor from
the Assigned Monitor menu,
and click the Enable Monitor
slider to enable it:
Click Save
Agent.
Tip |
|
Manually stopping the
agent may result in triggering an idleFeed
alert if configured. To avoid this, first disable/suspend the
monitoring using the Enable Monitor
slider, but make sure to enable monitoring again once you restart
the agent. |
|
|
|
How do I configure monitoring
if I am making API calls?
Important Prerequisite |
|
Your application must
follow best practices by making an initial feed call before entering
a loop that has a final per-iteration step of calling the API
next request link returned in the "next_page"
field of the response payload just processed. |
|
|
|
On
the configuration dashboard in AP Newsroom, create
a monitor or note the name of an existing monitor you want to
use on the Monitors tab in
the Notifications section.
To assign a monitor to a session, on
your client application's initial feed request, do the following:
Register the monitor
by adding the with_monitor={monitorName} parameter
to the feed request URL.
(Optional) Label the
monitored session by adding the session_label={yourLabel}
parameter to your request.
For example (make sure
to supply the API key in the x-api-key request
header):
https://api.ap.org/media/v/content/feed?include=*&with_monitor=SampleMonitor&session_label=main_session_001
Your session will automatically
become monitored within one or two cycles of your main feed loop.
The JSON response for the
monitored feed sessions now includes a "monitor"
object that describes the assigned monitoring; for example:
Tip |
|
To avoid an idleFeed
alert when gracefully shutting down your application, you can
explicitly disable the monitoring for that specific session. To
do so programmatically, use the "disable_session_monitor"
link provided in the "monitor"
object of the latest feed response. An "enable_session_monitor"
link is also provided to programmatically resume monitoring. Alternatively,
you can enable and disable
monitors from the configuration dashboard in AP Newsroom. |
|
|
|
How can I edit monitor settings?
On the Monitors
tab in the Notifications section,
do ONE of the following for the monitor you want to edit:
(Optional) In the View/Edit
Monitor window, modify the settings as needed.
(Optional) Click Test Monitor to send a test alert
to the specified email addresses.
Click OK
to save the settings.
How can I delete a monitor?
On the Monitors
tab in the Notifications section,
click Option for the monitor
you want to delete:
Click Delete,
and then click Yes to confirm.
How can I enable/disable session
monitoring from the configuration dashboard?
If you are programmatically integrating with the API, you can enable
and disable monitoring for a particular session from the configuration
dashboard in AP Newsroom.
On the configuration
dashboard in AP Newsroom, point to Notifications
at top and click Sessions.
On the Sessions
tab, click the slider in the Monitor
column for the session for which you want to manage monitoring: when
the slider is selected, the session monitoring is enabled; when the
selection is cleared, the session monitoring is disabled:
|
|