Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let users know data is sampled #8546

Open
ccschmitz opened this issue May 13, 2024 — with Linear · 2 comments
Open

Let users know data is sampled #8546

ccschmitz opened this issue May 13, 2024 — with Linear · 2 comments
Assignees
Labels
blocked:design Blocked until we complete some design work

Comments

Copy link
Contributor

In some instances we hit the sampling tables for logs and traces. This can result in some discrepancies between what we show in the UI and what we have in our DB. We also have some issues where the stats we show for totals don't match the count of results. We want to show some UI explaining that the counts might be off a little.

We would also like to update our fetching logic to hit the main table if the sampling table doesn't return any results.

@ccschmitz ccschmitz self-assigned this May 13, 2024
Copy link

linear bot commented May 13, 2024

Copy link

greptile-apps bot commented May 13, 2024

To address the issue of data sampling discrepancies, follow these steps:

  1. Backend (logs.go): Modify the ReadLogs and ReadLogsHistogram functions to check the main logs table if the sampling table returns no results. Implement a fallback mechanism within these functions.

    Example change for ReadLogs:

    if len(results) == 0 {
        // Fallback to main logs table
        // Re-run the query against LogsTableConfig instead of logsSamplingTableConfig
    }
  2. Frontend (TraceLogs.tsx): Add a UI element (e.g., a banner or tooltip) to inform users about potential count discrepancies due to data sampling. This could be conditionally rendered based on a flag set by the backend indicating whether sampling data was used.

    Example UI update:

    {isSampled && <Alert message="Data is sampled and counts may not accurately reflect total records." type="warning" />}
  3. Documentation/Comments: Update code comments and documentation to clearly explain the logic for handling sampled data and the potential for discrepancies in counts. This will help maintain clarity for future development and debugging.

References

/backend/clickhouse/logs.go
/frontend/src/pages/Traces/TraceLogs.tsx
/backend/clickhouse/migrations/000024_create_logs_sampling_table.up.sql
/backend/clickhouse/migrations/000043_create_traces_sampling_table.up.sql
/docs-content/general/6_product-features/1_session-replay/filtering-sessions.md
/docs-content/general/6_product-features/2_error-monitoring/filtering-errors.md

Ask Greptile

@ccschmitz ccschmitz added the blocked:design Blocked until we complete some design work label May 14, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked:design Blocked until we complete some design work
Projects
None yet
Development

No branches or pull requests

1 participant