Skip to content

Commit

Permalink
opentelemetry: Missing locality should be empty string
Browse files Browse the repository at this point in the history
From gRFC A78:

> If no locality information is available, the label will be set to the
> empty string.
  • Loading branch information
ejona86 committed May 9, 2024
1 parent a239063 commit 8808d63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void recordFinishedAttempt() {
if (module.localityEnabled) {
String savedLocality = locality;
if (savedLocality == null) {
savedLocality = "unknown";
savedLocality = "";
}
builder.put(LOCALITY_KEY, savedLocality);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ public void clientLocalityMetrics_missing() {

io.opentelemetry.api.common.Attributes clientAttributesWithLocality
= clientAttributes.toBuilder()
.put(LOCALITY_KEY, "unknown")
.put(LOCALITY_KEY, "")
.build();

assertThat(openTelemetryTesting.getMetrics())
Expand Down

0 comments on commit 8808d63

Please sign in to comment.