Skip to content

[receiver/sqlserver] Metrics emitted with incorrect resource attributes #35036

Closed
@crobert-1

Description

@crobert-1

Component(s)

receiver/sqlserver

Describe the issue you're reporting

The bug is here:

Essentially what's happening is the receiver sets the resource attributes based on the first row, and all following rows are given the same resource attributes. However, this is a bug as the database_name, a resource attribute, changes for different rows. The result is that all of the metrics are simply considered to be a part of the first database name, rather than their correct value.

There could be two main ways to fix this:

  1. Emit the given resource on each row. This will be the least impactful option, but results in multiple resource metrics having the same resource attributes.
  2. Create an in-memory data structure to represent the resource attributes, and deduplicate when going row-by-row. The logic would be considerably more complicated, but it would result in a single resource metric for a set of resource attributes.

My general preference would be to go with option number 1 as it's simpler and less prone to errors, but I'm not sure if this breaks the required format of emitted metrics.

Note: This is a result of #30297, and only relevant for direct connection configurations.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions