Skip to content

Commit 428dfe4

Browse files
authored
impl(bigtable): use default zone and cluster values when not present (#15367)
* impl(bigtable): use default zone and cluster values when not present.
1 parent 12ddf77 commit 428dfe4

File tree

2 files changed

+383
-5
lines changed

2 files changed

+383
-5
lines changed

google/cloud/bigtable/internal/metrics.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ auto constexpr kMeterInstrumentationScopeVersion = "v1";
3939
// time.
4040
LabelMap IntoLabelMap(ResourceLabels const& r, DataLabels const& d,
4141
std::set<std::string> const& filtered_data_labels) {
42-
LabelMap labels = {{"project_id", r.project_id},
43-
{"instance", r.instance},
44-
{"table", r.table},
45-
{"cluster", r.cluster},
46-
{"zone", r.zone}};
42+
LabelMap labels = {
43+
{"project_id", r.project_id},
44+
{"instance", r.instance},
45+
{"table", r.table},
46+
{"cluster", r.cluster.empty() ? "<unspecified>" : r.cluster},
47+
{"zone", r.zone.empty() ? "global" : r.zone}};
4748
std::map<std::string, std::string> data = {{
4849
{"method", d.method},
4950
{"streaming", d.streaming},

0 commit comments

Comments
 (0)