Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

[upstream-sync] feat(telemetry): add optional application label via env var (upstream #1992) #173

Description

@github-actions

Upstream Change Summary

Type: new-feature
Difficulty: Easy
Recommendation: Adapt

Upstream added a COCOINDEX_APPLICATION_FOR_TRACKING environment variable that, when set to a non-empty value, includes an application field in every telemetry event payload. This lets applications self-identify in aggregate telemetry without changing the default behavior (field is skip_serializing_if = "Option::is_none"). The value is read once at telemetry::init() and stored on TelemetryContext.

Upstream References

Relevant Upstream Files / Areas

  • rust/cocoindex/src/telemetry.rs — adds application: Option<String> to TelemetryContext, reads env var at init(), serializes with skip_serializing_if

Recoco Considerations

  • Affected files: crates/recoco-core/src/telemetry.rs (or equivalent telemetry module)
  • Adaptation: Rename the env var to RECOCO_APPLICATION_FOR_TRACKING to match recoco's naming conventions instead of COCOINDEX_APPLICATION_FOR_TRACKING
  • API: Read once at telemetry::init(), store as Option<String> on the context struct, serialize with skip_serializing_if = "Option::is_none"
  • No Python code to exclude; no feature-gating required

Integration Notes

Isolated, low-risk change (~15–20 lines). Adapt by renaming the env var constant to use the RECOCO_ prefix. The upstream test send_event_includes_application_when_set can be ported directly with the renamed constant. Also add a test for the absent-by-default behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claudeCreated or actioned by Claude AIupstream-syncIssues for syncing updates with our upstream (cocoindex-io/cocoindex)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions