Skip to content

Commit 882c2c4

Browse files
feat(configV4): migrate config file to v4 (#93)
* feat(configV4): migrate config file to v4
1 parent 8e29245 commit 882c2c4

File tree

9 files changed

+77
-30
lines changed

9 files changed

+77
-30
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7-
## [Unreleased]
7+
## 1.7.0 (2021-06-27)
88
### Added
99
- New parameter for MySQL local socket connection. Local socket connection is secure so MySQL will not complain about non-secure connection when `require_secure_transport = ON`.
1010

11+
- Moved default config.sample to [V4](https://docs.newrelic.com/docs/create-integrations/infrastructure-integrations-sdk/specifications/host-integrations-newer-configuration-format/), added a dependency for infra-agent version 1.20.0
12+
13+
Please notice that old [V3](https://docs.newrelic.com/docs/create-integrations/infrastructure-integrations-sdk/specifications/host-integrations-standard-configuration-format/) configuration format is deprecated, but still supported.
14+
15+
16+
### Fix
17+
- Detection of slave running for all mysql versions
18+
- IPv6 address URI formation
19+
1120
## 1.6.1 (2021-06-08)
1221
### Changed
1322
- Support for ARM

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ FROM newrelic/infrastructure:latest
88
ENV NRIA_IS_FORWARD_ONLY true
99
ENV NRIA_K8S_INTEGRATION true
1010
COPY --from=builder /go/src/github.com/newrelic/nri-mysql/bin/nri-mysql /nri-sidecar/newrelic-infra/newrelic-integrations/bin/nri-mysql
11-
COPY --from=builder /go/src/github.com/newrelic/nri-mysql/mysql-definition.yml /nri-sidecar/newrelic-infra/newrelic-integrations/definition.yaml
1211
USER 1000

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ integration-test:
4040
install: bin/$(BINARY_NAME)
4141
@echo "=== $(INTEGRATION) === [ install ]: installing bin/$(BINARY_NAME)..."
4242
@sudo install -D --mode=755 --owner=root --strip $(ROOT)bin/$(BINARY_NAME) $(INTEGRATIONS_DIR)/bin/$(BINARY_NAME)
43-
@sudo install -D --mode=644 --owner=root $(ROOT)$(INTEGRATION)-definition.yml $(INTEGRATIONS_DIR)/$(INTEGRATION)-definition.yml
4443
@sudo install -D --mode=644 --owner=root $(ROOT)$(INTEGRATION)-config.yml.sample $(CONFIG_DIR)/$(INTEGRATION)-config.yml.sample
4544

4645
# Include thematic Makefiles

build/.goreleaser.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ nfpms:
4242
- nri-mysql-nix
4343

4444
dependencies:
45-
- "newrelic-infra"
45+
- newrelic-infra (>= 1.20.0)
4646

4747
bindir: "/var/db/newrelic-infra/newrelic-integrations/bin"
4848

@@ -55,7 +55,7 @@ nfpms:
5555
dst: "/usr/share/doc/nri-mysql/README.md"
5656
- src: "LICENSE"
5757
dst: "/usr/share/doc/nri-mysql/LICENSE"
58-
- src: "mysql-definition.yml"
58+
- src: "legacy/mysql-definition.yml"
5959
dst: "/var/db/newrelic-infra/newrelic-integrations/mysql-definition.yml"
6060
type: config
6161

@@ -76,7 +76,9 @@ archives:
7676
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Version }}_{{ .Arch }}_dirty"
7777
files:
7878
- mysql-config.yml.sample
79-
- mysql-definition.yml
79+
- src: 'legacy/mysql-definition.yml'
80+
dst: .
81+
strip_parent: true
8082
format: tar.gz
8183

8284
- id: nri-mysql-win
@@ -85,7 +87,9 @@ archives:
8587
name_template: "{{ .ProjectName }}-{{ .Arch }}.{{ .Version }}_dirty"
8688
files:
8789
- mysql-config.yml.sample
88-
- mysql-win-definition.yml
90+
- src: 'legacy/mysql-win-definition.yml'
91+
dst: .
92+
strip_parent: true
8993
format: zip
9094

9195
# we use custom publisher for fixing archives and signing them

build/release.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
BUILD_DIR := ./bin/
2-
GORELEASER_VERSION := v0.169.0
2+
GORELEASER_VERSION := v0.174.1
33
GORELEASER_BIN ?= bin/goreleaser
44

55
bin:

mysql-config.yml.k8s_sample

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,28 @@
1717
# Using the discovered IP as the host address
1818
HOSTNAME: ${discovery.ip}
1919
PORT: 3306
20+
# ENABLE_TLS: false
21+
# INSECURE_SKIP_VERIFY: false
22+
# Specify extra connection parameters as attr1=val1&attr2=val2.
23+
# EXTRA_CONNECTION_URL_ARGS: ""
24+
2025
# If not empty `socket` parameter will discard `port` parameter
2126
SOCKET: <PATH_TO_LOCAL_SOCKET_FILE_NAME>
2227
USERNAME: <USERNAME>
2328
PASSWORD: <PASSWORD>
29+
# Allow old password https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_old_passwords
30+
# OLD_PASSWORDS: false
31+
32+
# Name of the database to be monitored
33+
# DATABASE: ""
34+
35+
# Enable extended metrics
36+
# EXTENDED_METRICS: false
37+
38+
# Enable additional metrics
39+
# EXTENDED_INNODB_METRICS: false
40+
# EXTENDED_MY_ISAM_METRICS: false
41+
2442
# New users should leave this property as `true`, to identify the
2543
# monitored entities as `remote`. Setting this property to `false` (the
2644
# default value) is deprecated and will be removed soon, disallowing

mysql-config.yml.sample

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
1-
integration_name: com.newrelic.mysql
1+
integrations:
2+
- name: nri-mysql
3+
env:
4+
HOSTNAME: localhost
5+
PORT: 3306
6+
# ENABLE_TLS: false
7+
# INSECURE_SKIP_VERIFY: false
8+
# Specify extra connection parameters as attr1=val1&attr2=val2.
9+
# EXTRA_CONNECTION_URL_ARGS: ""
210

3-
instances:
4-
- name: mysql-server
5-
command: status
6-
arguments:
7-
hostname: localhost
8-
port: 3306
9-
# If not empty `socket` parameter will discard `port` parameter
10-
socket: <PATH_TO_LOCAL_SOCKET_FILE_NAME>
11-
username: newrelic
12-
password: <YOUR_SELECTED_PASSWORD>
13-
# New users should leave this property as `true`, to identify the
14-
# monitored entities as `remote`. Setting this property to `false` (the
15-
# default value) is deprecated and will be removed soon, disallowing
16-
# entities that are identified as `local`.
17-
# Please check the documentation to get more information about local
18-
# versus remote entities:
19-
# https://github.com/newrelic/infra-integrations-sdk/blob/master/docs/entity-definition.md
20-
remote_monitoring: true
21-
labels:
22-
env: production
23-
role: write-replica
11+
# If not empty `socket` parameter will discard `port` parameter
12+
SOCKET: <PATH_TO_LOCAL_SOCKET_FILE_NAME>
13+
14+
USERNAME: newrelic
15+
PASSWORD: <YOUR_SELECTED_PASSWORD>
16+
# Allow old password https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_old_passwords
17+
# OLD_PASSWORDS: false
18+
19+
# Name of the database to be monitored
20+
# DATABASE: ""
21+
22+
# Enable extended metrics
23+
# EXTENDED_METRICS: false
24+
25+
# Enable additional metrics
26+
# EXTENDED_INNODB_METRICS: false
27+
# EXTENDED_MY_ISAM_METRICS: false
28+
29+
# New users should leave this property as `true`, to identify the
30+
# monitored entities as `remote`. Setting this property to `false` (the
31+
# default value) is deprecated and will be removed soon, disallowing
32+
# entities that are identified as `local`.
33+
# Please check the documentation to get more information about local
34+
# versus remote entities:
35+
# https://github.com/newrelic/infra-integrations-sdk/blob/master/docs/entity-definition.md
36+
REMOTE_MONITORING: true
37+
interval: 30s
38+
labels:
39+
env: production
40+
role: write-replica
41+
inventory_source: config/mysql

0 commit comments

Comments
 (0)