-
Notifications
You must be signed in to change notification settings - Fork 92
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
[WIP] Implement atomic operations for various metrics using Prometheus as the backend storage #773
Conversation
…he backend storage - Implemented atomic operations for metrics like read/write counts, session counts, etc. - Integrated Prometheus as the backend storage for these metrics. - Note: Metrics are not yet instrumented for telemetry.
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
This commit addresses the issue of failing tests caused by modifications to the BootOptions fields. The tests have been updated to align with the new structure, ensuring they pass as expected.
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #773 +/- ##
==========================================
+ Coverage 40.00% 40.47% +0.46%
==========================================
Files 265 278 +13
Lines 26711 27978 +1267
==========================================
+ Hits 10686 11324 +638
- Misses 14861 15481 +620
- Partials 1164 1173 +9
☔ View full report in Codecov by Sentry. |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
|
||
import ( | ||
"github.com/arana-db/arana/pkg/util/log" |
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.
import style
// Add adds the provided value to the Counter. | ||
func (v *Counter) Add(delta int64) { | ||
if delta < 0 { | ||
log.Warn("[stats] Adding a negative value to a counter, %v should be a gauge instead", v) |
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.
log.Warnf
pushBackends[name] = backend | ||
|
||
if emitPeriod <= 0 { | ||
log.Warn("[stats] push backend got invalid emitPeriod: %v, use default emitPeriod instead: %v", emitPeriod, defaultEmitPeriod) |
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.
log.Warnf
} | ||
err := backend.PushAll() | ||
if err != nil { | ||
log.Warn("Pushing stats to backend %v failed: %v", name, err) |
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.
log.Warnf
for range ticker.C { | ||
backend, ok := pushBackends[name] | ||
if !ok { | ||
log.Fatal(fmt.Sprintf("No PushBackend registered with name %s", name)) |
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.
没有必要用fmt.Sprintf
What this PR does:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: