Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ private SpanBuilder addSettingsAttributesToCurrentSpan(SpanBuilder spanBuilder)
spanBuilder =
spanBuilder.setAllAttributes(
Attributes.builder()
.put(
ATTRIBUTE_GCP_RESOURCE_NAME,
String.format(
ATTRIBUTE_GCP_RESOURCE_NAME_FORMAT,
firestoreOptions.getProjectId(),
firestoreOptions.getDatabaseId()))
.put(
ATTRIBUTE_SERVICE_PREFIX + "settings.project_id",
firestoreOptions.getProjectId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public interface TraceUtil {
String ATTRIBUTE_KEY_TRANSACTION_TYPE = "transaction_type";
String ATTRIBUTE_KEY_ATTEMPTS_ALLOWED = "attempts_allowed";
String ATTRIBUTE_KEY_ATTEMPTS_REMAINING = "attempts_remaining";
String ATTRIBUTE_GCP_RESOURCE_NAME = "gcp.resource.name";
String ATTRIBUTE_GCP_RESOURCE_NAME_FORMAT = "//firestore.googleapis.com/projects/%s/databases/%s";

String ENABLE_TRACING_ENV_VAR = "FIRESTORE_ENABLE_TRACING";
String LIBRARY_NAME = "com.google.cloud.firestore";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ void assertHasExpectedAttributes(SpanData spanData, String... additionalExpected
// All Firestore-generated spans have the settings attributes.
List<String> expectedAttributes =
Arrays.asList(
"gcp.resource.name",
"gcp.firestore.memory_utilization",
"gcp.firestore.settings.host",
"gcp.firestore.settings.project_id",
Expand Down