Arize-ai / openinference

Auto-Instrumentation for AI Observability
https://arize-ai.github.io/openinference/
Apache License 2.0
150 stars 22 forks source link

[bedrock] [documentation] documentation for bedrock readme #140

Open mikeldking opened 5 months ago

dosubot[bot] commented 5 months ago

🤖

Hey there, @mikeldking! Good to see you around again. Hope you're doing well.

Based on the context provided, it appears that you're looking for documentation for the "bedrock" module within the OpenInference repository. Unfortunately, there doesn't seem to be a dedicated README for this module at the moment. However, I can provide a brief overview based on the available code and comments.

The "bedrock" module provides an instrumentor, BedrockInstrumentor(), which is used to instrument the application for tracing. This is evident from the line BedrockInstrumentor().instrument() in the provided context. The purpose of instrumentation in this context is to add tracing capabilities to the application. Tracing is a way to track the execution of a program and is particularly useful in distributed systems to understand the flow of transactions or requests.

In this specific example, the BedrockInstrumentor is used to add tracing to a program that interacts with a "bedrock-runtime" service via the AWS SDK (boto3). The traces are then exported to a console and an OTLP (OpenTelemetry Protocol) endpoint for further analysis.

The BedrockInstrumentor class interacts with the "bedrock-runtime" service via the AWS SDK (boto3) by instrumenting the boto client creation and the invoke_model method of the client. The instrumented invoke_model method starts a new span with the name "bedrock.invoke_model" when it is called. It also extracts information from the request and response bodies and sets them as attributes on the span.

You can find more details in the source code of the "bedrock" module: python/instrumentation/openinference-instrumentation-bedrock/src/openinference/instrumentation/bedrock/init.py

I hope this helps! If you have more specific questions about the "bedrock" module or if there's something else you'd like to know, please let me know!

-Dosu

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.