Skip to content

[receiver/sqlserver] Fix host.name attribute with datasource config#46484

Merged
ChrsMark merged 5 commits into
open-telemetry:mainfrom
himanshu130700:fix-sqlserver-hostname-datasource
Mar 5, 2026
Merged

[receiver/sqlserver] Fix host.name attribute with datasource config#46484
ChrsMark merged 5 commits into
open-telemetry:mainfrom
himanshu130700:fix-sqlserver-hostname-datasource

Conversation

@himanshu130700

Copy link
Copy Markdown
Contributor

Fixes #42355

When using the datasource configuration option, the host.name resource attribute is now correctly extracted from the datasource connection string using the existing parseDataSource method.

@himanshu130700 himanshu130700 requested review from a team and crobert-1 as code owners February 27, 2026 10:48
@github-actions github-actions Bot added receiver/sqlserver Run Windows Enable running windows test on a PR labels Feb 27, 2026
@github-actions github-actions Bot requested a review from sincejune February 27, 2026 10:48
Fixes open-telemetry#42355

When using the datasource configuration option, the host.name
resource attribute is now correctly extracted from the datasource
connection string using the existing parseDataSource method.
@himanshu130700 himanshu130700 force-pushed the fix-sqlserver-hostname-datasource branch from 525f41e to a9f0d3e Compare February 27, 2026 12:09
@himanshu130700 himanshu130700 force-pushed the fix-sqlserver-hostname-datasource branch from 0cf961d to 53b0c13 Compare February 27, 2026 13:31

@crobert-1 crobert-1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @himanshu130700!

@cjksplunk

Copy link
Copy Markdown
Contributor

This issue stems from a bug in how MS code parses the datasource string and fails to set the config.Host value under some circumstances, so I have my own pr here that should cover the issue from the MS bug angle.

@himanshu130700

Copy link
Copy Markdown
Contributor Author

Hello @crobert-1, can we please merge the PR

@crobert-1 crobert-1 added the ready to merge Code review completed; ready to merge by maintainers label Mar 4, 2026
@ChrsMark ChrsMark merged commit 32c7fef into open-telemetry:main Mar 5, 2026
279 checks passed
@otelbot

otelbot Bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @himanshu130700! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. If you are getting started contributing, you can also join the CNCF Slack channel #opentelemetry-new-contributors to ask for guidance and get help.

antonio-mazzini pushed a commit to antonio-mazzini/opentelemetry-collector-contrib that referenced this pull request Mar 5, 2026
…pen-telemetry#46484)

Fixes open-telemetry#42355

When using the datasource configuration option, the host.name resource
attribute is now correctly extracted from the datasource connection
string using the existing parseDataSource method.
songy23 pushed a commit that referenced this pull request Mar 10, 2026
…#46740)

#### Description

This unify the resource attribute logic for both logs and metrics. It
also fixes the
#42355
where the PR
#46484
left logs part behind.

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes
#42355
avleentwilio pushed a commit to avleentwilio/opentelemetry-collector-contrib that referenced this pull request Apr 1, 2026
…pen-telemetry#46484)

Fixes open-telemetry#42355

When using the datasource configuration option, the host.name resource
attribute is now correctly extracted from the datasource connection
string using the existing parseDataSource method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Code review completed; ready to merge by maintainers receiver/sqlserver Run Windows Enable running windows test on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/sqlserver] host.name resource attribute is not set properly when using datasource configuration

6 participants