Comments (10)
@hhromic no worries, thank you for your contribution! I just saw that you added tests to catch such issues earlier next time, that's great.
@burningalchemist thanks a lot for the quick patch release! I can verify that v0.10.1
works fine in my setup.
from sql_exporter.
@mkaindl Perfect, thanks for the info, that's all I need. I'll reproduce the bug and make sure it's fixed. 👍 Stay tuned, and sorry for the inconvenience. :)
from sql_exporter.
Hello all, I'm really sorry for the inconvenience caused.
I'm the author of the globbing support PR which introduced this issue. As mentioned, PR 208 should resolve the oversight in my implementation. Apologies! :(
from sql_exporter.
May I ask why you closed this issue? I encounter the same bug. More explicitly, it seems to be triggered as soon as there is more than one targets.collectors
item configured. This is probably a regression introduced by #194.
from sql_exporter.
I had multiple issues with upgrading to v0.10.0. Finally found a workaround but forgot to re-open this issue. It is definitely something with globbing and multiple collector files.
To workaround this issues I had to:
- Split up customized collector files in different directories
- Prefix name of customized collector with 'mssql_'
sql_exporter.yml
target:
collectors: [mssql_*]
collector_files:
- "mssql_standard.collector.yml"
- "directory/another.collector.yml"
directory/another.collector.yml
collector_name: mssql_another_collector
from sql_exporter.
The v0.10.1
release is here, please check it out. 👍
from sql_exporter.
Hi folks, I'll have a look into the issue. Could you please provide any additional details or error logs if there are any? Thanks! 🙂👍
Please file any other issues as well. If you're affected by the release, I'd suggest staying in 0.9 version for the time being.
from sql_exporter.
Hi @burningalchemist, thanks a lot for looking into this.
Reproduction of the bug
- Configuration in
prometheus-sql-exporter.yaml
:
target:
data_source_name: "mysql+unix://user:password@/var/lib/mysql/mysql.sock/db"
collectors: [collector_a, collector_b]
collectors:
- collector_name: collector_a
metrics:
- metric_name: sql_collector_debug_a
type: gauge
help: Overall number of tables in the DB.
values:
- total_number_of_tables
query: |
SELECT count(*) AS total_number_of_tables
FROM INFORMATION_SCHEMA.TABLES
- collector_name: collector_b
metrics:
- metric_name: sql_collector_debug_b
type: gauge
help: Overall number of tables in the DB.
values:
- total_number_of_tables
query: |
SELECT count(*) AS total_number_of_tables
FROM INFORMATION_SCHEMA.TABLES
- Result: the exporter fails to start.
- Debug log:
{"caller":"klog.go:108","func":"Warningf","level":"warn","msg":"Starting SQL exporter (version=0.10.0, branch=HEAD, revision=3e9475ff001b3ab1c246ac97892e1f9cd02bd364) (go=go1.19.6, platform=linux/amd64, ..."}
{"caller":"klog.go:84","func":"Infof","level":"debug","msg":"Loading configuration from /etc/prometheus-sql-exporter/prometheus-sql-exporter.yaml","ts":"2023-04-13T10:16:45.034Z"}
{"caller":"klog.go:143","func":"Fatalf","level":"error","msg":"Error creating exporter: unknown collector \"collector_a\" referenced in target","ts":"2023-04-13T10:16:45.034Z"}
Workaround
Replace [collector_a, collector_b]
by [collector_*]
. The bug only seems to be triggered when targets.collectors
contains more than one element.
Suspected root cause
I am unfortunately not at all familiar with Go, but maybe the problem could be close to here? To me it seems like this implementation returns an error immediately after any of the collector keys k
does not match the current cref
, when instead it should be checking all the collectors first.
from sql_exporter.
I just stumbled upon PR #208 which looks like it addressed exactly this issue!
So there is probably nothing more to do and it will be fixed with the next release 🙂
from sql_exporter.
@woutersmit @mkaindl The issue has been fixed, I'm going to create a patch release today, and it would great to get your feedback. 🙂👍
from sql_exporter.
Related Issues (20)
- Add support for ASE database (sybase) HOT 1
- Context deadline exceeded error handling HOT 4
- The problem of specifying a schema when capturing PostgreSQL metrics HOT 6
- Different collector file for each differrent job HOT 1
- Allow to set metric timestamp from query results
- Caching context deadline exceeded result HOT 6
- Context Deadline Exceeded HOT 9
- Support for MSSQL named pipe (np:) and shared memory (lpc:) DSNs HOT 16
- `up` metric to show that database connection was successful HOT 5
- parameter to set log file location HOT 8
- Add custom metrics to expose MSSQL server hostname HOT 1
- can we have the Postgres collector yml file example
- Is it possible to distinguish between the sql exporter process status and the target database? HOT 3
- Scrape each job separately HOT 2
- [helm] Support getting data-source-name from an existing secret HOT 12
- Ignore no rows returned HOT 6
- Better handling of NULL return values in certain cases HOT 6
- Environment variable substitution for DSN's HOT 3
- Cache Mechanism for sql exporter HOT 2
- clickhouse `context deadline exceeded` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sql_exporter.