Skip to content

[receiver/sqlserver] fix parsing error on collecting metrics #38823

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

Merged
merged 9 commits into from
Mar 21, 2025

Conversation

cuichenli
Copy link
Contributor

we are seeing error when parsing value with sqlserver receiver. this pr fixes it and add more descriptive error message.

2025-03-20T10:23:51.127Z        error   [email protected]/obs_metrics.go:61  Error scraping metrics  {"otelcol.component.id": "sqlserver", "otelcol.component.kind": "Receiver", "otelcol.signal": "metrics", "error": "row 1: strconv.ParseInt: parsing "1.8256656e+07": invalid syntax"}

@cuichenli cuichenli requested a review from a team as a code owner March 20, 2025 10:24
Copy link

linux-foundation-easycla bot commented Mar 20, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@sincejune
Copy link
Contributor

cc @crobert-1 @samiura

@crobert-1
Copy link
Member

Thanks for the fix here, @cuichenli! Can you please add a changelog entry, marking this as a bug fix?

@crobert-1 crobert-1 changed the title [chore][receiver/sqlserver] fix parsing error on collecting metrics [receiver/sqlserver] fix parsing error on collecting metrics Mar 20, 2025
@crobert-1
Copy link
Member

Also, can we add a test here that would have failed before the bug fix? It would be good to ensure this works as intended, and doesn't break in the future.

@atoulme atoulme marked this pull request as draft March 20, 2025 22:18
@cuichenli cuichenli marked this pull request as ready for review March 21, 2025 01:20
@cuichenli
Copy link
Contributor Author

@crobert-1 thanks for your comment. i have updated the unit test to reflect the float parsing and added one change log. please take a look.

@atoulme atoulme merged commit ec86282 into open-telemetry:main Mar 21, 2025
171 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 21, 2025
Fiery-Fenix pushed a commit to Fiery-Fenix/opentelemetry-collector-contrib that referenced this pull request Apr 24, 2025
…lemetry#38823)

we are seeing error when parsing value with sqlserver receiver. this pr
fixes it and add more descriptive error message.
```
2025-03-20T10:23:51.127Z        error   [email protected]/obs_metrics.go:61  Error scraping metrics  {"otelcol.component.id": "sqlserver", "otelcol.component.kind": "Receiver", "otelcol.signal": "metrics", "error": "row 1: strconv.ParseInt: parsing "1.8256656e+07": invalid syntax"}
```

---------

Co-authored-by: Antoine Toulme <[email protected]>
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.

6 participants