Skip to content

Conversation

@yiyuan-he
Copy link
Contributor

What does this pull request do?

Handles additional CrewAI LLO attributes not originally in scope. Certain configurations of CrewAI Agents in customer applications can produce the following LLO attributes:

Example CrewAI Agent Configurations:

assistant_agent = Agent(
    role="Assistant",
    goal="Provide helpful responses to user queries",
    backstory="You are a helpful assistant that provides accurate and useful information.",
    verbose=True,
    llm=llm,
)

crew = Crew(
    agents=[assistant_agent],
    tasks=[response_task],
    verbose=True,
    process=Process.sequential
)

Related PR: #361

Test plan

Built this custom ADOT SDK into various sample apps and exported the span and logs data to the OTLP X-Ray and Logs endpoint, respectively, to validate the LLO extraction and transformation to Gen AI Events.

Configurations tested:

  • CrewAI + Traceloop/Openllmetry
  • CrewAI + OpenInference
  • CrewAI + OpenLit

Environment variable configuration:

λ  env OTEL_METRICS_EXPORTER=none \
       OTEL_TRACES_EXPORTER=otlp \
       OTEL_LOGS_EXPORTER=otlp \
       OTEL_PYTHON_DISTRO=aws_distro \
       OTEL_PYTHON_CONFIGURATOR=aws_configurator \
       OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
       OTEL_EXPORTER_OTLP_LOGS_HEADERS="x-aws-log-group=test,x-aws-log-stream=default" \
       OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://xray.us-east-1.amazonaws.com/v1/traces \
       OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://logs.us-east-1.amazonaws.com/v1/logs \
       OTEL_RESOURCE_ATTRIBUTES="service.name=langchain-app" \
       OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED="true" \
       OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT="true" \
       OTEL_PYTHON_DISABLED_INSTRUMENTATIONS="http,sqlalchemy,psycopg2,pymysql,sqlite3,aiopg,asyncpg,mysql_connector,botocore,boto3,urllib3,requests,starlette" \
       AGENT_OBSERVABILITY_ENABLED="true" \
       python app.py

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@yiyuan-he yiyuan-he requested a review from a team as a code owner May 18, 2025 18:14
@yiyuan-he yiyuan-he merged commit b972d72 into aws-observability:genesis-dev-v2 May 18, 2025
@yiyuan-he
Copy link
Contributor Author

yiyuan-he commented May 18, 2025

Merging to genesis-dev-v2 branch to better enable E2E integration testing.

@yiyuan-he yiyuan-he deleted the enhance-crewai-llo-support branch May 18, 2025 18:19
yiyuan-he added a commit that referenced this pull request May 19, 2025
## What does this pull request do?
Refactoring changes to improve performance, especially for spans with
few or no LLO attributes, while maintaining the same functionality and
behavior.

## Test plan
Same test strategy as
#361
and
#365

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
@yiyuan-he yiyuan-he changed the title Enhance CrewAI LLO Support in Genesis ADOT SDK Enhance CrewAI LLO Support in BedrockAgentCore ADOT SDK Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant