Skip to content

[receiver/sqlquery] Add support for sybase database connections #36328

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

Closed
dehaansa opened this issue Nov 12, 2024 · 11 comments
Closed

[receiver/sqlquery] Add support for sybase database connections #36328

dehaansa opened this issue Nov 12, 2024 · 11 comments
Assignees
Labels
enhancement New feature or request receiver/sqlquery SQL query receiver

Comments

@dehaansa
Copy link
Contributor

dehaansa commented Nov 12, 2024

Component(s)

receiver/sqlquery

Is your feature request related to a problem? Please describe.

I've seen requests from some users seeking to monitor their Sybase databases, and would like to utilize the sqlqueryreceiver for this purpose.

Describe the solution you'd like

There is a go implementation here of a driver for SAP ASE (formerly Sybase). It does not appear to be receiving a lot of active development but also does not have any significant issues reported.

Describe alternatives you've considered

There are prometheus exporters we've considered, but are interested in the opentelemetry ecosystem for this solution, and also looking for the ease of iteration offered by the query configuration in the sqlquery receiver.

Additional context

No response

@dehaansa dehaansa added enhancement New feature or request needs triage New item requiring triage labels Nov 12, 2024
@github-actions github-actions bot added the receiver/sqlquery SQL query receiver label Nov 12, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@dehaansa dehaansa changed the title [receiver/sqlquery] Add support for sybase database support [receiver/sqlquery] Add support for sybase database connections Nov 13, 2024
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@Grandys
Copy link
Contributor

Grandys commented Feb 1, 2025

Hi @dehaansa , could you please assign me to this issue?

@dehaansa
Copy link
Contributor Author

dehaansa commented Feb 1, 2025

@Grandys that's above my permissions level, but I appreciate you taking it on!

@Grandys
Copy link
Contributor

Grandys commented Feb 5, 2025

I've added experimental SAP ASE support in Go, but I need your input on a few issues I encountered:

  • To run a SAP ASE database, I had to use the datagrip/sybase:16.0 image because version 15.7 fails to start on my machines (tested on both ARM and Intel MacBooks).
  • When using the go-ase driver, I encountered an error (see issue #244) stating "expected TDS_MSG_SEC_ENCRYPT4, received TDS_MSG_SEC_ENCRYPT3 for ASE v16.0 SP04." By contrast, the thda/tds driver connects successfully. It’s worth mentioning that the thda/tds driver is distributed under the BSD license and appears to be less actively maintained (last commit 5 years ago versus 2 years ago for go-ase 😅).

My proposal is to:

  • Include both drivers as dependencies so that clients can choose their preferred option.
  • Update the documentation to indicate that users have two options for connecting to a SAP ASE database.
  • Add integration tests exclusively for sybase:16.0 with the thda/tds driver.

Please let me know if this approach works for you or if you have any suggestions.

cc: @dmitryax @crobert-1

@crobert-1
Copy link
Member

My preference would be to start with a single driver. Users shouldn't have to care about which golang sql driver is being used internally. If one ends up being a problem we can just swap it out with a bug fix and the user config stays the same. To me, this reduces dependencies and user confusion getting started.

I'm not a fan of either options of driver available to be honest. As you pointed out, both projects appear to be unmaintained, and not very widely used. It's at least encouraging that the thda/tds driver is connecting successfully, but my main concern would be potential vulnerabilities coming in from a small personal project that's no longer maintained. I guess we could rely on our vulnerability scanners for now.

My thought would be simply start with a new valid value for the driver config option, along with integration testing 👍

@Grandys
Copy link
Contributor

Grandys commented Feb 6, 2025

Thank you for an update. One clarification:

... and the user config stays the same.

Replacing driver, is potentially breaking change, because connection string (in configuration) must change.
go-ase connection string is:

 ase://user:pass@host:port/

Where tds connection string is:

tds://username:password@host:port/database?parameter=value&parameter2=value2

@crobert-1
Copy link
Member

Replacing driver, is potentially breaking change, because connection string (in configuration) must change.

Oh interesting, thanks for calling this out! I'd still prefer to start with one driver and add the second on an as-needed basis. In the future if we find one isn't working properly, or has security vulnerabilities that need to be avoided, a breaking change will be alright. I'm not sure how we could avoid a breaking change in either situation given the mismatched connection string. (If we included both drivers from the start we'd have the same breaking change if a security vulnerability popped up that required the removal of one of the drivers.)

That being said, maybe the driver UI name can be more closely related to the chosen driver, but still show that it's for SAP Sybase.

Is that a fair solution, do you have any concerns with the approach I've proposed?

Grandys added a commit to Grandys/opentelemetry-collector-contrib that referenced this issue Feb 7, 2025
Grandys added a commit to Grandys/opentelemetry-collector-contrib that referenced this issue Feb 7, 2025
Grandys added a commit to Grandys/opentelemetry-collector-contrib that referenced this issue Feb 7, 2025
Grandys added a commit to Grandys/opentelemetry-collector-contrib that referenced this issue Feb 7, 2025
Grandys added a commit to Grandys/opentelemetry-collector-contrib that referenced this issue Feb 7, 2025
Grandys added a commit to Grandys/opentelemetry-collector-contrib that referenced this issue Feb 7, 2025
@Grandys
Copy link
Contributor

Grandys commented Feb 7, 2025

No concerns from my side, everything you wrote makes sense.

My PR is ready for review: #37773

Grandys added a commit to Grandys/opentelemetry-collector-contrib that referenced this issue Feb 12, 2025
Grandys added a commit to Grandys/opentelemetry-collector-contrib that referenced this issue Feb 20, 2025
songy23 pushed a commit that referenced this issue Feb 20, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Adding a feature - support for SapASE (Sybase) database connections with
[thda/tds](https://github.com/thda/tds) driver

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
#36328

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Integration test for SapASE with
[datagrip/sybase:16.0](https://hub.docker.com/r/datagrip/sybase) for:
* Tracking processed logs with and without storage
* Metrics

<!--Describe the documentation added.-->
#### Documentation
* Added driver option
* Added example connection strings for various drivers

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Co-authored-by: Curtis Robert <[email protected]>
Copy link
Contributor

github-actions bot commented Apr 9, 2025

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Apr 9, 2025
@dehaansa dehaansa removed the Stale label Apr 9, 2025
@dehaansa
Copy link
Contributor Author

dehaansa commented Apr 9, 2025

Closing as this was implemented in #37773

@dehaansa dehaansa closed this as completed Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request receiver/sqlquery SQL query receiver
Projects
None yet
Development

No branches or pull requests

3 participants