Skip to content

Commit 2b1b89e

Browse files
authored
Add Owner Tag (#129)
1 parent 11b250c commit 2b1b89e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

spectator/http_client_test.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ TEST(HttpTest, Post) {
8383
{"ipc.result", "success"},
8484
{"ipc.status", "success"},
8585
{"nf.process", "spectatord"},
86+
{"owner", "spectatord"},
8687
};
8788

8889
auto& actual_tags = timer_for_req->MeterId().GetTags();
@@ -146,6 +147,7 @@ TEST(HttpTest, PostUncompressed) {
146147
{"ipc.result", "success"},
147148
{"ipc.status", "success"},
148149
{"nf.process", "spectatord"},
150+
{"owner", "spectatord"},
149151
};
150152

151153
const auto& actual_tags = timer_for_req->MeterId().GetTags();
@@ -199,6 +201,7 @@ TEST(HttpTest, Timeout) {
199201
{"ipc.result", "failure"},
200202
{"ipc.status", "timeout"},
201203
{"nf.process", "spectatord"},
204+
{"owner", "spectatord"},
202205
};
203206
EXPECT_EQ(expected_tags, timer_for_req->MeterId().GetTags());
204207
}
@@ -284,6 +287,7 @@ TEST(HttpTest, Get) {
284287
{"ipc.result", "success"},
285288
{"ipc.status", "success"},
286289
{"nf.process", "spectatord"},
290+
{"owner", "spectatord"},
287291
};
288292

289293
auto timer_id = Id::Of("ipc.client.call", std::move(timer_tags));
@@ -322,6 +326,7 @@ TEST(HttpTest, Get503) {
322326
{"ipc.result", "failure"},
323327
{"ipc.status", "http_error"},
324328
{"nf.process", "spectatord"},
329+
{"owner", "spectatord"},
325330
};
326331
spectator::Tags success_timer_tags{
327332
{"http.method", "GET"},
@@ -332,6 +337,7 @@ TEST(HttpTest, Get503) {
332337
{"ipc.result", "success"},
333338
{"ipc.status", "success"},
334339
{"nf.process", "spectatord"},
340+
{"owner", "spectatord"},
335341
};
336342
auto err_id = Id::Of("ipc.client.call", std::move(err_timer_tags));
337343
auto err_timer = registry.GetTimer(err_id);
@@ -372,6 +378,7 @@ void test_method_header(const std::string& method) {
372378
{"ipc.result", "success"},
373379
{"ipc.status", "success"},
374380
{"nf.process", "spectatord"},
381+
{"owner", "spectatord"},
375382
};
376383
auto timer_id = Id::Of("ipc.client.call", std::move(timer_tags));
377384
auto timer = registry.GetTimer(timer_id);

spectator/log_entry.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class LogEntry {
1313
: registry_{registry},
1414
start_{absl::Now()},
1515
id_{Id::Of("ipc.client.call", {{"nf.process", registry->GetConfig().process_name},
16+
{"owner", "spectatord"},
1617
{"ipc.endpoint", PathFromUrl(url)},
1718
{"http.method", method},
1819
{"http.status", "-1"}})} {}

0 commit comments

Comments
 (0)