Skip to content

Commit

Permalink
add info files and fix simple issues
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenechertikhin committed Mar 12, 2015
1 parent 60e8f76 commit 4a2553d
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 16 deletions.
13 changes: 13 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
The Prometheus project was started by Matt T. Proud (emeritus) and
Julius Volz in 2012.

Maintainers of this repository:

* Brian Brazil <brian.brazil@boxever.com>
* Johannes 'fish' Ziemke <github@freigeist.org>
* Tobias Schmidt <ts@soundcloud.com>

The following individuals have contributed code to this repository
(listed in alphabetical order):

* Eugene Chertikhin <e.chertikhin@crestwavetech.ru>
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Contributing

Prometheus uses GitHub to manage reviews of pull requests.

* If you have a trivial fix or improvement, go ahead and create a pull
request, addressing (with `@...`) one or more of the maintainers
(see [AUTHORS.md](AUTHORS.md)) in the description of the pull request.

* If you plan to do something more involved, first discuss your ideas
on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers).
This will avoid unnecessary work and surely give you and us a good deal
of inspiration.

* Relevant coding style guidelines are the [Go Code Review
Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments)
and the _Formatting and style_ section of Peter Bourgon's [Go: Best
Practices for Production
Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style).
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013 The Prometheus Authors
# Copyright 2015 The Prometheus Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
7 changes: 2 additions & 5 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
Exporter for mysql daemon
by Eugene Chertikhin <e.chertikhin@crestwavetech.ru>

This product includes software developed at
SoundCloud Ltd. (http://soundcloud.com/).
Exporter for MySQL daemon.
Copyright 2015 The Prometheus Authors
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ Exporter for MySQL server metrics http://prometheus.io/
make
./mysqld_exporter <flags>

Flags description

Name | Description
-------------------|------------
web.listen-address | Address to listen on for web interface and telemetry.
web.telemetry-path | Path under which to expose metrics.
config.file | Config file name with connection string

## Configuration
The configuration is in JSON. An example with all possible options:
```
Expand All @@ -16,10 +24,5 @@ The configuration is in JSON. An example with all possible options:
}
}
```
Name | Description
---------|------------
login | Login name for connect with server
password | Password for connect with server
host | Server hostname or ip. May be omitted
dbname | Name of database

Format of connection string described at https://github.com/go-sql-driver/mysql#dsn-data-source-name
9 changes: 5 additions & 4 deletions mysqld_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"strconv"
"sync"
"strings"

"database/sql"
_ "github.com/go-sql-driver/mysql"
Expand All @@ -20,7 +21,7 @@ const (
)

var (
listenAddress = flag.String("web.listen-address", ":9091", "Address to listen on for web interface and telemetry.")
listenAddress = flag.String("web.listen-address", ":9104", "Address to listen on for web interface and telemetry.")
metricPath = flag.String("web.telemetry-path", "/metrics", "Path under which to expose metrics.")
configFile = flag.String("config.file", "mysqld_exporter.conf", "Path to config file.")
)
Expand Down Expand Up @@ -59,12 +60,12 @@ func NewMySQLExporter(config *Config) *Exporter {
}),
totalScrapes: prometheus.NewCounter(prometheus.CounterOpts{
Namespace: namespace,
Name: "exporter_total_scrapes",
Name: "exporter_scrapes_total",
Help: "Current total mysqld scrapes.",
}),
errorScrapes: prometheus.NewCounter(prometheus.CounterOpts{
Namespace: namespace,
Name: "exporter_error_scrapes",
Name: "exporter_scrape_errors_total",
Help: "Error mysqld scrapes.",
}),
metrics: map[string]prometheus.Gauge{},
Expand Down Expand Up @@ -139,7 +140,7 @@ func (e *Exporter) scrape(scrapes chan<- []string) {
func (e *Exporter) setMetrics(scrapes <-chan []string) {
for row := range scrapes {

name := row[0]
name := strings.ToLower(row[0])
value, err := strconv.ParseInt(row[1], 10, 64)
if err != nil {
// not really important
Expand Down

0 comments on commit 4a2553d

Please sign in to comment.