Skip to content

fix: Events API fixes - ordering, project deprecation, enrich_span event_id#195

Merged
dhruv-hhai merged 4 commits into
complete-refactorfrom
fix/events-api-fixes
Jan 28, 2026
Merged

fix: Events API fixes - ordering, project deprecation, enrich_span event_id#195
dhruv-hhai merged 4 commits into
complete-refactorfrom
fix/events-api-fixes

Conversation

@dhruv-hhai
Copy link
Copy Markdown
Contributor

Summary

  • Fix jumbled event ordering: get_by_session_id now returns events sorted chronologically by start_time
  • Deprecate project parameter: export() and get_by_session_id() now show DeprecationWarning when project is passed (backend infers from filters)
  • Fix enrich_span with event_id: When event_id is provided, enrich_span now calls PUT /events API to update that specific event instead of enriching the current span
  • Add retry logic: export() now retries on transient errors (502, 503, 504) with exponential backoff
  • Bumps version to 1.0.0rc15

Test plan

  • Unit tests: 20 tests covering sorting logic, deprecation warnings, request body construction, and enrich_span behavior
  • Integration tests: 5 tests verifying end-to-end functionality against live backend
  • Manual verification of deprecation warnings in user code

Files changed

  • src/honeyhive/__init__.py - Version bump
  • src/honeyhive/api/client.py - Event sorting, project deprecation, retry logic
  • src/honeyhive/tracer/core/context.py - enrich_span event_id handling
  • src/honeyhive/tracer/instrumentation/enrichment.py - API update logic for event_id
  • tests/unit/test_api_events_fixes.py - New unit tests
  • tests_v2/integrations/test_events_fixes_integration.py - New integration tests

…ent_id

- Fix jumbled event ordering: get_by_session_id now returns events sorted
  chronologically by start_time
- Deprecate project parameter: export() and get_by_session_id() now show
  DeprecationWarning when project is passed (backend infers from filters)
- Fix enrich_span with event_id: When event_id is provided, enrich_span
  now calls PUT /events API to update that specific event
- Add retry logic to export() for transient errors (502, 503, 504)
- Add comprehensive unit tests and integration tests for all fixes

Bumps version to 1.0.0rc15
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Jan 28, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Comment thread src/honeyhive/tracer/core/context.py Outdated
config=config,
error=error,
event_id=event_id,
event_id=None, # Don't set event_id on span when enriching current span
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm we still want this old behavior where a customer would be allowed to override the default event id on the event, it's a different use-case that enriching an existing event, suggest a new variable name & keep the old behavior along side the new

…te override)

- event_id: Calls PUT /events API to update an existing event
- update_event_id: Sets honeyhive_event_id span attribute to override
  the default event ID on the trace

This keeps both use cases available as requested in PR review.
@github-actions
Copy link
Copy Markdown
Contributor

📚 Documentation Preview Built

Documentation preview is ready!

📦 Download Preview

Download documentation artifact

🔍 How to Review

  1. Download the artifact from the link above
  2. Extract the files
  3. Open index.html in your browser

✅ Validation Status

  • API validation: ✅ Passed
  • Build process: ✅ Successful
  • Import tests: ✅ All imports working

Preview generated for PR #195

@github-actions
Copy link
Copy Markdown
Contributor

📚 Documentation Preview Built

Documentation preview is ready!

📦 Download Preview

Download documentation artifact

🔍 How to Review

  1. Download the artifact from the link above
  2. Extract the files
  3. Open index.html in your browser

✅ Validation Status

  • API validation: ✅ Passed
  • Build process: ✅ Successful
  • Import tests: ✅ All imports working

Preview generated for PR #195

@dhruv-hhai dhruv-hhai merged commit 2a7b1f3 into complete-refactor Jan 28, 2026
15 checks passed
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.

2 participants