Skip to content

Unknown driver "mssql+pyodbc" #101

Description

@Kiara0107

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions