Ravindra BagaleCourses & study guides मराठी

Chapter 95: Logging with Loki, Elastic Stack and CloudWatch

DevOps

95.15 Access, retention and cost guardrails

Story (fictional teaching scenario). At a fictional Jaipur firm, Elena from Berlin needs a short incident investigation, not access to every team’s historical logs.

Access, retention and cost guardrails
Access, retention and cost guardrails

Why

Logs are sensitive operational data, and indefinite collection can increase exposure and cost.

What

  • RBAC means role-based access control: permissions follow reviewed roles.
  • Least privilege grants only the required log scope and operations.
  • A retention policy determines when stored records are eligible for removal, subject to obligations and legal holds.
  • Ingestion, storage and query scanning can be separate cost drivers. Rates depend on product, region, class and plan.
  • An export creates another copy with its own access/retention requirements.

How

  1. Keep access scoped by purpose and separate read from administration.

  2. Obtain approval before any retention/access change; none is performed here.

  3. Estimate volume and query frequency without inventing a price.

  4. Use narrow scopes and avoid unnecessary dashboard refreshes.

  5. Retain every existing backup in this course workflow; this lesson is not permission to delete anything.

Example 1: Estimate volume, not a bill

  1. Read the command or request.
100 events/minute ×60 minutes =6000 events
6000 events ×500 bytes/event =3000000 bytes before storage effects
  1. Read the result.

Output (illustrative; NOT executed against Loki, Elastic or CloudWatch)

Approximate raw event volume:3 million bytes per hour in this fictional example.
  1. Line by line: This arithmetic excludes compression, indexing, replication, metadata and product billing rules. It is not a cloud price quote. Standard Logs Insights queries should use narrow groups/time; stop unnecessary running queries and avoid high-frequency dashboard refreshes, as official guidance warns.

Ravindra Bagale's Tip

Retention and access changes need real approval, not a tutorial command.

Did you understand? Let us try it once more.