-
Notifications
You must be signed in to change notification settings - Fork 450
database_observability: update docs to reflect latest changes in README #4672
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,7 +158,7 @@ local.file "mysql_secret_<your_DB_name>" { | |
|
|
||
| prometheus.exporter.mysql "integrations_mysqld_exporter_<your_DB_name>" { | ||
| data_source_name = local.file.mysql_secret_<your_DB_name>.content | ||
| enable_collectors = ["perf_schema.eventsstatements", "perf_schema.eventswaits"] | ||
| enable_collectors = ["perf_schema.eventsstatements"] | ||
| } | ||
|
|
||
| database_observability.mysql "mysql_<your_DB_name>" { | ||
|
|
@@ -510,7 +510,7 @@ loki.relabel "database_observability_postgres_<your_DB_name>" { | |
| } | ||
|
|
||
| discovery.relabel "database_observability_postgres_<your_DB_name>" { | ||
| targets = concat(prometheus.exporter.postgres.integrations_postgres_exporter_<your_DB_name>.targets, database_observability.postgres.postgres_<your_DB_name>.targets) | ||
| targets = database_observability.postgres.postgres_<your_DB_name>.targets | ||
|
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. Drive-by fix. |
||
|
|
||
| rule { | ||
| target_label = "job" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,13 +24,12 @@ import ( | |
| "github.com/grafana/loki/pkg/push" | ||
| ) | ||
|
|
||
| func Test_collectSQLText(t *testing.T) { | ||
| func Test_disableQueryRedaction(t *testing.T) { | ||
| t.Run("enable sql text when provided", func(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
|
Comment on lines
-29
to
-30
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. Have removed |
||
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| query_samples { | ||
| disable_query_redaction = true | ||
| } | ||
|
|
@@ -44,11 +43,10 @@ func Test_collectSQLText(t *testing.T) { | |
| }) | ||
|
|
||
| t.Run("disable sql text when not provided (default behavior)", func(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| ` | ||
|
|
||
| var args Arguments | ||
|
|
@@ -59,11 +57,10 @@ func Test_collectSQLText(t *testing.T) { | |
| }) | ||
|
|
||
| t.Run("setup consumers scrape interval is correctly parsed from config", func(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| setup_consumers { | ||
| collect_interval = "1h" | ||
| } | ||
|
|
@@ -79,11 +76,10 @@ func Test_collectSQLText(t *testing.T) { | |
|
|
||
| func Test_parseCloudProvider(t *testing.T) { | ||
| t.Run("parse cloud provider block", func(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| cloud_provider { | ||
| aws { | ||
| arn = "arn:aws:rds:some-region:some-account:db:some-db-instance" | ||
|
|
@@ -98,11 +94,10 @@ func Test_parseCloudProvider(t *testing.T) { | |
| assert.Equal(t, "arn:aws:rds:some-region:some-account:db:some-db-instance", args.CloudProvider.AWS.ARN) | ||
| }) | ||
| t.Run("empty cloud provider block", func(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| ` | ||
|
|
||
| var args Arguments | ||
|
|
@@ -118,6 +113,7 @@ func Test_enableOrDisableCollectors(t *testing.T) { | |
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| ` | ||
|
|
||
| var args Arguments | ||
|
|
@@ -140,6 +136,7 @@ func Test_enableOrDisableCollectors(t *testing.T) { | |
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| enable_collectors = ["query_details", "schema_details", "query_samples", "setup_consumers", "explain_plans", "locks"] | ||
| ` | ||
|
|
||
|
|
@@ -163,6 +160,7 @@ func Test_enableOrDisableCollectors(t *testing.T) { | |
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| disable_collectors = ["query_details", "schema_details", "query_samples", "setup_consumers", "explain_plans"] | ||
| ` | ||
|
|
||
|
|
@@ -186,6 +184,7 @@ func Test_enableOrDisableCollectors(t *testing.T) { | |
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| disable_collectors = ["query_details", "schema_details", "query_samples", "setup_consumers", "explain_plans", "locks"] | ||
| enable_collectors = ["query_details", "schema_details", "query_samples", "setup_consumers", "explain_plans", "locks"] | ||
| ` | ||
|
|
@@ -210,6 +209,7 @@ func Test_enableOrDisableCollectors(t *testing.T) { | |
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| disable_collectors = ["schema_details", "query_samples", "setup_consumers", "explain_plans", "locks"] | ||
| enable_collectors = ["query_details"] | ||
| ` | ||
|
|
@@ -234,6 +234,7 @@ func Test_enableOrDisableCollectors(t *testing.T) { | |
| exampleDBO11yAlloyConfig := ` | ||
| data_source_name = "" | ||
| forward_to = [] | ||
| targets = [] | ||
| enable_collectors = ["some_string"] | ||
| disable_collectors = ["another_string"] | ||
| ` | ||
|
|
@@ -288,8 +289,6 @@ func Test_addLokiLabels(t *testing.T) { | |
| // TestMySQL_Update_DBUnavailable_ReportsUnhealthy tests that the component does not return an error when the database is unavailable, | ||
| // but reports unhealthy with the error message from the database. | ||
| func TestMySQL_Update_DBUnavailable_ReportsUnhealthy(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| args := Arguments{DataSourceName: "user:pass@tcp(127.0.0.1:1)/db"} | ||
| opts := cmp.Options{ | ||
| ID: "test.mysql", | ||
|
|
@@ -308,8 +307,6 @@ func TestMySQL_Update_DBUnavailable_ReportsUnhealthy(t *testing.T) { | |
| // TestMySQL_StartCollectors_ReportsUnhealthy_StackedErrors tests that the component tries to start collectors on a best effort basis, | ||
| // reports unhealthy stacking errors for the collectors that failed to start and generate metrics for the collectors that started successfully. | ||
| func TestMySQL_StartCollectors_ReportsUnhealthy_StackedErrors(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| args := Arguments{ | ||
| DataSourceName: "user:pass@tcp(127.0.0.1:3306)/db", | ||
| DisableCollectors: []string{"query_details", "schema_details", "setup_consumers", "explain_plans"}, | ||
|
|
||
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.
Ported from #4666, to keep README and docs in sync.