Rtds monitoring
Skill urbanairship/agent-tools/skills/workflows/rtds-monitoring
Connect to Real-Time Data Streaming API to monitor events, process them, and handle reconnection using offset tracking. Enables real-time monitoring of push delivery, custom events, and user interactions. Use when building real-time integrations, monitoring systems, or event-driven applications.From its SKILL.md
npx -y skills add urbanairship/agent-tools --skill rtds-monitoringAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.7 KB, as published. Nobody here has run it
RTDS Monitoring Workflow
This workflow connects to RTDS, processes events, and handles reconnection.
Prerequisites
- RTDS must be enabled for your Airship account
- RTDS access token configured in dashboard
- Application ready to process events
- App key
Skills Required
Step 1: Connect to RTDS Stream
Connect with filters for specific event types:
POST https://connect.urbanairship.com/api/events
Authorization: Bearer <rtds-access-token>
X-UA-Appkey: <app-key>
Accept: application/vnd.urbanairship+x-ndjson; version=3;
Content-Type: application/json
{
"start": "LATEST",
"filters": [
{
"types": ["OPEN", "SEND", "CLICK", "CUSTOM"]
}
]
}
Response: Stream of NDJSON events:
{"id":"event-1","type":"OPEN","offset":"offset-1",...}
{"id":"event-2","type":"SEND","offset":"offset-2",...}
{"id":"event-3","type":"CLICK","offset":"offset-3",...}
Step 2: Process Events
For each event in the stream:
- Parse the JSON event
- Extract the
offsetfield - Process the event (store in database, trigger actions, etc.)
- Store the
offsetas the last processed offset
Step 3: Handle Disconnection
If the connection drops:
- Use the last stored
offset - Reconnect with
resume_offset:
POST https://connect.urbanairship.com/api/events
Authorization: Bearer <rtds-access-token>
X-UA-Appkey: <app-key>
Accept: application/vnd.urbanairship+x-ndjson; version=3;
Content-Type: application/json
{
"resume_offset": "offset-3",
"filters": [
{
"types": ["OPEN", "SEND", "CLICK", "CUSTOM"]
}
]
}
This ensures no events are missed between disconnection and reconnection.
Outcomes
- Real-time event stream connection
- Processed events stored/analyzed
- Seamless reconnection capability
Use Cases
- Real-time push delivery monitoring
- Custom event tracking
- Compliance monitoring
- User behavior analysis
- Integration with external systems
Best Practices
- Store offsets: Always track the last processed offset for seamless reconnection
- Use appropriate filters: Filter RTDS events at the API level to reduce processing overhead
- Handle errors gracefully: Implement retry logic and error handling for network issues
- Process events efficiently: Parse and process events as they arrive to avoid backlog