Skip to content

Commit ff61b38

Browse files
authored
[receiver/sqlserver] add integration test and fix one config bug (#40943)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description add integration test and fix one minor bug that sample query used wrong config <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.-->
1 parent cafe4f7 commit ff61b38

File tree

6 files changed

+440
-4
lines changed

6 files changed

+440
-4
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: sqlserverreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: |
11+
Fix incorrect configuration used in query sample collection. It was intended to retrieve the maximum number of rows per query from config.MaxRowsPerQuery, but it was mistakenly using config.TopQueryCount instead.
12+
13+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
14+
issues: [40943]
15+
16+
# (Optional) One or more lines of additional information to render under the primary note.
17+
# These lines will be padded with 2 spaces and then inserted directly into the document.
18+
# Use pipe (|) for multiline entries.
19+
subtext:
20+
21+
# If your change doesn't affect end users or the exported elements of any package,
22+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
23+
# Optional: The change log or logs in which this entry should be included.
24+
# e.g. '[user]' or '[user, api]'
25+
# Include 'user' if the change is relevant to end users.
26+
# Include 'api' if there is a change to a library API.
27+
# Default: '[user]'
28+
change_logs: [user]

receiver/sqlserverreceiver/go.mod

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ require (
1313
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.129.0
1414
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/winperfcounters v0.129.0
1515
github.com/stretchr/testify v1.10.0
16+
github.com/testcontainers/testcontainers-go v0.37.0
1617
go.opentelemetry.io/collector/component v1.35.1-0.20250630174123-18b3b578b0b3
1718
go.opentelemetry.io/collector/component/componenttest v0.129.1-0.20250630174123-18b3b578b0b3
1819
go.opentelemetry.io/collector/config/configopaque v1.35.1-0.20250630174123-18b3b578b0b3
@@ -36,14 +37,27 @@ require (
3637
)
3738

3839
require (
40+
dario.cat/mergo v1.0.1 // indirect
41+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
3942
github.com/DataDog/datadog-go/v5 v5.6.0 // indirect
4043
github.com/DataDog/go-sqllexer v0.1.6 // indirect
4144
github.com/Microsoft/go-winio v0.6.2 // indirect
45+
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
4246
github.com/cespare/xxhash/v2 v2.3.0 // indirect
47+
github.com/containerd/log v0.1.0 // indirect
48+
github.com/containerd/platforms v0.2.1 // indirect
49+
github.com/cpuguy83/dockercfg v0.3.2 // indirect
4350
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
51+
github.com/distribution/reference v0.6.0 // indirect
52+
github.com/docker/docker v28.0.1+incompatible // indirect
53+
github.com/docker/go-connections v0.5.0 // indirect
54+
github.com/docker/go-units v0.5.0 // indirect
4455
github.com/dustin/go-humanize v1.0.1 // indirect
56+
github.com/ebitengine/purego v0.8.4 // indirect
57+
github.com/felixge/httpsnoop v1.0.4 // indirect
4558
github.com/go-logr/logr v1.4.3 // indirect
4659
github.com/go-logr/stdr v1.2.2 // indirect
60+
github.com/go-ole/go-ole v1.2.6 // indirect
4761
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
4862
github.com/gobwas/glob v0.2.3 // indirect
4963
github.com/gogo/protobuf v1.3.2 // indirect
@@ -59,18 +73,36 @@ require (
5973
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
6074
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
6175
github.com/json-iterator/go v1.1.12 // indirect
76+
github.com/klauspost/compress v1.17.9 // indirect
6277
github.com/knadh/koanf/maps v0.1.2 // indirect
6378
github.com/knadh/koanf/providers/confmap v1.0.0 // indirect
6479
github.com/knadh/koanf/v2 v2.2.1 // indirect
80+
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
81+
github.com/magiconair/properties v1.8.10 // indirect
6582
github.com/mitchellh/copystructure v1.2.0 // indirect
6683
github.com/mitchellh/reflectwalk v1.0.2 // indirect
84+
github.com/moby/docker-image-spec v1.3.1 // indirect
85+
github.com/moby/patternmatcher v0.6.0 // indirect
86+
github.com/moby/sys/sequential v0.5.0 // indirect
87+
github.com/moby/sys/user v0.1.0 // indirect
88+
github.com/moby/sys/userns v0.1.0 // indirect
89+
github.com/moby/term v0.5.0 // indirect
6790
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6891
github.com/modern-go/reflect2 v1.0.2 // indirect
92+
github.com/morikuni/aec v1.0.0 // indirect
6993
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.129.0 // indirect
94+
github.com/opencontainers/go-digest v1.0.0 // indirect
95+
github.com/opencontainers/image-spec v1.1.1 // indirect
7096
github.com/outcaste-io/ristretto v0.2.3 // indirect
7197
github.com/pkg/errors v0.9.1 // indirect
7298
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
99+
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
100+
github.com/shirou/gopsutil/v4 v4.25.1 // indirect
101+
github.com/sirupsen/logrus v1.9.3 // indirect
73102
github.com/stretchr/objx v0.5.2 // indirect
103+
github.com/tklauser/go-sysconf v0.3.12 // indirect
104+
github.com/tklauser/numcpus v0.6.1 // indirect
105+
github.com/yusufpapurcu/wmi v1.2.4 // indirect
74106
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
75107
go.opentelemetry.io/collector/consumer/consumererror v0.129.1-0.20250630174123-18b3b578b0b3 // indirect
76108
go.opentelemetry.io/collector/consumer/xconsumer v0.129.1-0.20250630174123-18b3b578b0b3 // indirect
@@ -80,17 +112,21 @@ require (
80112
go.opentelemetry.io/collector/receiver/receiverhelper v0.129.1-0.20250630174123-18b3b578b0b3 // indirect
81113
go.opentelemetry.io/collector/receiver/xreceiver v0.129.1-0.20250630174123-18b3b578b0b3 // indirect
82114
go.opentelemetry.io/contrib/bridges/otelzap v0.12.0 // indirect
115+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
116+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 // indirect
117+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect
83118
go.opentelemetry.io/otel/log v0.13.0 // indirect
84119
go.opentelemetry.io/otel/metric v1.37.0 // indirect
85120
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
86121
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
122+
go.opentelemetry.io/proto/otlp v1.7.0 // indirect
87123
go.uber.org/atomic v1.11.0 // indirect
88124
go.yaml.in/yaml/v3 v3.0.3 // indirect
89125
golang.org/x/crypto v0.38.0 // indirect
90126
golang.org/x/net v0.40.0 // indirect
91127
golang.org/x/sys v0.33.0 // indirect
92128
golang.org/x/text v0.25.0 // indirect
93-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
129+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
94130
google.golang.org/grpc v1.73.0 // indirect
95131
google.golang.org/protobuf v1.36.6 // indirect
96132
sigs.k8s.io/yaml v1.5.0 // indirect

0 commit comments

Comments
 (0)