Why this matters
Logging and monitoring on Oracle Cloud are metered by data volume. Every VCN flow log, load balancer access log, Object Storage access log, agent log, custom log, APM trace and Logging Analytics ingest adds to the bill. It is easy to switch on a log for one incident and forget it.
Costs grow because defaults favor more data. A team enables logs for a troubleshooting window and leaves them on. Retention set once stays forever. Dev and test compartments get the same coverage as production. One noisy debug line can fill a log group fast.
Control starts with treating telemetry as a pipeline. Give each log an owner, a purpose and a retention period. Use compartments and tags to make cost visible by team. The aim is not less monitoring. It is monitoring that someone reads.
Before you start
You need read access to Logging, Monitoring, Logging Analytics, APM, Object Storage, Service Connector Hub, Budgets and Cost Analysis. Ask for a read-only policy on those services and on the compartments you will review. Do not begin by deleting logs.
Build a list per compartment. Include Audit, VCN flow logs, service logs for Load Balancer, API Gateway, Object Storage, Functions, OKE and databases, plus agent logs, custom logs, APM domains and Logging Analytics log sets. For each entry note the owner, the question it answers, its retention and its destination. Mark anything nobody has queried in the last quarter.
Use Cost Analysis to see which services and compartments drive logging and monitoring usage. Look at usage in GB as well as cost, because a price change is not the same as a volume change. Agree on tags such as CostCenter, Owner and DataClass. Set a naming rule for log groups and buckets, for example team-app-env-log. Agree on three tiers: security, operations and debug. Write the retention for each tier before you touch a setting.
How to do it
Start at the source. You cannot save money by compressing a log you should not collect. Turn off optional logs in dev and test. Filter health checks and debug lines before they leave the host. Then set retention per log group. Routing comes last, because a clean source makes every later step cheaper.
Use log groups as cost boundaries. Create one group per application and environment, not one giant group for the tenancy. Set retention on the group. A narrow group with a short retention is easier to budget, query and delete than a shared pool.
Service Connector Hub is where you enforce routing. Send selected log groups to Object Storage when long-term search is rare. Send only the groups that need correlation to Logging Analytics. Avoid two connectors reading the same source for the same purpose. Check connector runs for errors; a broken connector can hide a gap until an incident.
Add budgets and a monthly review. New services arrive with logs switched on. Cost Analysis grouped by service and tag shows what changed. Retire log groups nobody queries. The steps below put this into order.
- Inventory every log source and assign an owner. List Audit, VCN flow logs, service logs, agent logs, custom logs, APM domains and Logging Analytics log sets by compartment. For each, write the owner and the decision it supports. Mark logs with no reader as candidates to disable.
- Cut optional logs in nonproduction. Disable VCN flow logs, load balancer access logs and verbose application logs in dev and test unless a test needs them. Keep Audit on. Use separate compartments so a production setting does not get copied by habit.
- Filter noisy events before ingestion. Drop health checks, readiness probes, debug lines and repeated errors at the agent or in a Service Connector Hub filtering task. Test the filter on a copy of the log first. A filter that hides a real error is worse than a larger bill.
- Set retention per log group. Set short retention for debug groups, medium retention for operational groups and longer retention for security groups. Check the retention on every group, including groups created by infrastructure as code. Do not rely on the default.
- Route with Service Connector Hub to one destination. Create one connector per source and purpose. Send archive copies to Object Storage and search copies to Logging Analytics only when needed. Review connector tasks and remove duplicate pipelines that read the same log group.
- Constrain Logging Analytics and APM ingestion. Use Logging Analytics log sets and source filters to exclude noisy sources. Ingest only fields you query. In APM, sample traces and set domain retention to the period your team uses. Review custom metrics and drop ones with no alarm.
- Archive to Object Storage with lifecycle rules. Write logs to a bucket with a prefix per compartment and date. Add lifecycle rules to move older objects to Infrequent Access and then Archive. Test a restore before you depend on it, and note the retrieval time in your runbook.
- Tag, budget, and review monthly. Apply defined tags to log groups, buckets, APM domains and connectors. Create budgets by compartment and cost-tracking tag with alerts at levels you choose. Review Cost Analysis monthly with the owners and retire unused groups.
How to check it worked
Check the trend in Cost Analysis for Logging, Monitoring, Logging Analytics, APM and Object Storage. Group by compartment and tag, then compare two billing periods. Billing lags usage, so confirm the change in the usage view before you credit the cleanup.
Open each log group and confirm its retention. Run a query for a debug message you excluded and confirm it returns nothing. Check Service Connector Hub runs for errors and confirm each connector has one clear destination. Confirm Object Storage lifecycle rules moved old objects, then restore one test object.
Check that operations still work. Search for an audit event from last month and confirm it is there. Review alarms and confirm the on-call engineer can still trace a failed request. If a team lost a log it needs, change that group's tier. Do not undo the whole pipeline.
Confirm budget alerts are tied to the right compartment and tag. Ask each owner to show the query or dashboard they use. A log group with no reader is a candidate for removal at the next review.
Mistakes to avoid
Do not turn off Audit or security logs to hit a target. Those logs are hard to replace and often the reason you have a logging service. Remove debug lines, duplicate service logs and unused custom logs first. Also watch for infrastructure as code that re-enables a log after a cleanup.
Do not use Logging Analytics as a data lake. It is built for search and correlation, and every GB you ingest there carries a cost. Object Storage is the place for long-term copies. Sending raw VCN flow logs to analytics is a common way to pay for data nobody queries.
Do not set one retention for everything. It either keeps debug too long or deletes security data too early. Use the tiers you agreed on. Test archive restore before an audit or incident, and put the retrieval time in the runbook.
Do not leave log groups without an owner or tags. They survive every cleanup and hide in a shared compartment. Use defined tags and budgets to make each group accountable. If you want a second opinion on the whole bill, the Cloudverg Cloud cost audit is $4,500/month, a two-week read-only review that ranks savings, but you can also run the inventory and retention work yourself.
Frequently asked questions
Does Oracle Cloud charge for logging and monitoring?
Yes. OCI Logging charges for log ingestion and storage, and Logging Analytics and APM have their own ingestion and retention costs. Metrics and alarms have separate terms, so check the service entries in Cost Analysis rather than assuming one rate covers all telemetry.
Can I disable VCN flow logs to save money?
Yes, VCN flow logs are optional. Keep them where a security or network requirement says so, and turn them off in dev and test unless you are debugging traffic. If you need the data for long-term review, filter and archive rather than ingest everything into Logging Analytics.
What log retention should I use on Oracle Cloud?
Match retention to the question the log answers. Debug logs can be short, operational logs need enough time to cover a release cycle, and security or audit logs should follow your policy. Set retention per log group so one tier does not force a single period on everything.