Skip to content
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

[extension/dbstorage] Replace mattn/go-sqlite with non-CGO modernc.org/sqlite #37882

Merged

Conversation

Fiery-Fenix
Copy link
Contributor

Description

Main purpose of this PR - to make 1 component less with CGO dependency according to Coding Guidelines
Despite of the fact that dbstorage component is in Alpha state - was added compatibility layer to improve user experience and simplify migration path
Taking in account Alpha stability of component and written compatibility layer - I would expect that this change is not a breaking change
Respective warnings about outdated driver and it's parameters will be added to log during component start

Link to tracking issue

Fixes #35280

Testing

Patched OpenTelemetry Collector with modernc.org/sqlite driver was battle-tested in our environment for several month's in both Persistent Queue Storage and Tracking Storage appliances without no issues

Documentation

README for component was heavily updated to reflect:

  • sqlite driver parameters
  • sqlite driver recommended parameters
  • pgx driver parameters
  • sqlite3 to sqlite migration guide


Implementors can add additional driver support by importing SQL drivers into the program.
See [Golang database/sql package documentation](https://pkg.go.dev/database/sql) for more information.

`datasource`: the url of the database, in the format accepted by the driver.

>**NOTE:** If you are using legacy driver `sqlite3` and have additional driver parameters in `datasource` - please follow [migration guide](#migration-guide-from-sqlite3-to-sqlite-driver-options) to update your configuration.
`db_storage` component has compatibility convertor in place, but it's better to review and update used driver parameters.
Copy link
Contributor

Choose a reason for hiding this comment

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

should the changelog indicate the change as breaking?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still not confident that this change is breaking, because compatibility layer allows graceful migration from one driver to another. But if breaking change label will bring more user attention to this change - it sounds reasonable to make it breaking

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated changelog type to breaking

@atoulme
Copy link
Contributor

atoulme commented Mar 6, 2025

@Fiery-Fenix please fix the conflict and I'll get this in. never mind it's fixable, done

@atoulme atoulme merged commit 58d93b2 into open-telemetry:main Mar 6, 2025
156 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[extension/db_storage] Replace github.com/mattn/go-sqlite3 with a non-CGO alternative
3 participants