Langfuse tracing for Amazon Bedrock

Tracing Amazon Bedrock calls in a self-hosted Langfuse inside your AWS account is possible through three documented paths. This page explains which path fits your stack, what to prepare, and how to verify the traces.

On this page

Langfuse tracing for Amazon Bedrock: which path fits your stack

Platform teams usually discover Bedrock model calls spread across many applications, each calling the Bedrock runtime in its own way. The goal is to make those calls visible in a self-hosted Langfuse that runs inside your own AWS account, so traces, token usage and latency are captured centrally. Three capture paths are documented, and the right one depends mostly on how your applications already call models. Choose the path before you change application code, because the path decides where instrumentation lives: inside each application, at a proxy, or in a wrapper around the Converse API.

The first path uses an integrated framework. Langfuse documents integrations for LangChain, LlamaIndex, Haystack and the Vercel AI SDK, so applications built on those frameworks can send Bedrock calls to Langfuse through the framework's integration rather than custom code. The second path routes calls through a LiteLLM proxy, which suits organizations where many teams call Bedrock directly and a single gateway is the practical place to capture requests. The third path wraps the Bedrock Converse API with the Langfuse decorator, which gives you explicit control over each traced call. Confirm which framework and SDK versions your applications use against the Langfuse Amazon Bedrock documentation before you commit to a path.

Bedrock is also useful beyond tracing. Once a Bedrock configuration is added in project settings, the Langfuse playground, LLM-as-a-judge evaluations and prompt experiments can call Bedrock models. Plan that configuration as part of the same access design, since it determines which AWS identities and models the Langfuse instance can invoke. Confirm the IAM permissions and model access your organization requires in your own account before enabling it for evaluation workloads.

What you need before connecting Bedrock to Langfuse

Connecting Amazon Bedrock to a self-hosted Langfuse touches four areas: the Langfuse deployment, Langfuse credentials, AWS access and the network path between them. Each card below is a prerequisite to confirm before the first trace or playground call leaves your application.

Langfuse reachable from application network

Your applications, and any LiteLLM proxy, must reach the Langfuse web endpoint over a route your network policy allows. Confirm that the Langfuse Web container is reachable from every subnet that runs Bedrock-calling workloads, including staging and CI runners. Traces are sent to this endpoint, so a blocked route shows up as missing data rather than as an error in the model call.

Self-hosting docs

Langfuse project keys

Each Langfuse project issues a public and secret key pair that the SDK, decorator or proxy uses to authenticate. Create separate projects, and therefore separate key pairs, for development, staging and production so that traces and prompts stay separated. Store the secret key in your secrets manager, not in application code or container images, and plan how it is rotated.

AWS credentials for the tracing workload

The application, the proxy or the Langfuse Bedrock configuration needs AWS credentials that can invoke the chosen models. Prefer an IAM role attached to the workload, such as an EKS service account or EC2 instance profile, over long-lived access keys. Confirm the exact IAM actions against the Langfuse Bedrock documentation and your own account policy, because the minimum set depends on the integration path you choose.

Langfuse Bedrock docs

Bedrock model access in the target region

Model access in Amazon Bedrock is granted per model and per region, so a model that works in one region may not be enabled in the region your application calls. Check which model IDs your team uses, confirm they are enabled in the same region as the Bedrock configuration, and confirm the IDs against the Langfuse documentation. Record the region alongside each model so that cost and latency reports can be read correctly later.

Langfuse version and SDK compatibility

Python SDK v5 and JS/TS SDK v6 require Langfuse v4.59.0 or later. Check the version of your self-hosted deployment before you pin SDK versions, and plan the upgrade first if an older deployment is in place. Major upgrades change the infrastructure and data model, so schedule them as a separate change rather than bundling them with the Bedrock work.

Egress path for LiteLLM and framework traffic

If requests pass through a LiteLLM proxy, the proxy host needs a route to Langfuse as well as to Bedrock. Map each hop, including proxies, load balancers and TLS termination, and confirm that the Langfuse host name used by the SDK resolves and presents a certificate trusted by the calling runtime. Test with a single trace from each environment before enabling tracing across the fleet.

Choosing between framework, LiteLLM and Converse API capture

