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

OpenTelemetry Collector: Add tests and support version latest #299

Merged
merged 3 commits into from
Dec 5, 2024

Conversation

pieterlexis-tomtom
Copy link
Contributor

This PR adds several features to the OpenTelemetry Collector role.

The first thing is support for otel_collector_version: latest, that will automatically determine the latest version and install it.
The second feature is that the role will no longer download or replace the binary if the otel_collector_version is already installed, this also solves some idempotency issues with the role

To finish off, As there weren't any, I've added several Molecule scenarios and tests for this role.

  • feat(otelcol): Support version: latest
  • ci(otelcol): Add molecule tests

This change also checks if the version currently installed matches the
requested version.
@pieterlexis-tomtom pieterlexis-tomtom force-pushed the otelcol-support-latest branch 3 times, most recently from 712c5ba to 759f477 Compare December 5, 2024 13:34
@pieterlexis-tomtom
Copy link
Contributor Author

The CI failures in 'sanity' and integration seem to be unrelated to my changes. The 'Latest' check fails because of an issue with the upstream repository. The latest release is determined as

ok: [almalinux-9] => {"ansible_facts": {"otel_collector_version": "0.115.1"}, "attempts": 1, "changed": false}

And that one is downloaded + installed:

changed: [almalinux-9] => {"changed": true, "checksum_dest": null, "checksum_src": "cf68b9a1bc217c1b507e4b13688bff2fdbd4225e", "dest": "/tmp/otelcol-contrib-0.115.1.tar.gz", "elapsed": 36, "gid": 0, "group": "root", "md5sum": "642220d90faf3af914806bf1014b0c75", "mode": "0755", "msg": "OK (73825543 bytes)", "owner": "root", "size": 73825543, "src": "/root/.ansible/tmp/ansible-tmp-1733406149.7028937-1716695-196129702525888/tmptheug6qa", "state": "file", "status_code": 200, "uid": 0, "url": "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.115.1/otelcol-contrib_0.115.1_linux_amd64.tar.gz"}

However, the binary itself identifies itself as 0.115.0:

ok: [almalinux-9] => {"changed": false, "cmd": ["/etc/otel-collector/otelcol-contrib", "-v"], "delta": "0:00:00.091767", "end": "2024-12-05 13:43:34.802920", "failed_when_result": false, "msg": "", "rc": 0, "start": "2024-12-05 13:43:34.711153", "stderr": "", "stderr_lines": [], "stdout": "otelcol-contrib version 0.115.0", "stdout_lines": ["otelcol-contrib version 0.115.0"]}

See this issue.

@ishanjainn ishanjainn merged commit de4f1e4 into grafana:main Dec 5, 2024
17 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants