Cumulative Spending Monitor avatar

Cumulative Spending Monitor

Under maintenance

Pricing

Pay per usage

Go to Apify Store
Cumulative Spending Monitor

Cumulative Spending Monitor

Under maintenance

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Tri⟁angle

Tri⟁angle

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

a day ago

Last modified

Categories

Share

Monitor your Apify spending in real-time and get instant notifications when your usage exceeds predefined thresholds.

What Does This Actor Do?

This Actor helps you keep your Apify costs under control by monitoring spending across your Actors and alerting you when you exceed budget limits. Whether you're running a single critical Actor or managing multiple automations, this tool ensures you're always aware of your spending patterns.

Key Features

  • 🔍 Real-time Monitoring: Track cumulative spending across all your Actors or specific ones you choose
  • Flexible Time Periods: Monitor billing cycles or custom 24-hour periods starting at any time
  • 💰 Custom Thresholds: Set spending limits in USD for each monitoring period
  • 📧 Multi-Channel Notifications: Get alerts via Slack, email, or both when thresholds are exceeded
  • 🔕 Smart Alert System: Prevents notification spam by remembering when alerts were already sent

Required Permissions

🔑 This Actor requires full account permissions to function properly.

To monitor your spending, the Actor needs to access information about Actor runs in your account. This includes reading run details, usage statistics, and billing information through the Apify API.

Why full permissions?

  • The Actor queries all runs (or runs for specific Actors) that started within your monitoring periods
  • It retrieves usage data and costs associated with each run
  • It accesses your billing cycle information when monitoring billing periods

Your data is safe: The Actor only reads data to calculate spending—it doesn't modify any of your Actors, runs, or account settings. All operations are read-only except for storing notification timestamps in its own key-value store.

How It Works

  1. Configure Your Periods: Define when you want to monitor spending (e.g., your billing cycle, or daily periods starting at 9 AM)
  2. Set Spending Limits: Specify how much you're willing to spend in USD for each period
  3. Choose Your Actors: Monitor all Actors or select specific ones you want to track
  4. Get Notified: Receive alerts via Slack or email when spending exceeds your thresholds

The Actor fetches data from the Apify API, calculates cumulative spending for each period, and compares it against your thresholds. When a limit is reached, you'll be notified immediately so you can take action.

Configuration

Time Periods

You can monitor spending across multiple time periods simultaneously:

  • Billing Cycle: Use "billing" to monitor your monthly Apify billing period
  • Custom 24-Hour Periods: Use time in 24-hour format (e.g., "09:00", "18:30") to monitor rolling 24-hour windows. Times are interpreted in UTC.

Each period needs:

  • A label to identify it (e.g., "Daily 9-9", "Billing Cycle")
  • A period definition ("billing" or time like "09:00")
  • An optional spending threshold in USD

Actor Selection

  • Leave the "Actors" field empty to monitor all Actors in your account
  • Or specify Actor IDs or username/name combinations to monitor only specific Actors

Notifications

Slack Notifications:

  • Enable Slack notifications in the configuration
  • Provide your Slack bot token (keep it secret!)
  • Specify one or more channels where alerts should be posted

Email Notifications:

  • Enable email notifications in the configuration
  • Provide comma-separated lists of email addresses
  • Each list is treated as a separate group (recipients in the same group will see each other)
  • You'll receive a formatted table showing periods that exceeded thresholds

Preventing Repeated Notifications

To avoid getting the same alert multiple times, provide an Instance Name. This name helps the Actor remember which thresholds have already triggered notifications.

How it works:

  • The Actor stores notification records in a named key-value store using your instance name
  • Each record is tied to a specific period (identified by its label and exact start/end times)
  • When a threshold is exceeded, the Actor checks if a notification was already sent for that period
  • If yes, it skips sending another notification
  • If no, it sends the notification and records the timestamp

Example: If you set up daily monitoring from 9 AM to 9 AM and the Actor runs every hour, you'll only get one notification per day when the threshold is first exceeded—not 24 notifications!

Important: The same period (same label and time range) won't trigger duplicate notifications. If you change the period times or create a new period, it will be treated as a new monitoring window and can send notifications again.

Instance Name Best Practices

Choose a unique, descriptive instance name:

  • Use names like "production-monitor" or "dev-spending-tracker"
  • Don't change the instance name unless you want to reset notification history
  • Different Actors with different purposes should use different instance names

Output

The Actor saves detailed spending reports to its dataset, including:

  • Period label, start time, and end time
  • Total spending in USD for the period
  • Number of runs analyzed
  • Spending breakdown by Actor
  • Whether the threshold was exceeded and when
  • Timestamp of the last notification sent (if any)

Limitations

⚠️ Important: This Actor only considers runs that started within the monitored period.

Why? The Apify API filters runs by their start time (startedAfter parameter) and doesn't provide more granular filtering options.

What this means:

  • A run that started before your monitoring period but finished during it will not be counted
  • A run that started during your monitoring period will be counted, even if it finishes after the period ends

Example: If you're monitoring spending from 9 AM to 9 AM the next day, and a long-running Actor started at 8 AM and finished at 10 AM, its costs won't be included in your 9-to-9 period report.

Use Cases

  • Budget Control: Ensure you never exceed your monthly cloud budget
  • Cost Optimization: Identify which Actors consume the most resources
  • Development Safety: Set low thresholds for test environments to catch runaway processes
  • Client Billing: Monitor per-client Actor spending for accurate invoicing
  • Team Alerts: Keep your whole team informed when automation costs spike

Tips

  • Start with conservative thresholds and adjust based on your typical usage patterns
  • Monitor both your billing cycle and shorter daily periods for comprehensive coverage
  • Use multiple notification channels to ensure critical alerts aren't missed
  • Set up the Actor to run frequently (e.g., every hour) for near real-time monitoring
  • Review the dataset output regularly to understand your spending trends

Need Help?

If you have questions or need assistance setting up monitoring for your specific use case, reach out to Apify support or check the Apify documentation.


Stay in control of your automation costs with Cumulative Spending Monitor! 🚀