Skip to content

Support unnamed groups in carbon receiver regex parser #39137

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

Conversation

grihabor
Copy link
Contributor

@grihabor grihabor commented Apr 3, 2025

Description

Adding a feature - support for unnamed groups in carbon receiver regex parser. This makes it possible to parse a wider range of metrics, e.g. optional metric prefix or optional metric tags.

Testing

Added a test for a rule with an optional prefix: "(prefix\.)?..."

Added a test for a rule with an optional metric label: "(job=(?P<key_job>[^.]+)\.)?..."

Documentation

Added an example with an optional prefix and an optional metric label

@grihabor grihabor requested a review from a team as a code owner April 3, 2025 11:56
@grihabor grihabor requested a review from codeboten April 3, 2025 11:56
Copy link

linux-foundation-easycla bot commented Apr 3, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@atoulme
Copy link
Contributor

atoulme commented Apr 4, 2025

Please add a changelog.

@grihabor
Copy link
Contributor Author

grihabor commented Apr 4, 2025

@atoulme like this? bf5f895

@grihabor
Copy link
Contributor Author

grihabor commented Apr 5, 2025

Looks like flaky tests

    integration_test.go:112: 
        	Error Trace:	/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/exporter/datadogexporter/integrationtest/integration_test.go:112
        	            				/opt/hostedtoolcache/go/1.23.8/arm64/src/runtime/asm_arm64.s:1223
        	Error:      	Received unexpected error:
        	            	cannot start pipelines: failed to start "otlp" receiver: listen tcp 127.0.0.1:43569: bind: address already in use
        	Test:       	TestIntegration_NativeOTelAPMStatsIngest

@edmocosta
Copy link
Contributor

Looks like flaky tests

Hi @grihabor, I think updating the branch should fix that.
There are also other tests failing that seems to be related to this PR changes, for example https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/14276381165/job/40028839302?pr=39137.

@atoulme atoulme marked this pull request as draft April 19, 2025 06:14
@atoulme
Copy link
Contributor

atoulme commented Apr 19, 2025

Moving to draft while you review and attend to the CI, please mark ready to review once CI passes.

@grihabor grihabor force-pushed the support-unnamed-groups-in-carbon-receiver-regex-parser branch from 91b31d8 to 970b5af Compare April 25, 2025 19:44
@grihabor
Copy link
Contributor Author

Thank you for your review! I've fixed the test, but the pipeline doesn't seem to start. The checks are now passing locally:

$ make lint test
Check License finished successfully
running /home/grihabor/projects/opentelemetry-collector-contrib/.tools/misspell -error
/home/grihabor/projects/opentelemetry-collector-contrib/.tools/golangci-lint run
WARN [runner/exclusion_paths] The pattern "third_party" match no issues 
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Text: "cachedBytes", Path: "pagefile.go", Linters: "unused"] 
WARN [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "third_party", Linters: "gci, gofumpt"] 
cd /home/grihabor/projects/opentelemetry-collector-contrib/internal/tools && GOOS="" GOARCH="" go build -o /home/grihabor/projects/opentelemetry-collector-contrib/.tools/gotestsum -trimpath gotest.tools/gotestsum
/home/grihabor/projects/opentelemetry-collector-contrib/.tools/gotestsum --rerun-fails=1 --packages="./..." -- -race -timeout 600s -parallel 4 --tags=""
∅  internal/client
∅  internal/metadata
✓  internal/transport (cached)
✓  . (cached)
✓  protocol (1.014s)

DONE 69 tests in 1.557s

Marking "Ready for review"

@grihabor grihabor marked this pull request as ready for review April 25, 2025 19:48
@grihabor
Copy link
Contributor Author

PS Checks pass now

@atoulme atoulme merged commit f299346 into open-telemetry:main May 2, 2025
181 checks passed
@github-actions github-actions bot added this to the next release milestone May 2, 2025
@grihabor
Copy link
Contributor Author

grihabor commented May 6, 2025

Thank you!

@grihabor grihabor deleted the support-unnamed-groups-in-carbon-receiver-regex-parser branch May 6, 2025 10:08
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this pull request May 6, 2025
…y#39137)

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

Adding a feature - support for unnamed groups in carbon receiver regex
parser. This makes it possible to parse a wider range of metrics, e.g.
optional metric prefix or optional metric tags.

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

Added a test for a rule with an optional prefix: `"(prefix\.)?..."`

Added a test for a rule with an optional metric label:
`"(job=(?P<key_job>[^.]+)\.)?..."`

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

Added an example with an optional prefix and an optional metric label
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this pull request May 20, 2025
…y#39137)

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

Adding a feature - support for unnamed groups in carbon receiver regex
parser. This makes it possible to parse a wider range of metrics, e.g.
optional metric prefix or optional metric tags.

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

Added a test for a rule with an optional prefix: `"(prefix\.)?..."`

Added a test for a rule with an optional metric label:
`"(job=(?P<key_job>[^.]+)\.)?..."`

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

Added an example with an optional prefix and an optional metric label
dragonlord93 pushed a commit to dragonlord93/opentelemetry-collector-contrib that referenced this pull request May 23, 2025
…y#39137)

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

Adding a feature - support for unnamed groups in carbon receiver regex
parser. This makes it possible to parse a wider range of metrics, e.g.
optional metric prefix or optional metric tags.

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

Added a test for a rule with an optional prefix: `"(prefix\.)?..."`

Added a test for a rule with an optional metric label:
`"(job=(?P<key_job>[^.]+)\.)?..."`

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

Added an example with an optional prefix and an optional metric label
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.

4 participants