MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / GetQueriesConfigDir

Function GetQueriesConfigDir

internal/pgmonitor/util.go:16–27  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

14)
15
16func GetQueriesConfigDir(ctx context.Context) string {
17 log := logging.FromContext(ctx)
18 // The QUERIES_CONFIG_DIR environment variable can be used to tell postgres-operator where to
19 // find the setup.sql and queries.yml files when running the postgres-operator binary locally
20 if queriesConfigDir := os.Getenv("QUERIES_CONFIG_DIR"); queriesConfigDir != "" {
21 log.Info("Directory for setup.sql and queries files set by QUERIES_CONFIG_DIR env var. " +
22 "This should only be used when running the postgres-operator binary locally.")
23 return queriesConfigDir
24 }
25
26 return "/opt/crunchy/conf"
27}
28
29// ExporterEnabled returns true if the monitoring exporter is enabled
30func ExporterEnabled(ctx context.Context, cluster *v1beta1.PostgresCluster) bool {

Callers 2

Calls 2

FromContextFunction · 0.92
InfoMethod · 0.80

Tested by

no test coverage detected