Skip to content

Commit 6a352b8

Browse files
committed
[reciver/sqlqueryreceiver] Add support for sybase database connections open-telemetry#36328
1 parent 236cc57 commit 6a352b8

File tree

10 files changed

+370
-25
lines changed

10 files changed

+370
-25
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: receiver/sqlqueryreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add support for SapASE (sybase) database connections
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [36328]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
# If your change doesn't affect end users or the exported elements of any package,
20+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
21+
# Optional: The change log or logs in which this entry should be included.
22+
# e.g. '[user]' or '[user, api]'
23+
# Include 'user' if the change is relevant to end users.
24+
# Include 'api' if there is a change to a library API.
25+
# Default: '[user]'
26+
change_logs: [user]

internal/sqlquery/db_client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
_ "github.com/microsoft/go-mssqldb/integratedauth/krb5"
1616
_ "github.com/sijms/go-ora/v2"
1717
_ "github.com/snowflakedb/gosnowflake"
18+
_ "github.com/thda/tds"
1819
"go.uber.org/zap"
1920
)
2021

internal/sqlquery/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ require (
7575
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
7676
github.com/pmezard/go-difflib v1.0.0 // indirect
7777
github.com/sirupsen/logrus v1.9.3 // indirect
78+
github.com/thda/tds v0.1.7 // indirect
7879
github.com/zeebo/xxh3 v1.0.2 // indirect
7980
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
8081
go.opentelemetry.io/collector/config/configtelemetry v0.119.0 // indirect

internal/sqlquery/go.sum

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/sqlqueryreceiver/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ The SQL Query Receiver uses custom SQL queries to generate metrics from a databa
2525
The configuration supports the following top-level fields:
2626

2727
- `driver`(required): The name of the database driver: one of _postgres_, _mysql_, _snowflake_, _sqlserver_, _hdb_ (SAP
28-
HANA), or _oracle_ (Oracle DB).
28+
HANA), _oracle_ (Oracle DB), _tds_ (SapASE/Sybase).
2929
- `datasource`(required): The datasource value passed to [sql.Open](https://pkg.go.dev/database/sql#Open). This is
3030
a driver-specific string usually consisting of at least a database name and connection information. This is sometimes
31-
referred to as the "connection string" in driver documentation.
32-
e.g. _host=localhost port=5432 user=me password=s3cr3t sslmode=disable_
31+
referred to as the "connection string" in driver documentation. Examples:
32+
- [postgres](https://github.com/lib/pq) - `host=localhost port=5432 user=username password=user_password sslmode=disable`
33+
- [mysql](https://github.com/go-sql-driver/mysql) - `username:user_password@tcp(localhost:3306)/db_name`
34+
- [oracle](https://github.com/sijms/go-ora) - `oracle://username:user_password@localhost:1521/FREEPDB1`
35+
- [sqlserver](https://github.com/go-sql-driver/mysql) - `sqlserver://username:user_password@localhost:1433?database=db_name`
36+
- [sapAse](https://github.com/thda/tds) - `tds://username:user_password@localhost:5000/db_name`
3337
- `queries`(required): A list of queries, where a query is a sql statement and one or more `logs` and/or `metrics` sections (details below).
3438
- `collection_interval`(optional): The time interval between query executions. Defaults to _10s_.
3539
- `storage` (optional, default `""`): The ID of a [storage][storage_extension] extension to be used to [track processed results](#tracking-processed-results).

receiver/sqlqueryreceiver/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ require (
136136
github.com/sijms/go-ora/v2 v2.8.23 // indirect
137137
github.com/sirupsen/logrus v1.9.3 // indirect
138138
github.com/snowflakedb/gosnowflake v1.12.0 // indirect
139+
github.com/thda/tds v0.1.7 // indirect
139140
github.com/tklauser/go-sysconf v0.3.12 // indirect
140141
github.com/tklauser/numcpus v0.6.1 // indirect
141142
github.com/valyala/fastjson v1.6.4 // indirect

receiver/sqlqueryreceiver/go.sum

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)