Skip to content

Commit 47c92c3

Browse files
committed
main sync develop
2 parents 2bf840e + 2c18801 commit 47c92c3

27 files changed

Lines changed: 282 additions & 104 deletions

File tree

chart-sync/vendor/github.com/devtron-labs/common-lib/constants/constants.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chart-sync/vendor/github.com/devtron-labs/common-lib/utils/SqlUtil.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci-runner/vendor/github.com/devtron-labs/common-lib/constants/constants.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci-runner/vendor/github.com/devtron-labs/common-lib/utils/SqlUtil.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common-lib/constants/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const (
3434
Kubelink ServiceName = "KUBELINK"
3535
GitSensor ServiceName = "GITSENSOR"
3636
Kubewatch ServiceName = "KUBEWATCH"
37+
ImageScanner ServiceName = "IMAGE_SCANNER"
3738
)
3839

3940
// metrics name constants

common-lib/utils/SqlUtil.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,31 +85,31 @@ func ExecutePGQueryProcessor(cfg bean.PgQueryMonitoringConfig, event bean.PgQuer
8585
} else {
8686
status = SUCCESS
8787
}
88-
PgQueryDuration.WithLabelValues(status, cfg.ServiceName, event.FuncName, getErrorType(pgError).String()).Observe(queryDuration.Seconds())
88+
PgQueryDuration.WithLabelValues(status, cfg.ServiceName, getErrorType(pgError).String()).Observe(queryDuration.Seconds())
8989
}
9090

9191
// Log pg query if enabled
9292
logThresholdQueries := cfg.LogSlowQuery && queryDuration.Milliseconds() > cfg.QueryDurationThreshold
9393
logNetworkFailure := queryError && cfg.LogAllFailureQueries && isNetworkError(pgError)
9494
if logNetworkFailure {
95-
log.Println(fmt.Sprintf("%s - query time", PgNetworkErrorLogPrefix), "duration", queryDuration.Seconds(), "query", event.Query, "pgError", pgError)
95+
log.Println(fmt.Sprintf("%s - query time", PgNetworkErrorLogPrefix), "duration", queryDuration.Seconds(), "functionName", event.FuncName, "query", event.Query, "pgError", pgError)
9696
}
9797
logFailureQuery := queryError && cfg.LogAllFailureQueries && !isNetworkError(pgError)
9898
if logFailureQuery {
99-
log.Println(fmt.Sprintf("%s - query time", PgQueryFailLogPrefix), "duration", queryDuration.Seconds(), "query", event.Query, "pgError", pgError)
99+
log.Println(fmt.Sprintf("%s - query time", PgQueryFailLogPrefix), "duration", queryDuration.Seconds(), "functionName", event.FuncName, "query", event.Query, "pgError", pgError)
100100
}
101101
if logThresholdQueries {
102-
log.Println(fmt.Sprintf("%s - query time", PgQuerySlowLogPrefix), "duration", queryDuration.Seconds(), "query", event.Query)
102+
log.Println(fmt.Sprintf("%s - query time", PgQuerySlowLogPrefix), "duration", queryDuration.Seconds(), "functionName", event.FuncName, "query", event.Query)
103103
}
104104
if cfg.LogAllQuery {
105-
log.Println("query time", "duration", queryDuration.Seconds(), "query", event.Query)
105+
log.Println("query time", "duration", queryDuration.Seconds(), "functionName", event.FuncName, "query", event.Query)
106106
}
107107
}
108108

109109
var PgQueryDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
110110
Name: "pg_query_duration_seconds",
111111
Help: "Duration of PG queries",
112-
}, []string{"status", "serviceName", "functionName", "errorType"})
112+
}, []string{"status", "serviceName", "errorType"})
113113

114114
func getErrorType(err error) ErrorType {
115115
if err == nil {

git-sensor/vendor/github.com/devtron-labs/common-lib/constants/constants.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

git-sensor/vendor/github.com/devtron-labs/common-lib/utils/SqlUtil.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

image-scanner/Wire.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/devtron-labs/common-lib/monitoring"
2424
client "github.com/devtron-labs/common-lib/pubsub-lib"
2525
"github.com/devtron-labs/image-scanner/api"
26+
"github.com/devtron-labs/image-scanner/pkg/asyncProvider"
2627
"github.com/devtron-labs/image-scanner/pkg/clairService"
2728
"github.com/devtron-labs/image-scanner/pkg/grafeasService"
2829
"github.com/devtron-labs/image-scanner/pkg/klarService"
@@ -38,6 +39,7 @@ import (
3839

3940
func InitializeApp() (*App, error) {
4041
wire.Build(
42+
asyncProvider.AsyncWireSet,
4143
NewApp,
4244
api.NewRouter,
4345
logger.NewSugardLogger,

image-scanner/config.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# IMAGESCANER CONFIGMAP
1+
# IMAGESCANER CONFIGMAP
22

33

44
| Variable Name | Value | Description |
55
|---------------------|----------------------------------------|-------------------------------|
66
| CLAIR_ADDR | clair-dcd.devtroncd:6060 | For connecting to Clair if it's enabled |
7+
| ENABLE_PROGRESSING_SCAN_CHECK | "true" | Flag to enable/disable checking for progressing scans at startup (set to "false" to improve startup performance) |
78
| CLIENT_ID | client-2 | Client ID |
89
| NATS_SERVER_HOST | nats://devtron-nats.devtroncd:4222 | For connecting to NATS |
910
| PG_LOG_QUERY | "false" | PostgreSQL Query Logging (false to disable) |

0 commit comments

Comments
 (0)