Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
catdogpandas committed Nov 28, 2024
1 parent a5586d9 commit 0eff5b3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/prometheus/schedulers/TargetSubscriberScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ bool TargetSubscriberScheduler::operator<(const TargetSubscriberScheduler& other
}

void TargetSubscriberScheduler::OnSubscription(HttpResponse& response, uint64_t timestampMilliSec) {
mSelfMonitor->AddCounter(METRIC_PLUGIN_PROM_SUBSCRIBE_TOTAL,
PromSelfMonitorUnsafe::StatusToString(response.GetStatusCode()));
mSelfMonitor->AddCounter(METRIC_PLUGIN_PROM_SUBSCRIBE_TOTAL, response.GetStatusCode());
mSelfMonitor->AddCounter(METRIC_PLUGIN_PROM_SUBSCRIBE_TIME_MS,
PromSelfMonitorUnsafe::StatusToString(response.GetStatusCode()),
response.GetStatusCode(),
GetCurrentTimeInMilliSeconds() - timestampMilliSec);
if (response.GetStatusCode() == 304) {
// not modified
Expand Down Expand Up @@ -337,8 +336,7 @@ void TargetSubscriberScheduler::InitSelfMonitor(const MetricLabels& defaultLabel
mSelfMonitor = std::make_shared<PromSelfMonitorUnsafe>();
mSelfMonitor->InitMetricManager(sSubscriberMetricKeys, mDefaultLabels);

WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef, MetricCategory::METRIC_CATEGORY_PLUGIN_SOURCE, std::move(mDefaultLabels));
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(mMetricsRecordRef, MetricCategory::METRIC_CATEGORY_PLUGIN_SOURCE, std::move(mDefaultLabels));
mPromSubscriberTargets = mMetricsRecordRef.CreateIntGauge(METRIC_PLUGIN_PROM_SUBSCRIBE_TARGETS);
mTotalDelayMs = mMetricsRecordRef.CreateCounter(METRIC_PLUGIN_TOTAL_DELAY_MS);
}
Expand Down

0 comments on commit 0eff5b3

Please sign in to comment.