Applications built on LangChain, LlamaIndex, Haystack or the Vercel AI SDK can be traced through the framework's Langfuse integration, so instrumentation lives in application code and configuration. Each owning team adds the integration and sends its own traces to your self-hosted Langfuse. The Langfuse Amazon Bedrock documentation describes the framework paths.

  • What gets captured: framework-level runs, including chains, retrieval steps and model calls, with the prompts, completions and token usage the integration records for the Bedrock model.
  • Where instrumentation lives: in each application repository, so tracing changes ship through that team's normal release process.
  • Effort and coverage: low for a team already on a supported framework, but every application needs its own setup and project keys. Calls made outside the framework are traced only if they are instrumented separately.
  • Version dependence: coverage depends on the framework version and the Bedrock model classes it supports, so the integration should be tested against the versions you run.

Before you commit, confirm which framework versions your teams use and whether each records the token and cost fields your reports need.

How to configure Bedrock tracing step by step

This sequence takes a team from a reachable self-hosted Langfuse instance to a verified Bedrock trace and a working playground, with a check at each stage so problems surface where they start. It produces traces with model, input, output and token usage, plus a Bedrock configuration that the playground and evaluators can use.

  1. Confirm the self-hosted Langfuse is reachable

    Before touching AWS, confirm that your self-hosted Langfuse answers at the host your applications will use, that the web UI loads over the network path your workload has, and that you can sign in with an administrator account. Confirm TLS terminates where your security team expects it. The step is done when the UI loads from the same network segment as the Bedrock workload and the health endpoint responds for that host. Check the self-hosting documentation for the health check path that matches your version.

  2. Create a project and generate API keys

    In the Langfuse UI, create a project for the Bedrock workload and generate a public and secret key pair scoped to it. Store the secret key in your secrets manager rather than in source control, and record which team owns the project. The step is done when a test request from the workload host using these keys is accepted by the Langfuse host and the project appears in the UI. If the request returns an authentication error, check that the host value includes the correct scheme and port.

  3. Configure AWS credentials for the workload

    Give the application an AWS identity that can invoke the specific Bedrock models it needs. Prefer the IAM role attached to the compute running the workload (EC2 instance profile, ECS task role, EKS pod identity or similar) over long-lived access keys. Scope the policy to the required model ARNs and the invoke actions your chosen path uses, and confirm with your AWS team whether your organization requires a permission boundary. The step is done when a simple Bedrock call from the workload succeeds with that identity and fails for a model outside the policy.

  4. Instrument the chosen tracing path

    Choose one path: a supported framework integration such as LangChain, LlamaIndex, Haystack or the Vercel AI SDK; a LiteLLM proxy in front of Bedrock; or the Langfuse decorator wrapped around the Bedrock Converse API. Add the Langfuse host and project keys as environment variables and enable the integration in the code or proxy configuration. Keep the path your team can maintain, since each path changes where spans originate. The step is done when the application starts without errors and the instrumentation reports it is active in its startup logs.

  5. Send a test model call

    Run a short, non-sensitive prompt through the instrumented path so the call reaches a Bedrock model. Use a prompt you can recognize in the trace, such as a fixed test string, and avoid real customer data at this stage. Flush the client before the process exits if your SDK buffers events, so the trace is not lost on shutdown. The step is done when the call returns a model response to the application and no exception is raised in the calling code.

  6. Confirm the trace shows model, input, output and usage

    Open the trace in the project and check that it names the Bedrock model, shows the input and output of the call, and records token usage. If usage is missing, check whether your path captures it for Bedrock responses and whether the model is priced in Langfuse. If the trace is absent, check the Worker container logs and the host and keys. The step is done when the test trace shows all four fields and the trace ID matches the one returned by your application log.

  7. Add the Bedrock configuration in project settings

    In the project settings, add a Bedrock model provider configuration using the AWS identity you set up earlier, so Langfuse itself can call Bedrock for features outside your application. Confirm with your AWS team which credential mechanism Langfuse will use in your deployment, and whether it can assume the role you intend. Keep the scope identical to the workload policy unless you have a documented reason to widen it. The step is done when the configuration saves without a validation error.

  8. Run the playground and verify the result

    Open the playground in the same project, select the Bedrock model, and run a short prompt. Confirm that the response returns and that the playground call appears as its own trace with usage recorded. Then run one LLM-as-a-judge evaluator against an existing trace to confirm the judge can use Bedrock. The step is done when the playground returns output and the judge run completes with a score attached to the trace.

How a Bedrock call reaches Langfuse

The diagram starts in the application, which calls Amazon Bedrock directly or through a LiteLLM proxy. Three capture paths can record the call: a framework callback, the LiteLLM proxy, or a decorator around the Converse API. Each path sends its trace to the Langfuse web and worker containers inside your AWS account, where PostgreSQL, ClickHouse and blob storage hold the data. Check that the trace leaves the application network only toward your own Langfuse host, and confirm which Bedrock endpoint your traffic uses.

Bedrock call capture paths and the trust boundaries they cross.

Using Bedrock as the model for playground and LLM-as-a-judge

Once a Bedrock configuration is added in the project settings, the Langfuse playground, LLM-as-a-judge evaluators and prompt experiments can call Amazon Bedrock models directly. The practical benefit is that evaluation traffic, which is often the largest volume of model calls after production traffic, can stay inside the same AWS account and regions your application already uses. Instead of sending prompts and completions from your judge models to a separate provider account, you keep one set of IAM policies, one billing view and one set of network controls to review. Confirm this design with your security team before you rely on it, because the exact credentials Langfuse uses and where its requests originate depend on how your self-hosted instance is networked.

Before you configure anything, confirm three things with the team that owns your AWS account. First, model access: Bedrock model access must be granted in the specific region you configure, and availability differs by model and region, so check the Bedrock console for the region your Langfuse deployment will call. Second, which models appear: the models offered in the playground and judge selectors are the ones your configuration exposes, so agree on an approved list rather than letting every evaluator pick any model. Third, who can change the configuration: project settings control which credentials and models are used, so limit edit rights to a named group, and record changes in your audit process. Verify the result by running a single playground call and one judge evaluation against a test trace before opening the setup to the wider team.

How Bedrock calls map to Langfuse traces

This table maps the fields of an Amazon Bedrock call to the Langfuse objects that store them: trace, generation and observation. Read it to decide what your application must set itself and which mappings to confirm in a test trace before you rely on them.

FieldWhere it lands in LangfuseWhat to verify or add
Model IDGeneration model name, used for pricing and filteringConfirm the Bedrock model ID is captured as-is on your chosen path, and whether cost lookup matches it
Input messagesGeneration input (the messages or prompt sent to the model)Verify message structure and whether system prompts appear separately on your path
CompletionGeneration output (the text or tool-call response)Verify streamed responses are assembled into one output on your path
Token usageGeneration usage details (input and output tokens)Confirm counts are populated for Converse calls and for any proxy in front of Bedrock
AWS regionMetadata on the generation or trace, if your path passes itSet it explicitly as metadata so regional routing is visible in traces
Request metadata and tagsTrace or generation metadata, tags and version fieldsAdd your own tags and version values in application code; confirm which keys the path forwards
User IDTrace user attribute, used for per-user filtering and cost viewsApplication must set it; Bedrock does not supply end-user identity
Session IDTrace session attribute, grouping multi-turn conversationsApplication must set it; Bedrock does not supply a session concept
Latency and errorsObservation timing and error statusVerify failed or throttled calls appear with error details on your path

Securing Bedrock credentials and trace content

Tracing Bedrock calls puts two kinds of sensitive material in front of your team: the AWS and Langfuse credentials that let the integration run, and the prompts and completions that get stored as traces. The cards below cover how to limit each one, and which decisions to make before the first trace reaches your self-hosted instance.

Scope the workload's IAM role

Give the application or gateway that calls Bedrock an IAM role that can invoke only the model IDs and regions your team has approved, rather than a broad Bedrock administrator policy. Keep the tracing path separate from the calling path where you can, so the Langfuse integration never needs permissions beyond what the call itself requires. Review the policy with your AWS account owners and confirm the exact Bedrock actions your chosen integration path uses in the Langfuse Bedrock documentation before writing the policy.

Langfuse Bedrock docs

Keep keys out of code

