-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[receiver/sqlserver] Add service.instance.id
resource attribute
#42299
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
atoulme
merged 16 commits into
open-telemetry:main
from
XSAM:feature/41894-sqlserver-service-instance-id
Sep 3, 2025
Merged
[receiver/sqlserver] Add service.instance.id
resource attribute
#42299
atoulme
merged 16 commits into
open-telemetry:main
from
XSAM:feature/41894-sqlserver-service-instance-id
Sep 3, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adds service.instance.id to all metrics and logs emitted by the SQL Server receiver. Format: <host>:<port> where port defaults to 1433. Special handling for localhost/127.0.0.1 which are replaced with os.Hostname(). The service instance ID is computed once during scraper initialization from: 1. DataSource (if provided) - parsed to extract server and port 2. Server/Port config (if provided) 3. os.Hostname():1433 (fallback) Fixes open-telemetry#41894
- Replace manual regex-based parsing with msdsn.Parse() from github.com/microsoft/go-mssqldb - Simplify parseDataSource() function significantly - Update tests to align with msdsn library behavior - Add isLocalhost() helper function for clarity - Merge metrics and logs tests in TestScraperWithServiceInstanceID using subtests The go-mssqldb library provides more robust and accurate parsing of SQL Server connection strings, handling various formats automatically.
service.instance.id
resource attribute
The failed e2e-tests-windows seems unrelated to this PR. |
crobert-1
reviewed
Aug 29, 2025
sv-splunk
reviewed
Sep 1, 2025
Co-authored-by: Curtis Robert <[email protected]>
crobert-1
approved these changes
Sep 2, 2025
atoulme
approved these changes
Sep 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds
service.instance.id
resource attribute to all metrics and logs emitted by the SQL Server receiver. The attribute format is<host>:<port>
which provides a unique identifier for each SQL Server instance.Key implementation details:
Link to tracking issue
Fixes #41894
Testing
Documentation