Skip to content

feat(crewai) GenAI semconv compliance#3817

Open
max-deygin-traceloop wants to merge 2 commits intomax/tlp-1925-python-sdk-otel-semantic-conventionfrom
max/tlp-1930-crewai-insturmentation
Open

feat(crewai) GenAI semconv compliance#3817
max-deygin-traceloop wants to merge 2 commits intomax/tlp-1925-python-sdk-otel-semantic-conventionfrom
max/tlp-1930-crewai-insturmentation

Conversation

@max-deygin-traceloop
Copy link
Contributor

@max-deygin-traceloop max-deygin-traceloop commented Mar 17, 2026

What

Refactors the Crew-AI instrumentation package to emit span attributes that comply with the
OpenTelemetry GenAI semantic conventions spec.

Summary

  • Migrated CrewAI instrumentation to OTel GenAI semantic conventions (gen_ai.* attribute namespace, replacing legacy llm.* names)
  • Added gen_ai.provider.name to all CrewAI spans (wrap_kickoff, wrap_agent_execute_task, wrap_llm_call)
  • Added tests/test_semconv_attrs.py — unit tests verifying every mapped attribute name lands correctly on emitted spans, and that no legacy llm.*
    attributes remain
  • Added tests/test_semconv_compliance.py — re-uses shared compliance suite from opentelemetry-semantic-conventions-ai._testing

Test plan

  • uv run pytest tests/test_semconv_compliance.py — all shared semconv constants pass
  • uv run pytest tests/test_semconv_attrs.py — all attribute name and legacy-absence assertions pass
  • uv run pytest tests/ — full test suite passes

@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0e925bd1-5620-4e06-a7c1-700f9579a4d3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch max/tlp-1930-crewai-insturmentation
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@max-deygin-traceloop max-deygin-traceloop force-pushed the max/tlp-1930-crewai-insturmentation branch from a443c64 to 77e9177 Compare March 18, 2026 10:40
@max-deygin-traceloop max-deygin-traceloop changed the title Crew AI semconv compliance feat(crewai) GenAI semconv compliance Mar 18, 2026
@max-deygin-traceloop max-deygin-traceloop force-pushed the max/tlp-1925-python-sdk-otel-semantic-convention branch from 740ee81 to 6401889 Compare March 18, 2026 11:06
@max-deygin-traceloop max-deygin-traceloop force-pushed the max/tlp-1930-crewai-insturmentation branch 4 times, most recently from 93d66c5 to 7e2c0fb Compare March 18, 2026 14:54
max-deygin-traceloop and others added 2 commits March 19, 2026 16:31
…EN_AI_

- Import GEN_AI_REQUEST_MODEL/TEMPERATURE/TOP_P/MAX_TOKENS/FREQUENCY_PENALTY/
  PRESENCE_PENALTY/STOP_SEQUENCES/SEED directly from upstream gen_ai_attributes
- Use SpanAttributes.GEN_AI_REQUEST_N and GEN_AI_REQUEST_MAX_COMPLETION_TOKENS
  (renamed from LLM_*) for the remaining non-upstream constants
- Update test_semconv_attrs.py to assert upstream constants directly
- Add [tool.uv.sources] for local editable semconv_ai install

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@max-deygin-traceloop max-deygin-traceloop force-pushed the max/tlp-1930-crewai-insturmentation branch from 7e2c0fb to fc8c171 Compare March 19, 2026 14:31
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