Skip to content

Commit

Permalink
fix: Updating span event strings (#1539)
Browse files Browse the repository at this point in the history
* fix: Fixing user-facing span names in line with go/firestore-client-trace-catalog

* fix: updating bom dependency version to fix https://github.com/googleapis/java-datastore/actions/runs/10256441634/job/28375496112?pr=1539
  • Loading branch information
jimit-j-shah committed Sep 16, 2024
1 parent 520e351 commit acf19d4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion google-cloud-datastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</parent>
<properties>
<site.installationModule>google-cloud-datastore</site.installationModule>
<opentelemetry.version>1.38.0</opentelemetry.version>
<opentelemetry.version>1.39.0</opentelemetry.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ com.google.datastore.v1.RunQueryResponse runQuery(
: TRANSACTION_OPERATION_EXCEPTION_HANDLER,
getOptions().getClock());
span.addEvent(
spanName,
spanName + " complete.",
new ImmutableMap.Builder<String, Object>()
.put("response_count", response.getBatch().getEntityResultsCount())
.put("doc_count", response.getBatch().getEntityResultsCount())
.put("transactional", isTransactional)
.put("read_consistency", readOptions.getReadConsistency().toString())
.put(
Expand Down Expand Up @@ -535,7 +535,7 @@ com.google.datastore.v1.LookupResponse lookup(
() -> {
com.google.datastore.v1.LookupResponse response = datastoreRpc.lookup(requestPb);
span.addEvent(
spanName,
spanName + " complete.",
new ImmutableMap.Builder<String, Object>()
.put("Received", response.getFoundCount())
.put("Missing", response.getMissingCount())
Expand Down Expand Up @@ -709,7 +709,7 @@ com.google.datastore.v1.CommitResponse commit(
: TRANSACTION_OPERATION_EXCEPTION_HANDLER,
getOptions().getClock());
span.addEvent(
spanName,
spanName + " complete.",
new ImmutableMap.Builder<String, Object>()
.put("doc_count", response.getMutationResultsCount())
.put("transactional", isTransactional)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,13 @@ public void lookupTraceTest() throws Exception {
assertTrue(
hasEvent(
span,
SPAN_NAME_LOOKUP,
SPAN_NAME_LOOKUP + " complete.",
Attributes.builder()
.put("Received", 0)
.put("Missing", 1)
.put("Deferred", 0)
.put("transactional", false)
.put("transaction_id", "")
.build()));
}

Expand Down Expand Up @@ -486,7 +487,7 @@ public void updateTraceTest() throws Exception {
assertTrue(
hasEvent(
spanData,
SPAN_NAME_COMMIT,
SPAN_NAME_COMMIT + " complete.",
Attributes.builder()
.put("doc_count", response.size())
.put("transactional", false)
Expand Down Expand Up @@ -521,7 +522,7 @@ public void deleteTraceTest() throws Exception {
assertTrue(
hasEvent(
spanData,
SPAN_NAME_COMMIT,
SPAN_NAME_COMMIT + " complete.",
Attributes.builder()
.put("doc_count", 1)
.put("transactional", false)
Expand All @@ -543,7 +544,7 @@ public void deleteTraceTest() throws Exception {
assertTrue(
hasEvent(
spanData,
SPAN_NAME_COMMIT,
SPAN_NAME_COMMIT + " complete.",
Attributes.builder()
.put("doc_count", 1)
.put("transactional", false)
Expand Down Expand Up @@ -583,9 +584,9 @@ public void runQueryTraceTest() throws Exception {
assertTrue(
hasEvent(
span,
SPAN_NAME_RUN_QUERY,
SPAN_NAME_RUN_QUERY + " complete.",
Attributes.builder()
.put("response_count", 1)
.put("doc_count", 1)
.put("transactional", false)
.put("read_consistency", "READ_CONSISTENCY_UNSPECIFIED")
.put("more_results", "NO_MORE_RESULTS")
Expand Down Expand Up @@ -674,7 +675,7 @@ public void newTransactionReadWriteTraceTest() throws Exception {
assertTrue(
hasEvent(
span,
SPAN_NAME_TRANSACTION_LOOKUP,
SPAN_NAME_TRANSACTION_LOOKUP + " complete.",
Attributes.builder()
.put("Deferred", 0)
.put("Missing", 1)
Expand All @@ -688,7 +689,7 @@ public void newTransactionReadWriteTraceTest() throws Exception {
assertTrue(
hasEvent(
span,
SPAN_NAME_TRANSACTION_COMMIT,
SPAN_NAME_TRANSACTION_COMMIT + " complete.",
Attributes.builder()
.put("doc_count", 1)
.put("transactional", true)
Expand Down Expand Up @@ -732,9 +733,9 @@ public void newTransactionQueryTest() throws Exception {
assertTrue(
hasEvent(
span,
SPAN_NAME_TRANSACTION_RUN_QUERY,
SPAN_NAME_TRANSACTION_RUN_QUERY + " complete.",
Attributes.builder()
.put("response_count", 1)
.put("doc_count", 1)
.put("transactional", true)
.put("read_consistency", "READ_CONSISTENCY_UNSPECIFIED")
.put("more_results", "NO_MORE_RESULTS")
Expand Down Expand Up @@ -786,7 +787,7 @@ public void newTransactionRollbackTest() throws Exception {
assertTrue(
hasEvent(
span,
SPAN_NAME_TRANSACTION_LOOKUP,
SPAN_NAME_TRANSACTION_LOOKUP + " complete.",
Attributes.builder()
.put("Deferred", 0)
.put("Missing", 0)
Expand Down

0 comments on commit acf19d4

Please sign in to comment.