You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However when using the pgx driver, the create table statement uses syntax specific to sqlite3 which causes a failure
error graph/graph.go:425 Failed to start component {"error": "error connecting to storage: ERROR: type "blob" does not exist (SQLSTATE 42704)", "type": "Receiver", "id": "sqlquery"}
I would expect there not to be an error and that the tracking table be created
Actual Result
error graph/graph.go:425 Failed to start component {"error": "error connecting to storage: ERROR: type "blob" does not exist (SQLSTATE 42704)", "type": "Receiver", "id": "sqlquery"}
Collector version
v0.110.0
Custom collector distro running on alpine compiled with go 1.22
OpenTelemetry Collector configuration
receivers:
sqlquery:
driver: postgresdatasource: "host=localhost port=5432 user=postgres password=s3cr3t sslmode=disable"queries:
- sql: "select * from my_logs where log_id > $$1"tracking_start_value: "1"# Not sure if this is correct yet but it should not matter for this issuetracking_column: log_idlogs:
- body_column: log_bodyexporters:
debug:
verbosity: detailedextensions:
db_storage:
driver: pgxdatasource: "host=localhost port=5432 user=postgres password=s3cr3t sslmode=disable"service:
extensions: [db_storage]pipelines:
logs:
receivers: [sqlquery]exporters: [debug]
Log output
error graph/graph.go:425 Failed to start component {"error": "error connecting to storage: ERROR: type \"blob\" does not exist (SQLSTATE 42704)", "type": "Receiver", "id": "sqlquery"}
Additional context
Once this is fixed I think there may also be an issue with the tracking table name as I think it will include invalid characters (at least when using sqlqueryreceiver). This is inferring the table name from the code which I might not being doing right. I can't test with sqlite3 due to #35280
The text was updated successfully, but these errors were encountered:
danelson
changed the title
[extension/dbstorage] pgx support not wokring because db queries are sqlite specific
[extension/storage/dbstorage] pgx support not wokring because db queries are sqlite specific
Oct 8, 2024
#### Description
Adds support for Postgres, using a test running a Postgresql docker
image.
#### Link to tracking issue
Fixesopen-telemetry#35692
#### Testing
Run a postgresql image and test with it.
Component(s)
extension/storage/dbstorage
What happened?
Description
The
dbstorage
extension says that bothsqlite3
andpgx
are supported.https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.110.0/extension/storage/dbstorage/README.md?plain=1#L21
However when using the
pgx
driver, the create table statement uses syntax specific tosqlite3
which causes a failureThe queries in https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/storage/dbstorage/client.go#L20-L23 look specific to
sqlite3
.Steps to Reproduce
See collector configuration below
Expected Result
I would expect there not to be an error and that the tracking table be created
Actual Result
Collector version
v0.110.0
Custom collector distro running on alpine compiled with go 1.22
OpenTelemetry Collector configuration
Log output
Additional context
Once this is fixed I think there may also be an issue with the tracking table name as I think it will include invalid characters (at least when using sqlqueryreceiver). This is inferring the table name from the code which I might not being doing right. I can't test with sqlite3 due to #35280
The text was updated successfully, but these errors were encountered: