Git Product home page Git Product logo

Comments (2)

linear avatar linear commented on June 2, 2024

HIG-4660 support custom retention for logs / traces

from highlight.

greptile-apps avatar greptile-apps commented on June 2, 2024

To support custom retention for logs and traces, adjust the TTL settings in the ClickHouse table creation scripts to be based on a column value. This will allow row-level retention. Additionally, support row-level retention for sessions and errors by deleting data from ClickHouse for those records.

  1. Logs Table (/backend/clickhouse/migrations/000007_drop_logs_old.down.sql):

    TTL toDateTime(Timestamp) + INTERVAL LogRetentionDays DAY
  2. Traces Table (/backend/clickhouse/migrations/000041_create_traces_table_new.up.sql):

    TTL toDateTime(Timestamp) + INTERVAL TraceRetentionDays DAY
  3. Sessions and Errors: Implement row-level deletion logic based on custom retention settings for sessions and errors in the respective tables.

References

/backend/clickhouse/migrations/000007_drop_logs_old.down.sql
/backend/clickhouse/migrations/000041_create_traces_table_new.up.sql
/backend/clickhouse/migrations/000024_create_logs_sampling_table.up.sql
/backend/clickhouse/migrations/000045_create_trace_attributes.up.sql
/backend/clickhouse/migrations/000026_create_log_attributes.up.sql
/backend/clickhouse/migrations/000083_create_new_traces_by_id_mv.up.sql
/backend/clickhouse/migrations/000047_create_trace_keys.up.sql
/backend/clickhouse/migrations/000043_create_traces_sampling_table.up.sql
/backend/clickhouse/migrations/000058_create_trace_metrics_mv.up.sql
/backend/clickhouse/migrations/000059_create_traces_by_id_mv.up.sql

Ask Greptile

from highlight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.