Add recording

* Always output awx logs to a file via otel
* That log file can always be later replayed into a product that
  supports otlp at a later date.
* Useful when you find a problem that you need a time series DB to help
  find and solve.
* Useful if a community member or customer has a problem where a time
  series db would be helpful. You can take a "remote" users log and
  replay it locally for analysis.
This commit is contained in:
Chris Meyers 2024-05-20 15:47:23 -04:00 committed by Chris Meyers
parent da46a29f40
commit cae42653bf
5 changed files with 45 additions and 7 deletions

29
licenses/pyzstd.txt Normal file
View File

@ -0,0 +1,29 @@
BSD 3-Clause License
Copyright (c) 2020-present, Ma Lin
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -55,6 +55,7 @@ python-dsv-sdk>=1.0.4
python-tss-sdk>=1.2.1
python-ldap
pyyaml>=6.0.1
pyzstd
receptorctl
social-auth-core[openidconnect]==4.4.2 # see UPGRADE BLOCKERs
social-auth-app-django==5.4.0 # see UPGRADE BLOCKERs

View File

@ -446,6 +446,8 @@ pyyaml==6.0.1
# djangorestframework-yaml
# kubernetes
# receptorctl
pyzstd==0.15.10
# via -r /awx_devel/requirements/requirements.in
receptorctl==1.4.4
# via -r /awx_devel/requirements/requirements.in
redis==5.0.1

View File

@ -283,8 +283,7 @@ services:
- "55679:55679" # zpages http://localhost:55679/debug/servicez /tracez
volumes:
- "../../otel/otel-collector-config.yaml:/etc/otel-collector-config.yaml"
depends_on:
- loki
- "../../otel/awx-logs:/awx-logs/"
{% endif %}
{% if enable_loki|bool %}
loki:
@ -298,11 +297,7 @@ services:
- awx
volumes:
- "loki_storage:/loki:rw"
#- "../../docker-compose/loki/volumes/index:/loki/index"
#- "../../docker-compose/loki/volumes/boltdb-cache:/loki/boltdb-cache"
- "../../loki/local-config.yaml:/etc/loki/local-config.yaml"
depends_on:
- grafana
{% endif %}
{% if execution_node_count|int > 0 %}

View File

@ -2,11 +2,22 @@ receivers:
otlp:
protocols:
grpc:
http:
exporters:
debug:
verbosity: detailed
file:
path: /awx-logs/awx-logs.json.zstd
rotation:
max_days: 14
localtime: false
max_megabytes: 300
max_backups: 200
format: json
compression: zstd
loki:
endpoint: http://loki:3100/loki/api/v1/push
tls:
@ -32,7 +43,7 @@ service:
logs:
receivers: [otlp]
processors: [batch]
exporters: [loki]
exporters: [file, loki]
extensions:
- health_check