Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upload of installation script logs #1312

Closed
wants to merge 13 commits into from

Conversation

ccressent
Copy link
Contributor

@ccressent ccressent commented Oct 27, 2023

As part of OSC-174 and to close SUMO-227556, we need to collect the installation script's actions and send that log to Sumologic for further processing.

This PR is the piece that makes the installation script log everything it does into a file and send that file to a Sumo endpoint whenever and for whatever reason the installation script exits.

Note that the log collection endpoint is still set to its staging version while we wait for the production version to be deployed.
Example log data gathered during a CI run

@ccressent ccressent self-assigned this Oct 27, 2023
@ccressent
Copy link
Contributor Author

I'm just realizing: this probably needs a PowerShell equivalent for Windows installations...

@ccressent ccressent marked this pull request as ready for review January 19, 2024 21:13
@ccressent ccressent requested a review from a team as a code owner January 19, 2024 21:13
scripts/install.sh Outdated Show resolved Hide resolved
Add --disable-installation-telemetry for Linux
Add -DisableInstallationTelemetry for Windows

Signed-off-by: Cyril Cressent <ccressent@sumologic.com>
Signed-off-by: Cyril Cressent <ccressent@sumologic.com>
Add --installation-logfile-endpoint on Linux
Add -InstallationLogfileEndpoint on Windows

Signed-off-by: Cyril Cressent <ccressent@sumologic.com>
@@ -170,6 +181,14 @@ Supported env variables:
EOF
}

function reporter {
if ! $DISABLE_INSTALLATION_TELEMETRY; then
echo "SUMOLOGIC_INSTALLATION_TOKEN=${SUMOLOGIC_INSTALLATION_TOKEN}" >> $INSTALLATION_LOGFILE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use some hash to not store token directly inside the file and send it as source header? Right now we are going to get one line with the token and then multiple lines which will be hard to say which installation token are related

https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/logs-metrics/upload-logs/#supported-http-headers

I think X-Sumo-Name would be the best choice 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure if X-Sumo-Name is the best choice; what about using X-Sumo-Fields instead with a value of installation-token-sha256=<value>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whether I use X-Sumo-Name or X-Sumo-Fields for the headers I send to the endpoint I was provided with, that data doesn't seem to make it into Sumo.

I had to remove compression already because it turned out the Content-Type header is not supported by the endpoint. I wonder if whatever they put in place just ignores headers. I'll get in touch with the team in charge of that endpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The team has confirmed that those headers are not supported; it's still unclear to me whether or not they'll work on supporting them.

Can you see a different way to accomplish the same idea?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the endpoint treats all the data like multiline log I think it's fine, Otherwise I would put hash on the beginning of every line, so we do not loose the context

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hosted collector (otel-installation-logs-collector) is setup with multilineProcessingEnabled: true, so I think it's fine indeed.

@ccressent
Copy link
Contributor Author

I suggest we go with what we have so that we can start collecting and analyzing data. We can then alter what we collect as needed.

@swiatekm
Copy link

@ccressent I've moved the install scripts to https://github.com/SumoLogic/sumologic-otel-collector-packaging/tree/main/install-script and we're planning to remove them from this repo in #1536. Can you recreate this PR in packaging?

@ccressent
Copy link
Contributor Author

Closing in favour of SumoLogic/sumologic-otel-collector-packaging#64

@ccressent ccressent closed this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants