Skip to content

Comments

Draft: Unique DB Instance Identifier SQLServer receiver#46238

Draft
akshays-19 wants to merge 2 commits intoopen-telemetry:mainfrom
akshays-19:main
Draft

Draft: Unique DB Instance Identifier SQLServer receiver#46238
akshays-19 wants to merge 2 commits intoopen-telemetry:mainfrom
akshays-19:main

Conversation

@akshays-19
Copy link
Contributor

This enhancement adds a resource_attributes_override configuration option that allows users to overrideany resource attribute. Particularly for setting service.instance.id, service.name, and service.namespace to uniquely identify database instances across environments

Fixes #46176

@akshays-19 akshays-19 requested review from a team and crobert-1 as code owners February 20, 2026 17:23
@github-actions github-actions bot added receiver/sqlserver Run Windows Enable running windows test on a PR labels Feb 20, 2026
@github-actions github-actions bot requested a review from sincejune February 20, 2026 17:23
@akshays-19 akshays-19 marked this pull request as draft February 20, 2026 17:23

// applyResourceOverrides applies user-defined resource attribute overrides to the ResourceBuilder
func (s *sqlServerScraperHelper) applyResourceOverrides(rb *metadata.ResourceBuilder) {
for key, value := range s.config.ResourceAttributesOverride {
Copy link
Member

@XSAM XSAM Feb 20, 2026

Choose a reason for hiding this comment

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

Could we make it as a general feature, and don't limit the key list?

Maybe change this part to make sure this override won't be overrided by other logic?

s.mb.EmitForResource(metadata.WithResource(rb.Emit()))

Copy link
Member

@XSAM XSAM left a comment

Choose a reason for hiding this comment

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

Could you add tests for metrics and logs to verify the override logic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

receiver/sqlserver Run Windows Enable running windows test on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding and defaulting service.* attributes as resource attributes

3 participants