Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 158f57b

Browse files
committed
0.8.2 final
1 parent d68dae7 commit 158f57b

File tree

12 files changed

+91
-55
lines changed

12 files changed

+91
-55
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818

1919

2020
local_config/
21-
21+
cmd/

.promu-db2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repository:
44
path: github.com/peekjef72/sql_exporter
55
build:
66
binaries:
7-
- name: db2_exporter
7+
- name: cmd/db2_exporter
88
path: .
99
flags: -tags netgo,usergo,static,db2
1010
ldflags: |

.promu-hana.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ go:
22
cgo: false
33
repository:
44
path: github.com/peekjef72/sql_exporter
5-
path: .
65
build:
76
binaries:
8-
- name: hanasql_exporter
7+
- name: cmd/hanasql_exporter
98
path: .
10-
flags: -tags hana
9+
flags: -tags netgo,users,static,hana
1110
ldflags: |
1211
-X github.com/prometheus/common/version.Version={{.Version}}
1312
-X github.com/prometheus/common/version.Revision={{.Revision}}

.promu-oracle.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@ repository:
55
build:
66
static: false
77
binaries:
8-
- name: oracle_exporter
8+
- name: cmd/oracle_exporter
99
path: .
1010
flags: |
11-
-tags netgo,usergo,oracle
11+
-gcflags -I=/usr/include/oracle/19.16/client64 -tags netgo,usergo,oracle
1212
13-
#-gcflags -I/usr/include/oracle/19.16/client64
14-
# -I /usr/include/oracle/19.16/client64
15-
# -L /usr/lib/oracle/19.16/client64/lib
1613
ldflags: |
1714
-L /usr/lib/oracle/19.23/client64/lib
1815
-X github.com/prometheus/common/version.Version={{.Version}}

.promu.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ repository:
55
path: .
66
build:
77
binaries:
8-
- name: mssql_exporter
8+
- name: cmd/mssql_exporter
99
path: .
10-
flags: -tags mssql
10+
flags: -tags netgo,usergo,static,mssql
1111
ldflags: |
1212
-X github.com/prometheus/common/version.Version={{.Version}}
1313
-X github.com/prometheus/common/version.Revision={{.Revision}}
1414
-X github.com/prometheus/common/version.Branch={{.Branch}}
1515
-X github.com/prometheus/common/version.BuildDate={{date "2006-01-02T15:04:05"}}
1616
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
1717
tarball:
18-
prefix: .
18+
prefix:
1919
files:
2020
- LICENSE
2121
- README.md
22-
- config
22+
- contribs
23+
- cmd

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).
4+
5+
<!--next-version-placeholder-->
6+
7+
## 0.8.2 2024/05/05
8+
* add proxy mode : allow to scrap remote servers using connection string as target
9+
* add hanadb exporter and standard metrics.
10+
* add basic encryption for user/passwords used to connect to database: password are not in plain text in configuration file.
11+
12+
## 0.8.1 2022/10/02
13+
* added multi-targets
14+
* add db2
15+
* remove multi drivers compilations: use tags instead to have specific exporter for each one supported (mssql, db2, oracle)
16+
* add contribs for standard statistics (mssql, db2)
17+
18+
## 0.5
19+
* forked from [mgit-at/sqlexporter](https://github.com/mgit-at/sql_exporter/blob/master/README.md)

Makefile

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
1919
PREFIX ?= $(shell pwd)
2020
BIN_DIR ?= $(shell pwd)
2121
BASE_DIR ?= $(shell dirname $(BIN_DIR))
22-
MSSQL_DIR ?= $(BASE_DIR)/mssql_exporter
23-
DB2_DIR ?= $(BASE_DIR)/db2_exporter
2422
DOCKER_IMAGE_NAME ?= mssql-exporter
2523
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))
2624

27-
2825
all: promu build
2926

3027
style:
@@ -47,53 +44,57 @@ build-mssql: promu
4744
@echo ">> building MSSQL binaries"
4845
@$(PROMU) build --prefix $(PREFIX) -v
4946

50-
build-ora: promu
47+
build-oracledb: promu
5148
@echo ">> building ORACLE binaries"
52-
@$(PROMU) build --prefix $(PREFIX) --config=.promu-oracle.yml
49+
@. $(PREFIX)/.env_oracle && $(PROMU) build --prefix $(PREFIX) --config=.promu-oracle.yml
5350

5451
build-db2: promu
5552
@echo ">> building DB2 binaries"
56-
@$(PROMU) build --prefix $(PREFIX) --config=.promu-db2.yml
53+
@. $(PREFIX)/.env_db2 && $(PROMU) build --prefix $(PREFIX) --config=.promu-db2.yml
5754

5855
build-hana: promu
5956
@echo ">> building HANASQL binaries"
6057
@$(PROMU) build --prefix $(PREFIX) --config=.promu-hana.yml
6158

