Skip to content

Commit

Permalink
feat: Use configurable supervisor logging (#1908)
Browse files Browse the repository at this point in the history
update install scripts with supervisor logging
  • Loading branch information
dpaasman00 authored Nov 4, 2024
1 parent cd611eb commit 694741f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/install/install_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,16 @@ create_supervisor_config() {
command printf ' accepts_remote_config: true\n' >>"$supervisor_yml_path"
command printf ' reports_remote_config: true\n' >>"$supervisor_yml_path"
command printf 'agent:\n' >>"$supervisor_yml_path"
# TODO(dakota): Add logging config option when supervisor suppports it
command printf ' executable: "%s"\n' "$INSTALL_DIR/observiq-otel-collector" >>"$supervisor_yml_path"
command printf ' description:\n' >>"$supervisor_yml_path"
command printf ' non_identifying_attributes:\n' >>"$supervisor_yml_path"
[ -n "$OPAMP_LABELS" ] && command printf ' service.labels: "%s"\n' "$OPAMP_LABELS" >>"$supervisor_yml_path"
command printf 'storage:\n' >>"$supervisor_yml_path"
command printf ' directory: "%s"\n' "$INSTALL_DIR/supervisor_storage" >>"$supervisor_yml_path"
command printf 'telemetry:\n' >>"$supervisor_yml_path"
command printf ' logs:\n' >>"$supervisor_yml_path"
command printf ' level: 0\n' >>"$supervisor_yml_path"
command printf ' output_paths: ["%s"]' "$INSTALL_DIR/supervisor_storage/supervisor.log" >>"$supervisor_yml_path"
succeeded
}

Expand Down
4 changes: 4 additions & 0 deletions scripts/install/install_unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,10 @@ create_supervisor_config() {
[ -n "$OPAMP_LABELS" ] && command printf ' service.labels: "%s"\n' "$OPAMP_LABELS" >>"$supervisor_yml_path"
command printf 'storage:\n' >>"$supervisor_yml_path"
command printf ' directory: "%s"\n' "$INSTALL_DIR/supervisor_storage" >>"$supervisor_yml_path"
command printf 'telemetry:\n' >>"$supervisor_yml_path"
command printf ' logs:\n' >>"$supervisor_yml_path"
command printf ' level: 0\n' >>"$supervisor_yml_path"
command printf ' output_paths: ["%s"]' "$INSTALL_DIR/supervisor_storage/supervisor.log" >>"$supervisor_yml_path"
}

# This will display the results of an installation
Expand Down
10 changes: 10 additions & 0 deletions windows/install/generate-supervisor-yaml.bat
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ set "serviceLabelsField= service.labels: "%labels%""
set "storageField=storage:"
set "directoryField= directory: '%install_dir%supervisor_storage'"

set "telemetryField=telemetry:"
set "logsField= logs:"
set "logsLevelField= level: 0"
set "logsOutputPathsField= output_paths: ['%install_dir%supervisor_storage\supervisor.log']"

echo %serverField% >"%supervisorFile%"
echo %endpointField% >>"%supervisorFile%"
echo %headersField% >>"%supervisorFile%"
Expand All @@ -68,4 +73,9 @@ echo %serviceLabelsField% >>"%supervisorFile%"
echo %storageField% >>"%supervisorFile%"
echo %directoryField% >>"%supervisorFile%"

echo %telemetryField% >>"%supervisorFile%"
echo %logsField% >>"%supervisorFile%"
echo %logsLevelField% >>"%supervisorFile%"
echo %logsOutputPathsField% >>"%supervisorFile%"

endlocal

0 comments on commit 694741f

Please sign in to comment.