Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

// NewKvrocksExporter returns a new exporter of Kvrocks metrics.
func NewKvrocksExporter(kvrocksURI string, opts Options) (*Exporter, error) {
log.Debugf("NewKvrocksExporter options: %#v", opts)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by an access to Password
flows to a logging call.
Sensitive data returned by an access to PasswordMap flows to a logging call.

e := &Exporter{
kvrocksAddr: kvrocksURI,
Expand Down Expand Up @@ -193,7 +193,7 @@
"commands_duration_seconds_bucket": {txt: `Histogram of the amount of time in seconds spent per command`, lbls: []string{"cmd"}},
"commands_duration_seconds_total": {txt: `Total amount of time in seconds spent per command`, lbls: []string{"cmd"}},
"commands_total": {txt: `Total number of calls per command`, lbls: []string{"cmd"}},
"connected_slave_lag_seconds": {txt: "Lag of connected slave", lbls: []string{"slave_ip", "slave_port", "slave_state"}},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will cause a compatibility issue for other users. It should be good to keep the same name with Redis but has different meaning.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding 'second' may lead to ambiguity in understanding

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tclxjing8-li Yes, I totally agree with your point. Perhaps we could change the description in txt field to clarify this. What do you think?

"connected_slave_lag": {txt: "Lag of connected slave", lbls: []string{"slave_ip", "slave_port", "slave_state"}},
"connected_slave_offset_bytes": {txt: "Offset of connected slave", lbls: []string{"slave_ip", "slave_port", "slave_state"}},
"db_avg_ttl_seconds": {txt: "Avg TTL in seconds", lbls: []string{"db"}},
"db_keys": {txt: "Total number of keys by DB", lbls: []string{"db"}},
Expand Down
4 changes: 4 additions & 0 deletions exporter/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func (e *Exporter) scrapeHandler(w http.ResponseWriter, r *http.Request) {

opts := e.options

if password := r.URL.Query().Get("password"); password != "" {
opts.Password = password
}

registry := prometheus.NewRegistry()
opts.Registry = registry

Expand Down
2 changes: 1 addition & 1 deletion exporter/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (e *Exporter) handleMetricsReplication(ch chan<- prometheus.Metric, masterH

if slaveLag > -1 {
e.registerConstMetricGauge(ch,
"connected_slave_lag_seconds",
"connected_slave_lag",
slaveLag,
slaveIP, slavePort, slaveState,
)
Expand Down
Loading