Skip to content

Conversation

@Frapschen
Copy link
Contributor

@Frapschen Frapschen commented Sep 28, 2025

Description

Link to tracking issue

Fixes #42792

Testing

Documentation

Copy link
Member

@lahsivjar lahsivjar left a comment

Choose a reason for hiding this comment

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

LGTM (checked the diff for elasticsearchexporter and signaltometricsconnector)

Copy link
Contributor

@edmocosta edmocosta left a comment

Choose a reason for hiding this comment

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

Thank you for working on this, @Frapschen! I've left a few suggestions.

@Frapschen
Copy link
Contributor Author

@edmocosta Please review

@Frapschen Frapschen requested a review from edmocosta October 15, 2025 03:50
@Frapschen
Copy link
Contributor Author

wire error:

make --no-print-directory -C pkg/pdatatest lint
Check License finished successfully
running /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/.tools/misspell -error
/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/.tools/golangci-lint run
Error: pkg/ottl/ottlfuncs/func_xxh3.go:34:76: xxh3HashString - result 1 (error) is always nil (unparam)
level=warning msg="[runner/exclusion_paths] The pattern \"third_party\" match no issues"
level=warning msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Text: \"cachedBytes\", Path: \"pagefile.go\", Linters: \"unused\"]"
level=warning msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"third_party\", Linters: \"gci, gofumpt\"]"
func xxh3HashString[K any](target ottl.StringGetter[K]) (ottl.ExprFunc[K], error) {
                                                                           ^
make[2]: *** [../../Makefile.Common:282: lint] Error 1
make[1]: *** [Makefile:253: pkg/ottl] Error 2
make[1]: *** Waiting for unfinished jobs....
level=warning msg="[runner/exclusion_paths] The pattern \"third_party\" match no issues"
level=warning msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Text: \"cachedBytes\", Path: \"pagefile.go\", Linters: \"unused\"]"
level=warning msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"third_party\", Linters: \"gci, gofumpt\"]"
make[1]: Leaving directory '/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib'
make: *** [Makefile:213: golint] Error 2

I didn't figure out why the xxh3HashString encountered this error; however, the similar SHA1HashString is ok to pass it.

Frapschen and others added 7 commits October 15, 2025 15:29
@edmocosta
Copy link
Contributor

wire error:

make --no-print-directory -C pkg/pdatatest lint
Check License finished successfully
running /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/.tools/misspell -error
/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/.tools/golangci-lint run
Error: pkg/ottl/ottlfuncs/func_xxh3.go:34:76: xxh3HashString - result 1 (error) is always nil (unparam)
level=warning msg="[runner/exclusion_paths] The pattern \"third_party\" match no issues"
level=warning msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Text: \"cachedBytes\", Path: \"pagefile.go\", Linters: \"unused\"]"
level=warning msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"third_party\", Linters: \"gci, gofumpt\"]"
func xxh3HashString[K any](target ottl.StringGetter[K]) (ottl.ExprFunc[K], error) {
                                                                           ^
make[2]: *** [../../Makefile.Common:282: lint] Error 1
make[1]: *** [Makefile:253: pkg/ottl] Error 2
make[1]: *** Waiting for unfinished jobs....
level=warning msg="[runner/exclusion_paths] The pattern \"third_party\" match no issues"
level=warning msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Text: \"cachedBytes\", Path: \"pagefile.go\", Linters: \"unused\"]"
level=warning msg="[runner/exclusion_rules] Skipped 0 issues by rules: [Path: \"third_party\", Linters: \"gci, gofumpt\"]"
make[1]: Leaving directory '/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib'
make: *** [Makefile:213: golint] Error 2

I didn't figure out why the xxh3HashString encountered this error; however, the similar SHA1HashString is ok to pass it.

Linter is complaining because the function xxh3HashString[K any](target ottl.StringGetter[K]) (ottl.ExprFunc[K], error) is returning ottl.ExprFunc[K] and error, being the second always nil. To fix that, just drop the error returned by that function, and return nil on the createXXH3Function instead.

@Frapschen
Copy link
Contributor Author

@edmocosta Done

@edmocosta edmocosta added the ready to merge Code review completed; ready to merge by maintainers label Oct 16, 2025
@songy23 songy23 merged commit 0573b15 into open-telemetry:main Oct 16, 2025
188 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 16, 2025
@Frapschen Frapschen deleted the add-xxh3-ottl-func branch October 17, 2025 01:56
ChrsMark pushed a commit to ChrsMark/opentelemetry-collector-contrib that referenced this pull request Oct 20, 2025
…st (open-telemetry#43032)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#42792

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Edmo Vamerlatti Costa <11836452+edmocosta@users.noreply.github.com>
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.

ottl - add support for xxHash checksums

6 participants