Skip to content

Commit

Permalink
chore: update instance
Browse files Browse the repository at this point in the history
  • Loading branch information
catdogpandas committed Jan 9, 2025
1 parent bd68622 commit 32f3a57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions core/prometheus/schedulers/ScrapeScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ ScrapeScheduler::ScrapeScheduler(std::shared_ptr<ScrapeConfig> scrapeConfigPtr,
hash << std::setw(16) << std::setfill('0') << std::hex << labels.Hash();
mHash = mScrapeConfigPtr->mJobName + mInstance + hash.str();
mInterval = mScrapeConfigPtr->mScrapeIntervalSeconds;
if (mTargetLabels.Get(prometheus::INSTANCE).empty()) {
mTargetLabels.Set(prometheus::INSTANCE, mInstance);
}
}

void ScrapeScheduler::OnMetricResult(HttpResponse& response, uint64_t) {
Expand Down
3 changes: 0 additions & 3 deletions core/prometheus/schedulers/TargetSubscriberScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,6 @@ TargetSubscriberScheduler::BuildScrapeSchedulerSet(std::vector<Labels>& targetGr
}

string address = resultLabel.Get(prometheus::ADDRESS_LABEL_NAME);
if (resultLabel.Get(prometheus::INSTANCE).empty()) {
resultLabel.Set(prometheus::INSTANCE, address);
}

auto m = address.find(':');
if (m == string::npos) {
Expand Down

0 comments on commit 32f3a57

Please sign in to comment.