-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PMM-12185 migrate telemetry GrafanaDS to using PostgreSQL #2542
Merged
ademidoff
merged 18 commits into
main
from
PMM-12185-migrate-grafana-telemetry-ds-to-pg
Oct 25, 2023
Merged
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
49a45b0
PMM-12185 migrate telemetry GrafanaDS to using PostgreSQL
ademidoff d92bd2c
PMM-12185 configure GrafanaDB connection
ademidoff c93568f
PMM-12185 fix grafanaDB SQL stmnts
ademidoff cbb593f
PMM-12185 don't init when ds is disabled
ademidoff 66421b0
PMM-12185 cleanup the code
ademidoff 11fe4e0
Merge branch 'main' into PMM-12185-migrate-grafana-telemetry-ds-to-pg
ademidoff 3045a22
PMM-12185 update go modules
ademidoff 21e9c39
PMM-12185 Apply suggestions from code review
ademidoff e8fd27f
Merge branch 'main' into PMM-12185-migrate-grafana-telemetry-ds-to-pg
ademidoff bb0a889
PMM-12185 remove the debug stmnt
ademidoff d969cfa
PMM-12185 remove unused lint suppressions
ademidoff 4743ef6
PMM-12185 fix inconsistent log output
ademidoff f45078c
PMM-12185 trim trailing spaces
ademidoff 26bcf23
PMM-12185 rename VM config type for consistency sake
ademidoff f5869a2
Merge branch 'main' into PMM-12185-migrate-grafana-telemetry-ds-to-pg
ademidoff c6d6765
Merge branch 'main' into PMM-12185-migrate-grafana-telemetry-ds-to-pg
ademidoff 8d93544
Merge branch 'main' into PMM-12185-migrate-grafana-telemetry-ds-to-pg
ademidoff e08f602
Merge branch 'main' into PMM-12185-migrate-grafana-telemetry-ds-to-pg
ademidoff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,10 +44,10 @@ type ServiceConfig struct { | |
telemetry []Config `yaml:"-"` | ||
SaasHostname string `yaml:"saas_hostname"` | ||
DataSources struct { | ||
VM *DataSourceVictoriaMetrics `yaml:"VM"` | ||
QanDBSelect *DSConfigQAN `yaml:"QANDB_SELECT"` | ||
PmmDBSelect *DSConfigPMMDB `yaml:"PMMDB_SELECT"` | ||
GrafanaDBSelect *DSGrafanaSqliteDB `yaml:"GRAFANADB_SELECT"` | ||
VM *DSVictoriaMetrics `yaml:"VM"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏼 |
||
QanDBSelect *DSConfigQAN `yaml:"QANDB_SELECT"` | ||
PmmDBSelect *DSConfigPMMDB `yaml:"PMMDB_SELECT"` | ||
GrafanaDBSelect *DSConfigGrafanaDB `yaml:"GRAFANADB_SELECT"` | ||
} `yaml:"datasources"` | ||
Reporting ReportingConfig `yaml:"reporting"` | ||
} | ||
|
@@ -64,32 +64,25 @@ type DSConfigQAN struct { | |
DSN string `yaml:"-"` | ||
} | ||
|
||
// DataSourceVictoriaMetrics telemetry config. | ||
type DataSourceVictoriaMetrics struct { | ||
// DSVictoriaMetrics telemetry config. | ||
type DSVictoriaMetrics struct { | ||
Enabled bool `yaml:"enabled"` | ||
Timeout time.Duration `yaml:"timeout"` | ||
Address string `yaml:"address"` | ||
} | ||
|
||
// DSGrafanaSqliteDB telemetry config. | ||
type DSGrafanaSqliteDB struct { | ||
Enabled bool `yaml:"enabled"` | ||
Timeout time.Duration `yaml:"timeout"` | ||
DBFile string `yaml:"db_file"` | ||
} | ||
|
||
// DSConfigPMMDB telemetry config. | ||
type DSConfigPMMDB struct { //nolint:musttag | ||
Enabled bool `yaml:"enabled"` | ||
Timeout time.Duration `yaml:"timeout"` | ||
UseSeparateCredentials bool `yaml:"use_separate_credentials"` | ||
// Credentials used by PMM | ||
DSN struct { | ||
DSN struct { | ||
Scheme string | ||
Host string | ||
DB string | ||
Params string | ||
} `yaml:"-"` | ||
// Credentials used by PMM | ||
Credentials struct { | ||
Username string | ||
Password string | ||
|
@@ -100,6 +93,9 @@ type DSConfigPMMDB struct { //nolint:musttag | |
} `yaml:"separate_credentials"` | ||
} | ||
|
||
// DSConfigGrafanaDB is a Grafana telemetry config. | ||
type DSConfigGrafanaDB DSConfigPMMDB | ||
|
||
// Config telemetry config. | ||
type Config struct { | ||
ID string `yaml:"id"` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has TODO comment on the top. Can we eliminate its extension and use just plain constants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per TODO, all of them need to be migrated. For the sake of scope and testing, isn't it better to do that in one PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's ok to do that later. Just wanted to get your attention to plans regarding this config.