Configure the automatic purge
A significant amount of data is persisted, on disk or in HPA database, by various operations:
- Hotspot methods metrics
- Risk Analysis & Job data
- Traces from Context Tracer.
- Calypso configuration export
- Database extraction
This data is automatically deleted once it becomes too old.
The retention period of each operation is configured, in days, in <hpa_base_dir>/hpa/modules/hpa-extractor-X.XX/config/application.yml file.
hpa:
dumplive:
maxDataAgeInDay: 90 # Hotspot methods metrics
maxDataAgeInDayOracle: 90 # Custom Oracle metrics
maxDataAgeInDayRisk: 90 # Risk Analysis & Job data
traces:
maxDataAgeInDay: 90 # Traces
configExport:
maxDataAgeInDay: 370 # Calypso configuration Export
dbExtractor:
maxDataAgeInDay: 370 # Database extracts
The retention period of Data collection session data (logs, memory dumps, etc.) is configured in <hpa_base_dir>/hpa/modules/introscope/config/application-hpa-extension.yml file, which is overwritten with each redeployment:
hpa:
dumpSession.maxDataAgeInDay: 90
Manually clean the Context Tracer data
If the database-hpa (located in var/database-hpa) consumes a lot of disk space, it’s probably due to the amount of traces
recording by the Context Tracer.
Purge manually the context tracer
- Connect on HPA server and execute the following :
cd {{hpa_base_dir}}/hpa
./modules/postgresql/bin/psql -p 5555 -h 127.0.0.1 -U hpa_user -d hpadb
-
Enter the password for the HPA database
-
Execute the following SQL commands :
truncate trace, trace_key_value, trace_metric, trace_metric_rel, trace_stacktrace, trace_stacktrace_rel;
Export tables before purge
If needed, you can export the tables :
cd {{hpa_base_dir}}/hpa
./modules/postgresql/bin/pg_dump -p 5555 -h 127.0.0.1 -U hpa_user -d hpadb -c -t trace -t trace_key_value -t trace_metric -t trace_metric_rel -t trace_stacktrace -t trace_stacktrace_rel > hpa_export.sql