[Report] I Attended the Builders' Session on Building Per-Tenant Observability in Multi-Tenant Agentic SaaS #AWSreInvent #COP349

[Report] I Attended the Builders' Session on Building Per-Tenant Observability in Multi-Tenant Agentic SaaS #AWSreInvent #COP349

A report on AWS re:Invent 2026 session COP349. It presents seven patterns for adding tenant information to AI agent traces, logs and metrics in multi-tenant SaaS, enabling per-tenant investigation and alarms in CloudWatch.
2026.12.03

This page has been translated by machine translation. View original

Introduction

Hello everyone, this is Akaike.

I'm attending AWS re:Invent 2026,
and I joined a Builders' session called "Build a per-tenant observability stack for Agentic SaaS".

When you put AI agents into a SaaS where multiple tenants share the same platform, it's common for the overall metrics to look fine while only a specific tenant is having problems...

In this session, we learned through hands-on work how to put tenant information into traces, logs, and metrics so that you can investigate and set alarms on a per-tenant basis.

Session Overview

Title

Build a per-tenant observability stack for Agentic SaaS (COP349)

Abstract

Multi-tenant ISVs need per-tenant observability that traditional dashboards can't deliver — aggregated metrics hide the tenant causing the problem, and shared traces don't tell you whose agent misbehaved. In this session, build a per-tenant observability stack for agents. You'll instrument agent invocations with tenant-aware traces and session replay, build tenant-scoped dashboards that surface noisy neighbors and latency outliers, and configure alerting that fires on per-tenant thresholds rather than aggregate signals. By the end, you'll have an observability setup that scales with your tenant count without a separate data pipeline — and patterns to extend it as your agent architecture grows.

Multi-tenant ISVs need per-tenant observability, which traditional dashboards cannot provide. Aggregated metrics hide the tenant causing the problem, and shared traces don't tell you which agent misbehaved. In this session, you build a per-tenant observability stack for agents. You instrument agent invocations using tenant-aware traces and session replay, build tenant-scoped dashboards that surface noisy neighbors and latency outliers, and configure alerts that fire based on per-tenant thresholds rather than aggregate signals. By the end of the session, you will have an observability setup that scales with your tenant count without a separate data pipeline, and patterns for extending it as your agent architecture grows.

Speakers

  • Matt Tichenor
  • Rocket .
  • Venkatavaradhan Viswanathan
  • Yoginder Sethi
  • Ulli Hinze

Session Information

  • Level: 300 - Advanced
  • Session type: Builders' session
  • Topic: Cloud Operations
  • Related service: Amazon CloudWatch

Session Content

How the Session Worked

A Builders' session is a format where you work hands-on with your own PC.
This time, we worked in a prepared workshop environment using a demo app of a multi-tenant agentic SaaS.

The scenario was: "A certain tenant (customer) can no longer use the system, so find out what is happening and prevent it from happening again."

Naturally, looking at the overall request count and latency doesn't reveal the problem of a specific tenant.
So we built observability that lets us investigate using tenant information as a clue.

Observability Prerequisites

Observability explains the behavior of a system by combining the following three signals.
We also use OpenTelemetry for instrumentation.

  • Logs: Record events for debugging and analysis
  • Metrics: Values measured at runtime, used to evaluate the state and performance of the system
  • Traces: Show the end-to-end path that a transaction or request takes through services

Demo App Architecture

The demo app has a configuration in which multiple tenants share the execution environment of a single agent (pooled model), and it works in the following five steps.

cop349-architecture.drawio

  1. Identifying the tenant
    • The frontend authenticates users with Amazon Cognito
    • The Tenant API validates the access token and obtains the tenant from the authenticated user's custom:tenantId
    • It does not accept the tenant ID from the request body or from headers that the browser can control
  2. Invoking the shared runtime
    • A request is sent from the Amazon API Gateway HTTP API to a Lambda function
    • The Lambda function confirms that the tenant exists, associates the session ID with that tenant, and then invokes Amazon Bedrock AgentCore Runtime
    • Tenant information is passed using W3C Baggage
  3. Running the agent according to the tenant
    • The runtime reads the tenant information and loads the tenant's tier and connector settings from AWS Systems Manager Parameter Store
    • A Strands Agents agent invokes the LLM and that tenant's connector tools
    • For model invocations, it uses an application inference profile tagged with the tenant and tier
  4. Recording the execution
    • AgentCore Observability and OpenTelemetry instrumentation record requests, model invocations, and tool invocations as traces
    • The application code writes the result, token counts, quota state, tenant, and tier to structured logs, and turns them into CloudWatch metrics using Embedded Metric Format
  5. Operating per tenant and per tier (using CloudWatch traces, logs, dashboards, and alarms)
    • Investigate a single tenant
    • Compare tenants in the same tier
    • Find tenants that are approaching their own quota

Seven Patterns for Per-Tenant Observability

The materials organized seven patterns, applying the AWS Well-Architected SaaS Lens and Agentic AI Lens to pooled agent workloads.
Also, although the session implemented them with AgentCore and CloudWatch, the patterns themselves do not depend on specific services or field names.

Pattern 1: Put trusted tenant information on every signal

Per-tenant telemetry is useful only when the tenant information it carries is trustworthy.
Therefore, the tenant is derived from an authenticated identity at a trusted boundary, passed through the entire workload, and included in logs, metrics, and traces.

In the demo app, the Tenant API extracts the tenant ID from the token and passes it to AgentCore Runtime, and the runtime attaches it to traces, logs, and metrics.
The flow looks like the following diagram.

cop349-tenant-context.drawio

In the demo app, the tenant ID was passed with baggage="tenant.id=..." when invoking AgentCore Runtime, and OTEL_BAGGAGE_SPAN_ATTRIBUTE_KEYS=tenant.id was set on the OpenTelemetry distribution to copy the Baggage value into span attributes.

Note that processing that can invoke AgentCore Runtime directly, such as background processing, takes a separate path that doesn't go through the Tenant API. Such paths must either be explicitly trusted or have the tenant re-validated on the runtime side.

However, putting tenant information into telemetry is not a substitute for authorization or tenant isolation.

Also, be careful not to put prompts, model responses, credentials, or tool payloads into shared telemetry unless their purpose, access control, and retention period are defined.

Pattern 2: Apply operational policies according to the tier

The tenant ID identifies the affected customer.
The tier, on the other hand, represents the service level expected for that customer, the quota, consumption trends, and the group of peers to compare against.

You can also vary operational treatment by tier.
As examples for an enterprise tier, the materials listed things like setting earlier warning thresholds, shortening alarm evaluation periods, providing dedicated dashboards, and increasing the trace sampling rate.
However, you must not lower the security, isolation policies, or standards of other tiers.

In the demo app, TenantId and TenantTier are recorded in structured events and metrics.
By setting the Embedded Metric Format dimensions to [[], ["TenantId"], ["TenantTier"]], three metrics (overall, per tenant, and per tier) are emitted from a single event.

cop349-emf-metrics.drawio

The number of per-tenant metrics grows as tenants increase.
On the other hand, per-tier metrics only need as many as there are tiers, so the status of each tier can be checked with the same number of metrics even as tenants increase.

Pattern 3: Trace the entire agent execution

A single request to an agent can result in many model invocations, tool invocations, and retries.
Trace not just the boundary between the API and the runtime but the entire execution path, so that you can follow it from the root request down to the agent, model, and tool spans.

A session ID can be used to associate multiple requests of a single conversation, but the per-request traces remain separate.
Also, you must not use the session ID as a substitute for tenant information or authorization.

Decide sampling and retention periods deliberately, keeping the failure traces needed for investigation while not holding on to successful traces indefinitely.

Pattern 4: Measure the agent's workload, not the request count

The request count doesn't represent how much work the agent did.
Measure in units that affect latency and cost, such as the following.

  • Number of model invocations per request
  • Input tokens and output tokens per model invocation
  • Number and latency of tool invocations
  • Retries and failed attempts
  • Size of the system prompt, conversation history, and retrieved context
  • Number and size of tool definitions

The session showed this difference by comparing two tenants.

Tenant Requests Connector tools Input tokens per model invocation
Hummingbird About 4/min 4 Baseline
Elephant About 1/min 42 About 7x Hummingbird

Looking only at the request count, Hummingbird appears to be heavier, but it is actually Elephant that uses more input tokens.
This is an example where the number and size of tool definitions are also a factor that increases input tokens.

Note that high-cardinality diagnostic values should be kept in logs or traces rather than metrics, unless they are needed for ongoing dashboards or alarms.
This is because adding metric dimensions increases the number of time series and the cost accordingly.

Pattern 5: Record the result the caller received

The HTTP status or runtime state doesn't necessarily represent the result the caller received.
Even if the application catches a model or tool exception and returns HTTP 200, the requested task may have failed.
Conversely, a rejection due to quota may be an expected decision by the application rather than a runtime failure.

So, record one application-level result per invocation.
Examples of classification are as follows.

  • Completed successfully
  • Completed with fallback
  • Rejected before agent execution
  • Quota exceeded
  • Authentication or authorization failure
  • Model failure
  • Tool failure
  • Timeout

