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

Unknown driver "mssql+pyodbc" #101

Open
Kiara0107 opened this issue Sep 22, 2023 · 1 comment
Open

Unknown driver "mssql+pyodbc" #101

Kiara0107 opened this issue Sep 22, 2023 · 1 comment

Comments

@Kiara0107
Copy link

Issue:

{"caller":"job.go:190","err":"sql: unknown driver \"mssql+pyodbc\" (forgotten import?)","job":"example","level":"warn","msg":"Failed to connect","ts":"2023-09-22T09:02:58.038302874Z"}

Is this driver indeed unsupported or am I using it wrongly?

Configuration in config.yml:

---
# jobs is a map of jobs, define any number but please keep the connection usage on the DBs in mind
jobs:
  # each job needs a unique name, it's used for logging and as an default label
- name: "example"
  interval: '30s'
  connections:
  - 'mssql+pyodbc://username:password@host:1433/dbatasks?driver=ODBC+Driver+17+for+SQL+Server&MARS_Connection=yes'
  startup_sql:
  - 'SET lock_timeout = 1000'
  - 'SET idle_in_transaction_session_timeout = 100'
  queries:
  - name: "exceptionlog_count"
    help: "Sum of log entries in ExceptionLog table"
    labels:
      - "db"
    values:
      - "exceptionlog_count"
    query:  EXEC [dbo].[usp_PrometheusExceptionLogMonitoring]
    allow_zero_rows: false

Docker run command:

docker run -d -p 9237:9237 \
-v /etc/query/config.yml:/config/config.yml \
-e CONFIG=/config/config.yml \
--name sql-exporter ghcr.io/justwatchcom/sql_exporter
@dewey
Copy link
Member

dewey commented Sep 22, 2023

Hey, unfortunately I don't have access to one of these database servers and this was a community contributed integration as far as I know. I can't really test it unfortunately. If someone wants to take a look there, I'm happy to review a PR. It might just be about importing some package for the driver side-effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants