agentops icon indicating copy to clipboard operation
agentops copied to clipboard

Documentation-Implementation Gap for Session Tags

Open devin-ai-integration[bot] opened this issue 9 months ago • 0 comments

Description

Since release 0.4.0, AgentOps has transitioned to storing tags as OpenTelemetry span attributes with the key "session.tags" rather than directly in session objects. While this architectural improvement doesn't prevent backend filtering, it has created confusion about the proper methods for adding tags to sessions.

Current Problem

The documentation in `docs/v1/concepts/tags.mdx` mentions methods like `set_tags()` and `add_tags()`:

```python agentops.set_tags(['test new tag']) agentops.add_tags(['appended tag']) ```

However, these methods don't appear to be implemented in the current codebase. The only clear ways to add tags currently are:

  1. During initialization: ```python agentops.init(default_tags=['tag']) ```

  2. During session creation: ```python agentops.start_session(tags=["tag"]) ```

Impact

This discrepancy between documentation and implementation creates confusion for users trying to add tags to sessions after they've been created.

Suggested Solutions

  1. Update the documentation: Revise `docs/v1/concepts/tags.mdx` and other relevant documentation to accurately reflect the current implementation and available methods for adding tags.

  2. Implement the missing methods: Add implementations for `add_tags()` and `set_tags()` that work with the new span attribute-based system.

Additional Context

  • The transition to OpenTelemetry span attributes is a positive architectural change that provides better standardization and integration.
  • The test file `tests/unit/sdk/test_instrumentation.py` confirms that tags are properly stored as span attributes with the key "session.tags".
  • The backend filtering functionality should still work with the attribute-based approach, but the user-facing API for adding tags needs clarification.