Put the result on the root span and in the structured event.
For the reason, use fixed values defined in code rather than exception messages or model-generated text.
This way, you can count failures by tenant and by reason without exposing the content of requests.

Pattern 6: Evaluate health and limits per tenant

Overall totals and tier averages are informative, but they can hide the risk of individual tenants.
Compare tenants within the same tier, and then evaluate each tenant against its own quota and baseline.

In the session scenario, the average of the premium tier looked fine, but a tenant named Bison had already exceeded 80% of its own token quota.

cop349-per-tenant-alarm.drawio

To find this, we use a CloudWatch Metrics Insights query that returns one series per tenant.

SELECT MAX(MonthlyQuotaUsagePercent)
FROM SCHEMA("Product/TenantUsage", TenantId, TenantTier)
WHERE TenantTier = 'premium'
GROUP BY TenantId
ORDER BY MAX() DESC

When you create an alarm from this query, CloudWatch evaluates each returned per-tenant series individually.
The division of roles is that the tier is used to choose the group to compare and the policy, while alarm evaluation is done per tenant.

Note that 80% is a value for the workshop; in production, you need to decide it by considering the pace of consumption, the time needed to respond, the timing of quota resets, and so on.
Also, per-tenant custom metrics and alarms can become costly when there are many tenants.
The recommended division of use was to use metrics for continuous evaluation, and to use logs, traces, and Contributor Insights for investigation and ranking.

Pattern 7: Separate operational cost estimates from billing allocation

From the application's token counters and the model price list, you can quickly produce a cost estimate.
It is useful for noticing changes and explaining consumption, but it is not the AWS billed amount.

For billing allocation, use a method that the billing mechanism supports.
In the demo app, an application inference profile was created for each tenant and tagged with the tenant and tier.
When those tags are activated as cost allocation tags, model costs can be aggregated by tag in Cost Explorer and the Cost and Usage Report.

cop349-cost.drawio

Billing data differs from application telemetry in granularity and delay, so you need to reconcile operational estimates with billing data.

CloudWatch Features Used

The session used a combination of the following CloudWatch features.

Feature How it's used
Dashboards and dashboard variables Provide overall, tenant, and tier views. Selecting the tenant and tier switches the same widgets to a different scope
Transaction Search Search OpenTelemetry spans by attributes such as tenant and session ID, and open the entire trace of a single request
Log Analytics (Logs Insights) Analyze structured logs and spans on the spot to investigate failures, token consumption, and cost estimates
Embedded Metric Format Create custom metrics with tenant and tier dimensions from structured JSON log events
Contributor Insights Continuously rank tenants from structured logs without creating permanent per-tenant custom metrics
Metrics Insights Filter and group custom metrics with SQL. Returns a quota usage series for each tenant within a tier
Multi-time series alarms Evaluate all the per-tenant series returned by a Metrics Insights query and identify the tenants that exceed the threshold

Materials

COP349_01

At the end of the session, the following materials were introduced.

  • Explanations of all the patterns covered in the workshop
  • Code snippets and interactive architecture diagrams
  • Agent skills for applying what you learned to your own environment

https://gist.github.com/uhinze/eaa9f77e1c766edbfc3c65c4a79f5f28

In addition to the seven patterns introduced here, these materials also compile Logs Insights and Transaction Search queries, how to create application inference profiles with CloudFormation, and a checklist for evaluating your own system.
If you want to try the implementation, please refer to them.

Conclusion

That was my report on the "Build a per-tenant observability stack for Agentic SaaS" session.
It was a practical session where we assembled observability that can be investigated per tenant while working hands-on.

Personally, the following points were particularly impressive.

  • Obtaining the tenant ID from a trusted place
    • By extracting the tenant ID from the authenticated identity rather than from the request body or headers, and passing it to AgentCore Runtime via Baggage, the tenant information carried in telemetry itself can be trusted
  • Looking at the number of tokens and tools rather than the request count
    • The example of a tenant with few requests using the most input tokens because of its many tool definitions felt like a perspective unique to agents
  • Evaluating per tenant rather than by tier average
    • Since alarms can be evaluated per tenant from a single Metrics Insights query, you don't have to create alarms individually even as tenants increase

If you are embedding agents into a multi-tenant SaaS, it seems a good idea to check your own system using the checklist in the materials.


AWS re:Invent 2026まとめ情報

クラスメソッドは2026/11/30〜12/4にラスベガスで開催されるAWSカンファレンスイベント「re:Invent」を今年も特集しました。ぜひ一度ご覧ください。 re:Invent 2026ポータルサイトを見るAWS re:Invent公式サイトはこちら

Share this article

AWSのお困り事はクラスメソッドへ