62-
build: build-mssql build-db2 build-hana #build-ora
63-
64-
tarball-mssql: mssql_exporter
65-
@echo ">> building mssql release tarball"
66-
@mv $(BIN_DIR)/contribs/mssql_exporter $(BIN_DIR)/config
67-
@git remote set-url origin "https://github.com/peekjef72/mssql_exporter.git"
68-
@$(PROMU) tarball --config=.promu.yml
69-
@git remote set-url origin "https://github.com/peekjef72/sql_exporter.git"
70-
@mv $(BIN_DIR)/config $(BIN_DIR)/contribs/mssql_exporter
71-
72-
tarball-db2: build-db2
73-
@echo ">> building db2 release tarball"
74-
@mv $(BIN_DIR)/contribs/db2_exporter $(BIN_DIR)/config
75-
@git remote set-url origin "https://github.com/peekjef72/db2_exporter.git"
76-
@$(PROMU) tarball --config=.promu-db2.yml
77-
@git remote set-url origin "https://github.com/peekjef72/sql_exporter.git"
78-
@mv $(BIN_DIR)/config $(BIN_DIR)/contribs/db2_exporter
79-
80-
tarball-ora: build-ora
81-
@echo ">> building oracledb release tarball"
82-
@mv $(BIN_DIR)/contribs/oracledb_exporter $(BIN_DIR)/config
83-
@git remote set-url origin "https://github.com/peekjef72/oracledb_exporter.git"
84-
@$(PROMU) tarball --config=.promu-oracle.yml
85-
@git remote set-url origin "https://github.com/peekjef72/sql_exporter.git"
86-
@mv $(BIN_DIR)/config $(BIN_DIR)/contribs/oracledb_exporter
87-
88-
tarball-hana: build-hana
89-
@echo ">> building HANASQL release tarball"
90-
@mv $(BIN_DIR)/contribs/hanasql_exporter $(BIN_DIR)/config
91-
@git remote set-url origin "https://github.com/peekjef72/hanasql_exporter.git"
92-
@$(PROMU) tarball --config=.promu-hana.yml
93-
@git remote set-url origin "https://github.com/peekjef72/sql_exporter.git"
94-
@mv $(BIN_DIR)/config $(BIN_DIR)/contribs/hanasql_exporter
95-
96-
tarball: tarball-mssql tarball-db2 tarball-hana #tarball-ora
59+
build: build-mssql build-db2 build-hana #build-oracle
60+
61+
# tarball-mssql: mssql_exporter
62+
# @echo ">> building mssql release tarball"
63+
# @mv $(BIN_DIR)/contribs/mssql_exporter $(BIN_DIR)/config
64+
# @git remote set-url origin "https://github.com/peekjef72/mssql_exporter.git"
65+
# @$(PROMU) tarball --config=.promu.yml
66+
# @git remote set-url origin "https://github.com/peekjef72/sql_exporter.git"
67+
# @mv $(BIN_DIR)/config $(BIN_DIR)/contribs/mssql_exporter
68+
69+
# tarball-db2: build-db2
70+
# @echo ">> building db2 release tarball"
71+
# @mv $(BIN_DIR)/contribs/db2_exporter $(BIN_DIR)/config
72+
# @git remote set-url origin "https://github.com/peekjef72/db2_exporter.git"
73+
# @$(PROMU) tarball --config=.promu-db2.yml
74+
# @git remote set-url origin "https://github.com/peekjef72/sql_exporter.git"
75+
# @mv $(BIN_DIR)/config $(BIN_DIR)/contribs/db2_exporter
76+
77+
# tarball-oracle:
78+
# @echo ">> building oracledb release tarball"
79+
# @mv $(BIN_DIR)/contribs/oracle_exporter $(BIN_DIR)/config
80+
# @git remote set-url origin "https://github.com/peekjef72/oracledb_exporter.git"
81+
# @$(PROMU) tarball --config=.promu-oracle.yml
82+
# @git remote set-url origin "https://github.com/peekjef72/sql_exporter.git"
83+
# @mv $(BIN_DIR)/config $(BIN_DIR)/contribs/oracledb_exporter
84+
85+
# tarball-hana: build-hana
86+
# @echo ">> building HANASQL release tarball"
87+
# @mv $(BIN_DIR)/contribs/hanasql_exporter $(BIN_DIR)/config
88+
# @git remote set-url origin "https://github.com/peekjef72/hanasql_exporter.git"
89+
# @$(PROMU) tarball --config=.promu-hana.yml
90+
# @git remote set-url origin "https://github.com/peekjef72/sql_exporter.git"
91+
# @mv $(BIN_DIR)/config $(BIN_DIR)/contribs/hanasql_exporter
92+
93+
# tarball: tarball-mssql tarball-db2 tarball-hana #tarball-oracle
94+
95+
tarball:
96+
@echo ">> build release tarball"
97+
@$(shell ./build_tarball.sh)
9798

9899
docker:
99100
@echo ">> building docker image"

build_tarball.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
REPO_NAME=$(basename `git rev-parse --show-toplevel`)
4+
VERSION=$(tr -d '\n' <VERSION)
5+
GOARCH=$(go env GOARCH)
6+
GOHOSTOS=$(go env GOHOSTOS)
7+
8+
FILE="${REPO_NAME}-${VERSION}.${GOHOSTOS}-${GOARCH}"
9+
10+
11+
mkdir ${FILE}
12+
cp README.md ${FILE}
13+
cp LICENSE ${FILE}
14+
cp -pr cmd/* ${FILE}/
15+
cp -pr contribs ${FILE}/
16+
17+
tar czf "${FILE}.tar.gz" ${FILE}
18+
19+
rm -rf ${FILE}

mssql_exporter

-17.6 MB
Binary file not shown.
17.3 MB
Binary file not shown.

0 commit comments

Comments
 (0)