Store the AWS credentials and the Langfuse public and secret keys in a secrets manager or your platform's secret store, and inject them into the runtime at start. Avoid hard-coding them in notebooks, Dockerfiles, Helm values files or CI logs. Prefer short-lived AWS credentials from an assumed role or workload identity over long-lived access keys, and plan rotation for the Langfuse project keys, since rotating them is a change every tracing client must receive.

Restrict Bedrock configuration edits

The Bedrock configuration in project settings holds the credentials that the playground and LLM-as-a-judge evaluations use to call models. Anyone who can edit it can point those calls at a different account or spend budget, so limit edit rights to a small group of maintainers. Confirm which project role can change model provider settings in your version, and whether project-level RBAC roles require an Enterprise license key in your deployment.

Decide what content gets stored

Prompts and completions often contain customer names, account details or health and employment information. Decide per application whether full input and output capture is needed, whether metadata-only tracing is enough for latency and cost, and which fields must be masked before they leave the calling service. Document the decision with your privacy team, because it sets the personal data your Langfuse database and blob storage will hold.

Mask data on the server

Server-side data masking in self-hosted Langfuse is an Enterprise license key feature, so confirm your current licensing before relying on it. Masking on the client or in the calling application works without that key, but it depends on every team implementing it correctly. Test masking with sample Bedrock traffic that contains realistic personal data before enabling it for production traces.

Set retention for trace data

Retention policies that delete old traces are also an Enterprise license key feature. Without them, traces containing personal data accumulate in ClickHouse and in any blob storage holding exports, so decide retention periods with your compliance lead before go-live. Confirm whether your license covers retention policies, and if it does not, document the deletion process you will run instead.

License key docs

Why Bedrock traces go missing or fail

This table pairs each common failure with its likely cause and the fix, grouped by where it appears: tracing setup, AWS access, the LiteLLM path, decorator placement, the playground and the network. Work through the rows in order when a Bedrock call is not appearing in your self-hosted Langfuse project.

SymptomLikely causeFix
Traces missing from the projectPublic or secret keys belong to a different project, or the host points at another Langfuse deploymentConfirm the host URL, then compare the key pair against the project settings in the same self-hosted instance and replace any mismatched values
Bedrock returns AccessDeniedThe IAM role lacks bedrock:InvokeModel permissions, or model access was not granted for the model in this regionCheck the IAM policy on the calling role, then confirm in the Bedrock console that the model is enabled in the region your application calls
Bedrock call succeeds but no trace appearsThe LiteLLM callback is not registered, or the callback name in the proxy config does not match the Langfuse integrationReview the LiteLLM config for the Langfuse callback entry, restart the proxy, and send one test request to confirm the trace arrives
Only some Converse calls are tracedThe decorator wraps a helper function or a wrapper that never makes the Bedrock request, so the model call sits outside the traced spanMove the decorator onto the function that calls the Converse API directly, then rerun one request and check that the generation appears nested under it
Playground fails with a Bedrock errorThe Bedrock configuration in project settings is incomplete, such as a missing region, credentials or model identifierOpen the project's LLM connection settings, complete every Bedrock field, save, and retry the playground with a model that the account can invoke
LLM-as-a-judge runs stall or failThe judge model is not configured in the same project, or the evaluator's Bedrock credentials differ from the working playground setupConfirm the judge model uses the same Bedrock connection as the playground, then run one evaluation on a single trace to check the output
Requests time out from private subnetsThe Langfuse or application workload has no route to Bedrock endpoints, or the VPC endpoint and security groups block outbound HTTPSConfirm the network path to the regional Bedrock endpoint, including VPC endpoints, NAT routes and egress rules, and test connectivity from the same subnet

Questions teams ask before tracing Bedrock in Langfuse

How much effort does tracing Amazon Bedrock in Langfuse take?

The effort depends mostly on how many applications call Bedrock, which frameworks they use, and whether calls already pass through a gateway. A single application using a framework with a native Langfuse integration is a small change. Each additional application, custom wrapper or model type adds instrumentation, testing and review work. Teams with a LiteLLM gateway can often capture calls in one place instead of changing each application, which reduces the number of code paths to maintain. Ask a partner to break the written scope down by application, framework and gateway so you can see where the effort sits.

What drives the cost of a Bedrock tracing integration?

Cost follows the amount of instrumentation and verification work, not the Langfuse license, which is free under the MIT license for the core features. The main drivers are the number of applications and services, the frameworks in use, whether a LiteLLM gateway exists, the need for security review of what gets stored, and how many environments need to be covered. Recurring costs are mostly your own: AWS spend on model calls, storage for traces, and the infrastructure that runs Langfuse. Ask for a quote that lists one-time setup work separately from any ongoing support or retainer, and that names what is excluded.

Can our platform team set up Bedrock tracing without outside help?

Often yes, if the team already runs Langfuse and has engineers who can change application code and IAM policies. The work is usually straightforward for one framework and grows with the number of applications and the review requirements. Teams without a running Langfuse instance, or without experience with Bedrock IAM roles and model access, will spend more time on the setup than on the tracing itself. A useful test is whether someone can explain how Bedrock credentials are scoped, where traces are stored, and who can read them. If those answers are not clear yet, outside help on the design and review stage is worth considering.

What do we need to provide for a Bedrock tracing engagement?

Plan to provide access and decisions, not just code. The usual inputs are:

  • AWS account access, or a role your team can assign, with permission to view Bedrock model access and create or review the IAM identities used by the integration
  • Langfuse admin rights on the target project and, if you use the Bedrock configuration in project settings, the ability to add it
  • Sample traffic or representative test prompts from each application, so the traces can be checked against real request shapes
  • A named owner who signs off on what content is stored in traces, including prompts, completions and user identifiers

Confirm these items in the written scope so your team can plan its time.

Do we need to approve what gets stored in traces?

Yes. Bedrock traces can contain full prompts and model completions, and those may include personal data or confidential business content. Before instrumentation starts, decide which fields are captured, whether user identifiers are pseudonymized, how long traces are kept, and who can read them in Langfuse. Self-hosted Langfuse gives you control over where that data lives, but some controls such as server-side data masking and data retention policies require an Enterprise license key, so confirm which features your edition includes. Your security and privacy teams should review this decision before traces start flowing from production.

How long does a Bedrock tracing project take?

The duration depends on scope, and no fixed timeline applies across every environment. A single application with one supported framework usually moves faster than a set of services that need separate reviews, a gateway change and staged rollout to production. Scheduling also depends on how quickly AWS access, Langfuse admin rights and sign-off on stored content can be arranged. Ask a partner for a written timeline tied to the agreed deliverables, with the dependencies on your side listed as milestones, and check which environments and approval steps are included.

What should we ask a partner for in a written scope?

Ask for a scope that names each application and integration path, the Bedrock models and regions covered, and the Langfuse project and environments that receive traces. The written scope should also state what is tested, how traces are verified, what the sign-off on stored content covers, and what documentation and handover you receive. Ask whether playground, LLM-as-a-judge and prompt experiments are included, because those need a Bedrock configuration in project settings. Finally, confirm what is excluded, such as ongoing monitoring, upgrades or changes to your gateway, so the quote can be compared with your own estimate.

Confirming the setup against your own AWS account

Verification is the step that proves the chosen path works in your account, not just in a demo. A fixed-scope engagement would start by agreeing in writing which path each team uses (a framework callback, LiteLLM in front of Bedrock, or the Langfuse decorator around the Bedrock Converse API) and which application services, AWS accounts, Regions and Bedrock models are in scope. The scope, deliverables and timeline are agreed before any work starts. DeployOpen does not publish a price list, so the quote follows from that written scope and the number of paths and applications it covers.

Test traces come first. For each path, the engagement would send known test requests through the Bedrock model and check that the resulting trace in your self-hosted Langfuse shows the expected model identifier, input and output, latency, token usage and user or session attributes. Where Bedrock token counts do not produce the cost you expect, the check should confirm model pricing in project settings rather than assume it. Confirm with your own team which IAM role the Langfuse instance or proxy uses to call Bedrock, and whether that role is limited to the approved model IDs and Regions.

Next come the playground and LLM-as-a-judge checks. Add the Bedrock configuration in project settings, then run a playground prompt, a judge evaluator and a small prompt experiment against it, confirming each reaches the intended model and that results are stored in the right project. The handover should include the project configuration, the IAM policy and role names, the list of verified paths with their test evidence, and the runbook for rotating credentials. Ask for those artifacts explicitly in the quote so they are delivered and owned by your team.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.