发布

  • [OPIK-6305] [BE] fix: fix user attribution and demo filtering for agent config BI events (#6550)

    frostbyte_neo 发布于 2026-04-30 15:04:59 +00:00

    • [OPIK-6305] [BE] fix: fix user attribution, identity, and demo filtering for agent config BI events
    • Pass captured userName as explicit identity to trackEvent so events are attributed to the real user
      instead of the anonymous installation ID (fixes broken request-scope access on Reactor threads)
    • Skip emission when the project name is a known demo project (DemoData.PROJECTS check)
    • Resolve project name from ProjectService for createOrUpdateEnvs and setEnvByBlueprintName,
      which only have projectId in scope

    Implements OPIK-6305: opik_agent_config BI events: missing properties, user attribution, and demo data filtering

    Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

    • add tests

    • fix project resolution

    • rework test

    • refactor(agent-config): eliminate redundant project DB lookups in analytics doOnNext

    Resolved project once per operation (carrying the full Project object through
    the reactive chain) instead of calling projectService.get() again inside
    doOnNext. Added explicit publishOn(boundedElastic) before each doOnNext so
    the scheduler dependency is explicit and won't silently break if upstream
    changes.

    Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

    • add redis stop

    • fix test

    • PR requested changes

    • move BI tests alongside the agent config ones


    Co-authored-by: Claude Sonnet 4.6 noreply@anthropic.com

    下载附件