canonical / wordpress-k8s-operator

wordpress-k8s-operator - charm repository.
Apache License 2.0
13 stars 7 forks source link

Improve WordPress's observability and increase health check timeout #194

Closed weiiwang01 closed 8 months ago

weiiwang01 commented 9 months ago

Improve WordPress's observability by updating the Apache access log format to a structured format, including the sub-millisecond request times and durations in the access log. Introduce a new metric, apache_access_log_request_duration_microseconds, a histogram tracking request durations. Unlike metrics available through Apache's mod_status, this specific metric is derived from Promtail reading the access log, which means it will only be available when logging integration is established. This approach should offer better performance compared to using logql.

Update the dashboard with a new panel to visualizes request duration percentiles, providing better insights into WordPress performance issues.

Some other miscellaneous changes include adjusting the WordPress health check timeout from 3 to 5 seconds and upgrading WordPress to patch version 6.4.3.

Screenshot 2024-02-28 at 23 51 27
github-actions[bot] commented 8 months ago

Test coverage for 8d18b909ae53a01d7bc89444d5a6eeda36e481c3

Name                Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------
src/charm.py          542     36    184     33    90%   162, 203-206, 370-371, 430->434, 583, 614, 620, 637-641, 671, 706-707, 765, 774, 878->891, 890, 892, 897-898, 958, 976, 983, 1073, 1082, 1094, 1115, 1124, 1143, 1147, 1176, 1229, 1361, 1383, 1390->1392, 1435->exit, 1447, 1463, 1500
src/cos.py             21      0      0      0   100%
src/exceptions.py      17      1      2      1    89%   41
src/state.py           34      0      4      0   100%
src/types_.py          16      0      0      0   100%
---------------------------------------------------------------
TOTAL                 630     37    190     34    91%

Static code analysis report

Run started:2024-03-04 10:48:10.496715

Test results:
    No issues identified.

Code scanned:
    Total lines of code: 4583
    Total lines skipped (#nosec): 1
    Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
    Total issues (by severity):
        Undefined: 0
        Low: 0
        Medium: 0
        High: 0
    Total issues (by confidence):
        Undefined: 0
        Low: 0
        Medium: 0
        High: 0
Files skipped (0):