You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2026/09/24 16:22:02 UTC
(causeway) 08/41: CAUSEWAY-4062: preserves semantic span identifiers
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch CAUSEWAY-4066
in repository https://gitbox.apache.org/repos/asf/causeway.git
commit d5ecd49a1f3d93d4e2e3048efe9eb8dfc2453384
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Sep 23 16:59:53 2026 +0100
CAUSEWAY-4062: preserves semantic span identifiers
---
adoc/micrometer-tracing-operations.adoc | 35 ++++---
.../CausewayObservationConfiguration.java | 3 +-
.../observation/CausewayObservationNaming.java | 111 ++++++++++++---------
.../CausewayTracingObservationHandler.java | 45 +++++++++
.../observation/CausewayObservationNamingTest.java | 69 +++++++++----
.../CausewayTracingObservationHandlerTest.java | 60 +++++++++++
.../executor/MemberExecutorServiceDefault.java | 13 ++-
...actionFailureIsRecordedAndRethrown.approved.txt | 4 +-
...tionHasStableNameTagsAndRootParent.approved.txt | 4 +-
...emberExecutorServiceDefaultObservationTest.java | 68 +++++++++++++
.../changes/improve-semantic-span-names/design.md | 57 +++++++----
.../improve-semantic-span-names/proposal.md | 12 ++-
.../specs/semantic-span-display-naming/spec.md | 40 ++++++--
.../specs/wicket-region-render-observation/spec.md | 48 +++++++--
.../changes/improve-semantic-span-names/tasks.md | 25 +++++
.../improve-semantic-span-names/validation.md | 26 +++--
.../tracing/MicrometerTracingAgentFixture.java | 48 +++++++--
.../MicrometerTracingCompatibilityTest.java | 61 +++++++++--
.../observation/WicketRenderObservationTest.java | 42 ++++++--
.../WicketRenderObservationDescriptor.java | 25 +++--
20 files changed, 618 insertions(+), 178 deletions(-)
diff --git a/adoc/micrometer-tracing-operations.adoc b/adoc/micrometer-tracing-operations.adoc
index 2a73e41fa63..61fdcd01172 100644
--- a/adoc/micrometer-tracing-operations.adoc
+++ b/adoc/micrometer-tracing-operations.adoc
@@ -78,7 +78,7 @@ Select `my-causeway-app-local` in Jaeger and look for these ordered boundaries:
----
HTTP
-> causeway.root.interaction
- -> invoke update-name on customer
+ -> invoke demo.Customer#updateName
-> JDBC
----
@@ -218,14 +218,17 @@ See link:https://learn.microsoft.com/en-us/azure/container-apps/environment-vari
With the `observation` profile active, Causeway adds two core semantic observations:
* `causeway.root.interaction` covers one top-level Causeway interaction and retains that stable span display name;
-* `causeway.action.invocation` covers an action invocation and uses a compact display name such as `invoke update-name on customer`.
+* `causeway.action.invocation` covers an action invocation and uses a display name such as `invoke demo.Customer#updateName`.
The stable observation name remains `causeway.action.invocation` even though the contextual name becomes the exported tracing span display name.
Action spans carry the bounded attributes `causeway.action.id` and `causeway.execution.initiatedBy`.
-The full `causeway.action.id` is authoritative for filtering and disambiguates actions whose compact display names are equal or truncated.
+Mixed-in actions use their domain-facing logical member identity rather than an implementation identity such as `ApplicationUser_updateEmailAddress#act`.
+The full `causeway.action.id` is authoritative for filtering and disambiguates actions whose display names omit a namespace or are truncated.
-Contextual names use normalized, lower-hyphen forms of static logical type and member names rather than localized friendly names.
-Micrometer Tracing 1.0.12 limits its normalized display name to 50 characters, so tracing backends can show a truncated contextual name while the canonical attributes remain complete.
+Contextual names preserve the declared casing of static logical type, member, and layout identifiers rather than using localized friendly names or lower-hyphen normalization.
+Causeway limits each semantic contextual name to 50 characters.
+For page, invocation, and prompt names, Causeway first tries the full logical identifier, then omits the logical-type namespace if necessary, and finally truncates at 50 characters.
+For example, `invoke isisExtSecMan.ApplicationUser#updateEmailAddress` falls back to `invoke ApplicationUser#updateEmailAddress`.
Causeway does not add action arguments, return values, target instance identifiers, object titles, bookmarks, user names, tenancy tokens, or other instance-specific application data to names or attributes on these semantic spans.
=== Wicket Entity Page Rendering
@@ -234,28 +237,28 @@ When the Wicket viewer renders an entity page, Causeway adds semantic spans for
[source,text]
----
-render customer
-├── causeway.wicket.fieldset.render
-│ ├── causeway.wicket.property.render
-│ └── causeway.wicket.action.render
-├── causeway.wicket.collection.render
-├── causeway.wicket.action.render
-└── prompt update-name on customer
+render demo.Customer
+├── render fieldset identity
+│ ├── render property emailAddress
+│ └── render action updateEmailAddress
+├── render collection roles
+└── prompt demo.Customer#updateEmailAddress
----
Ajax responses create spans only for the instrumented regions included in the partial render, so an Ajax trace need not contain `causeway.wicket.page.render`.
Automatic JDBC spans become descendants of the active region span when database work occurs during that region's rendering.
-The entity-page observation retains the stable name `causeway.wicket.page.render` but uses a compact contextual display name such as `render customer`.
-Fieldset, property, collection, and action-button observations retain their stable names as display names.
+The entity-page observation retains the stable name `causeway.wicket.page.render` but uses a contextual display name such as `render demo.Customer`.
+Fieldset, property, collection, and action-button observations retain their stable observation names but use contextual display names of the forms `render fieldset <fieldsetId>`, `render property <propertyId>`, `render collection <collectionId>`, and `render action <actionId>`.
+The unnamed fieldset is displayed as `render fieldset default`.
-A parameterized action prompt creates one `causeway.wicket.action.prompt.render` observation around the enclosing prompt panel's actual render callback, with a compact display name such as `prompt update-name on customer`.
+A parameterized action prompt creates one `causeway.wicket.action.prompt.render` observation around the enclosing prompt panel's actual render callback, with a display name such as `prompt demo.Customer#updateName`.
The same semantic boundary applies to inline, modal, and sidebar presentation styles.
It does not cover defaults, choices, validation, visibility, usability, authorization, or other prompt preparation completed outside that render callback.
Individual action parameters do not create property render spans.
Wicket spans use `causeway.object.type` together with the applicable bounded attribute `causeway.fieldset.id`, `causeway.property.id`, `causeway.collection.id`, or `causeway.action.id`.
-The full canonical attributes remain authoritative when a page or prompt contextual name is compact, ambiguous, or truncated.
+The full canonical attributes remain authoritative when any contextual name omits a namespace, is ambiguous, or is truncated.
These identifiers describe static application structure.
Causeway does not attach property values, rendered labels, object titles, bookmarks, action arguments, user names, tenancy tokens, collection-row identities, or generated Wicket component paths.
diff --git a/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayObservationConfiguration.java b/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayObservationConfiguration.java
index cd24d2d5319..be2be5a1dde 100644
--- a/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayObservationConfiguration.java
+++ b/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayObservationConfiguration.java
@@ -27,7 +27,6 @@
import io.micrometer.observation.ObservationRegistry;
import io.micrometer.tracing.Tracer;
-import io.micrometer.tracing.handler.DefaultTracingObservationHandler;
import io.micrometer.tracing.otel.bridge.OtelBaggageManager;
import io.micrometer.tracing.otel.bridge.OtelCurrentTraceContext;
import io.micrometer.tracing.otel.bridge.OtelTracer;
@@ -77,7 +76,7 @@ public ObservationRegistry activeCausewayObservationRegistry() {
final ObservationRegistry observationRegistry = ObservationRegistry.create();
observationRegistry.observationConfig()
- .observationHandler(new DefaultTracingObservationHandler(tracer));
+ .observationHandler(new CausewayTracingObservationHandler(tracer));
return observationRegistry;
}
}
diff --git a/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayObservationNaming.java b/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayObservationNaming.java
index fb696c4a56c..807203e149c 100644
--- a/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayObservationNaming.java
+++ b/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayObservationNaming.java
@@ -27,28 +27,84 @@
*/
public final class CausewayObservationNaming {
+ public static final int MAX_CONTEXTUAL_NAME_LENGTH = 50;
+
private CausewayObservationNaming() {}
public static String forType(
final String operation,
final String logicalTypeName) {
- return token(operation) + " " + token(simpleTypeName(logicalTypeName));
+ final String prefix = requireText(operation, "operation") + " ";
+ final String typeName = requireText(logicalTypeName, "logicalTypeName");
+ final String fullName = prefix + typeName;
+ return fullName.length() <= MAX_CONTEXTUAL_NAME_LENGTH
+ ? fullName
+ : bounded(prefix + simpleTypeName(typeName));
}
public static String forMember(
final String operation,
final String logicalTypeName,
final String memberLogicalName) {
- return token(operation)
- + " " + token(memberLogicalName)
- + " on " + token(simpleTypeName(logicalTypeName));
+ final String typeName = requireText(logicalTypeName, "logicalTypeName");
+ final String memberName = requireText(memberLogicalName, "memberLogicalName");
+ return forLogicalMember(operation, typeName + "#" + memberName);
+ }
+
+ public static String forLogicalMember(
+ final String operation,
+ final String logicalMemberIdentifier) {
+ final String prefix = requireText(operation, "operation") + " ";
+ final String identifier = requireText(
+ logicalMemberIdentifier, "logicalMemberIdentifier");
+ final String fullName = prefix + identifier;
+ if(fullName.length() <= MAX_CONTEXTUAL_NAME_LENGTH) {
+ return fullName;
+ }
+
+ final int memberSeparator = identifier.indexOf('#');
+ if(memberSeparator < 1 || memberSeparator + 1 >= identifier.length()) {
+ return bounded(fullName);
+ }
+ final String typeName = identifier.substring(0, memberSeparator);
+ final String memberName = identifier.substring(memberSeparator + 1);
+ return bounded(prefix + simpleTypeName(typeName) + "#" + memberName);
+ }
+
+ public static String forRenderRegion(
+ final String region,
+ final String identifier) {
+ return bounded("render "
+ + requireText(region, "region")
+ + " " + regionIdentifier(identifier));
+ }
+
+ public static String bounded(final String contextualName) {
+ final String name = requireText(contextualName, "contextualName");
+ return name.length() <= MAX_CONTEXTUAL_NAME_LENGTH
+ ? name
+ : name.substring(0, MAX_CONTEXTUAL_NAME_LENGTH);
+ }
+
+ private static String regionIdentifier(final String identifier) {
+ final String canonicalIdentifier = requireText(identifier, "identifier");
+ if("<default>".equals(canonicalIdentifier)) {
+ return "default";
+ }
+ final int memberSeparator = canonicalIdentifier.lastIndexOf('#');
+ final String memberName = memberSeparator >= 0
+ ? canonicalIdentifier.substring(memberSeparator + 1)
+ : canonicalIdentifier;
+ final int parameterSeparator = memberName.indexOf('(');
+ return parameterSeparator >= 0
+ ? memberName.substring(0, parameterSeparator)
+ : memberName;
}
private static String simpleTypeName(final String logicalTypeName) {
- final String typeName = requireText(logicalTypeName, "logicalTypeName");
int separator = -1;
- for (int i = 0; i < typeName.length(); i++) {
- switch (typeName.charAt(i)) {
+ for (int i = 0; i < logicalTypeName.length(); i++) {
+ switch (logicalTypeName.charAt(i)) {
case '.':
case '/':
case '\\':
@@ -60,44 +116,9 @@ private static String simpleTypeName(final String logicalTypeName) {
break;
}
}
- return separator >= 0 && separator + 1 < typeName.length()
- ? typeName.substring(separator + 1)
- : typeName;
- }
-
- private static String token(final String value) {
- final String text = requireText(value, "contextual name token");
- final StringBuilder normalized = new StringBuilder(text.length());
- boolean separatorPending = false;
- char previous = 0;
- for (int i = 0; i < text.length(); i++) {
- final char current = text.charAt(i);
- if(Character.isLetterOrDigit(current)) {
- if(normalized.length() > 0
- && (separatorPending
- || Character.isUpperCase(current)
- && (Character.isLowerCase(previous)
- || Character.isDigit(previous)))) {
- appendSeparator(normalized);
- }
- normalized.append(Character.toLowerCase(current));
- separatorPending = false;
- previous = current;
- } else {
- separatorPending = normalized.length() > 0;
- previous = 0;
- }
- }
- if(normalized.length() == 0) {
- throw new IllegalArgumentException("contextual name token must contain a letter or digit");
- }
- return normalized.toString();
- }
-
- private static void appendSeparator(final StringBuilder normalized) {
- if(normalized.charAt(normalized.length() - 1) != '-') {
- normalized.append('-');
- }
+ return separator >= 0 && separator + 1 < logicalTypeName.length()
+ ? logicalTypeName.substring(separator + 1)
+ : logicalTypeName;
}
private static String requireText(final String value, final String name) {
diff --git a/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayTracingObservationHandler.java b/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayTracingObservationHandler.java
new file mode 100644
index 00000000000..f2c50543317
--- /dev/null
+++ b/core/config/src/main/java/org/apache/causeway/core/config/observation/CausewayTracingObservationHandler.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.causeway.core.config.observation;
+
+import io.micrometer.observation.Observation;
+import io.micrometer.tracing.Tracer;
+import io.micrometer.tracing.handler.DefaultTracingObservationHandler;
+
+/**
+ * Preserves Causeway logical-identifier casing in bounded tracing span names.
+ *
+ * @since 2.2
+ */
+public final class CausewayTracingObservationHandler
+extends DefaultTracingObservationHandler {
+
+ public CausewayTracingObservationHandler(final Tracer tracer) {
+ super(tracer);
+ }
+
+ @Override
+ public String getSpanName(final Observation.Context context) {
+ final String contextualName = context.getContextualName();
+ return CausewayObservationNaming.bounded(
+ contextualName != null && !contextualName.trim().isEmpty()
+ ? contextualName
+ : context.getName());
+ }
+}
diff --git a/core/config/src/test/java/org/apache/causeway/core/config/observation/CausewayObservationNamingTest.java b/core/config/src/test/java/org/apache/causeway/core/config/observation/CausewayObservationNamingTest.java
index 67926fb723d..2b343c1aa10 100644
--- a/core/config/src/test/java/org/apache/causeway/core/config/observation/CausewayObservationNamingTest.java
+++ b/core/config/src/test/java/org/apache/causeway/core/config/observation/CausewayObservationNamingTest.java
@@ -26,41 +26,72 @@
class CausewayObservationNamingTest {
@Test
- void typeNameIsCompactAndNormalized() {
- assertEquals("render customer",
- CausewayObservationNaming.forType("render", "demo.Customer"));
- assertEquals("render customer",
- CausewayObservationNaming.forType("render", "other/context:Customer"));
+ void logicalTypeNamePreservesNamespaceAndCaseWhenItFits() {
+ assertEquals("render isisExtSecMan.ApplicationUser",
+ CausewayObservationNaming.forType(
+ "render", "isisExtSecMan.ApplicationUser"));
}
@Test
- void memberNameIsOperationFirstAndNormalized() {
- assertEquals("invoke update-name on customer",
- CausewayObservationNaming.forMember(
- "invoke", "demo.Customer", "updateName"));
- assertEquals("prompt create-url on customer",
+ void logicalTypeNameFallsBackToSimpleTypeBeforeTruncating() {
+ assertEquals("render ApplicationUser",
+ CausewayObservationNaming.forType(
+ "render",
+ "aVeryLongApplicationNamespaceThatExceedsTheLimit.ApplicationUser"));
+ }
+
+ @Test
+ void logicalMemberIdentifierPreservesNamespaceAndCaseWhenItFits() {
+ assertEquals("invoke demo.Customer#updateName",
+ CausewayObservationNaming.forLogicalMember(
+ "invoke", "demo.Customer#updateName"));
+ assertEquals("prompt demo.Customer#createURL",
CausewayObservationNaming.forMember(
"prompt", "demo.Customer", "createURL"));
}
@Test
- void compactNamesCanCollideWhileCanonicalIdentifiersRemainExternal() {
- assertEquals(
- CausewayObservationNaming.forMember(
- "invoke", "sales.Customer", "updateName"),
- CausewayObservationNaming.forMember(
- "invoke", "support.Customer", "updateName"));
+ void logicalMemberIdentifierFallsBackToSimpleTypeBeforeTruncating() {
+ assertEquals("invoke ApplicationUser#updateEmailAddress",
+ CausewayObservationNaming.forLogicalMember(
+ "invoke",
+ "isisExtSecMan.ApplicationUser#updateEmailAddress"));
}
@Test
- void longNameKeepsDiagnosticOperationAndMemberBeforeType() {
+ void namespaceFreeNameIsTruncatedAtFiftyCharacters() {
final String contextualName = CausewayObservationNaming.forMember(
"invoke",
"demo.CustomerWithAnUnusuallyLongLogicalTypeName",
"performAnUnusuallyLongAdministrativeOperation");
+ assertEquals(CausewayObservationNaming.MAX_CONTEXTUAL_NAME_LENGTH,
+ contextualName.length());
assertTrue(contextualName.startsWith(
- "invoke perform-an-unusually-long-administrative-operation on "));
- assertTrue(contextualName.length() > 50);
+ "invoke CustomerWithAnUnusuallyLongLogicalTypeName#"));
+ }
+
+ @Test
+ void exactlyFiftyCharactersAreNotAltered() {
+ final String contextualName = "render " + "X".repeat(43);
+
+ assertEquals(contextualName,
+ CausewayObservationNaming.bounded(contextualName));
+ }
+
+ @Test
+ void renderRegionsUseMemberIdsAndDefaultFieldsetName() {
+ assertEquals("render fieldset default",
+ CausewayObservationNaming.forRenderRegion(
+ "fieldset", "<default>"));
+ assertEquals("render property emailAddress",
+ CausewayObservationNaming.forRenderRegion(
+ "property", "isisExtSecMan.ApplicationUser#emailAddress"));
+ assertEquals("render collection roles",
+ CausewayObservationNaming.forRenderRegion(
+ "collection", "isisExtSecMan.ApplicationUser#roles"));
+ assertEquals("render action updateEmailAddress",
+ CausewayObservationNaming.forRenderRegion(
+ "action", "isisExtSecMan.ApplicationUser#updateEmailAddress()"));
}
}
diff --git a/core/config/src/test/java/org/apache/causeway/core/config/observation/CausewayTracingObservationHandlerTest.java b/core/config/src/test/java/org/apache/causeway/core/config/observation/CausewayTracingObservationHandlerTest.java
new file mode 100644
index 00000000000..9960b1f4527
--- /dev/null
+++ b/core/config/src/test/java/org/apache/causeway/core/config/observation/CausewayTracingObservationHandlerTest.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.causeway.core.config.observation;
+
+import org.junit.jupiter.api.Test;
+
+import io.micrometer.observation.Observation;
+import io.micrometer.tracing.Tracer;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.mockito.Mockito.mock;
+
+class CausewayTracingObservationHandlerTest {
+
+ private final CausewayTracingObservationHandler handler =
+ new CausewayTracingObservationHandler(mock(Tracer.class));
+
+ @Test
+ void preservesContextualNameCasingAndPunctuation() {
+ final Observation.Context context = new Observation.Context();
+ context.setName("causeway.action.invocation");
+ context.setContextualName("invoke ApplicationUser#updateEmailAddress");
+
+ assertEquals("invoke ApplicationUser#updateEmailAddress",
+ handler.getSpanName(context));
+ }
+
+ @Test
+ void fallsBackToStableObservationName() {
+ final Observation.Context context = new Observation.Context();
+ context.setName("causeway.root.interaction");
+
+ assertEquals("causeway.root.interaction", handler.getSpanName(context));
+ }
+
+ @Test
+ void defensivelyBoundsExternalContextualNames() {
+ final Observation.Context context = new Observation.Context();
+ context.setName("causeway.test");
+ context.setContextualName("X".repeat(60));
+
+ assertEquals("X".repeat(50), handler.getSpanName(context));
+ }
+}
diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefault.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefault.java
index b1ad81fc07d..96a1edc35c3 100644
--- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefault.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefault.java
@@ -143,14 +143,13 @@ public Optional<InteractionInternal> getInteraction() {
public ManagedObject invokeAction(
final @NonNull ActionExecutor actionExecutor) {
- final var actionIdentifier = actionExecutor.getOwningAction().getFeatureIdentifier();
- final String actionId = actionIdentifier.getLogicalIdentityString("#");
+ final String logicalMemberIdentifier = IdentifierUtil.logicalMemberIdentifierFor(
+ actionExecutor.getHead(), actionExecutor.getOwningAction());
+ final String canonicalActionId = logicalMemberIdentifier + "()";
return observationProvider().get(ACTION_OBSERVATION_NAME)
- .contextualName(CausewayObservationNaming.forMember(
- "invoke",
- actionIdentifier.logicalTypeName(),
- actionIdentifier.memberLogicalName()))
- .lowCardinalityKeyValue(ACTION_ID_TAG, actionId)
+ .contextualName(CausewayObservationNaming.forLogicalMember(
+ "invoke", logicalMemberIdentifier))
+ .lowCardinalityKeyValue(ACTION_ID_TAG, canonicalActionId)
.lowCardinalityKeyValue(
INITIATED_BY_TAG,
actionExecutor.getInteractionInitiatedBy().name())
diff --git a/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.actionFailureIsRecordedAndRethrown.approved.txt b/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.actionFailureIsRecordedAndRethrown.approved.txt
index 15a9199f9be..03c5ebb12e8 100644
--- a/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.actionFailureIsRecordedAndRethrown.approved.txt
+++ b/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.actionFailureIsRecordedAndRethrown.approved.txt
@@ -7,10 +7,10 @@ This approval checks:
- No current observation remains after failure.
Observed lifecycle:
-1. onStart(name=causeway.action.invocation, contextualName=invoke update-name on customer, parent=<none>, causeway.action.id=demo.Customer#updateName(), causeway.execution.initiatedBy=PASS_THROUGH)
+1. onStart(name=causeway.action.invocation, contextualName=invoke demo.Customer#updateName, parent=<none>, causeway.action.id=demo.Customer#updateName(), causeway.execution.initiatedBy=PASS_THROUGH)
2. onScopeOpened(name=causeway.action.invocation)
3. onScopeClosed(name=causeway.action.invocation)
4. onError(type=ReflectiveActionException, message=IllegalStateException thrown while invoking fail action failed)
-5. onStop(name=causeway.action.invocation, contextualName=invoke update-name on customer)
+5. onStop(name=causeway.action.invocation, contextualName=invoke demo.Customer#updateName)
6. failure returned to caller: ReflectiveActionException: IllegalStateException thrown while invoking fail action failed
7. current observation after failure: <none>
\ No newline at end of file
diff --git a/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.actionObservationHasStableNameTagsAndRootParent.approved.txt b/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.actionObservationHasStableNameTagsAndRootParent.approved.txt
index df4d7e488ee..9d54c86ce7a 100644
--- a/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.actionObservationHasStableNameTagsAndRootParent.approved.txt
+++ b/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.actionObservationHasStableNameTagsAndRootParent.approved.txt
@@ -10,9 +10,9 @@ This approval checks:
Observed lifecycle:
1. onStart(name=test root, contextualName=null, parent=<none>, causeway.action.id=<absent>, causeway.execution.initiatedBy=<absent>)
2. onScopeOpened(name=test root)
-3. onStart(name=causeway.action.invocation, contextualName=invoke update-name on customer, parent=test root, causeway.action.id=demo.Customer#updateName(), causeway.execution.initiatedBy=PASS_THROUGH)
+3. onStart(name=causeway.action.invocation, contextualName=invoke demo.Customer#updateName, parent=test root, causeway.action.id=demo.Customer#updateName(), causeway.execution.initiatedBy=PASS_THROUGH)
4. onScopeOpened(name=causeway.action.invocation)
5. onScopeClosed(name=causeway.action.invocation)
-6. onStop(name=causeway.action.invocation, contextualName=invoke update-name on customer)
+6. onStop(name=causeway.action.invocation, contextualName=invoke demo.Customer#updateName)
7. onScopeClosed(name=test root)
8. onStop(name=test root, contextualName=null)
\ No newline at end of file
diff --git a/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.java b/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.java
index 65e8ae3ea70..99efdd19014 100644
--- a/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.java
+++ b/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/executor/MemberExecutorServiceDefaultObservationTest.java
@@ -44,15 +44,18 @@
import org.apache.causeway.core.metamodel.facetapi.FacetHolder;
import org.apache.causeway.core.metamodel.facets.actions.action.invocation.ActionInvocationFacetAbstract;
import org.apache.causeway.core.metamodel.interactions.InteractionHead;
+import org.apache.causeway.core.metamodel.interactions.managed.ActionInteractionHead;
import org.apache.causeway.core.metamodel.object.ManagedObject;
import org.apache.causeway.core.metamodel.objectmanager.ObjectManager;
import org.apache.causeway.core.metamodel.services.publishing.CommandPublisher;
+import org.apache.causeway.core.metamodel.spec.ObjectSpecification;
import org.apache.causeway.core.metamodel.spec.feature.ObjectAction;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -87,6 +90,23 @@ void actionObservationHasStableNameTagsAndRootParent() throws Exception {
handler.events));
}
+ @Test
+ void mixedInActionUsesDomainFacingLogicalIdentity() throws Exception {
+ final RecordingHandler handler = new RecordingHandler();
+ final ObservationRegistry registry = registryWith(handler);
+ final ManagedObject expected = mock(ManagedObject.class);
+ final MemberExecutorServiceDefault service = newService(registry);
+
+ final ManagedObject actual = service.invokeAction(
+ mixedInActionExecutor(expected));
+
+ assertSame(expected, actual);
+ assertTrue(handler.events.stream().anyMatch(event -> event.contains(
+ "contextualName=invoke demo.ApplicationUser#updateEmailAddress")));
+ assertTrue(handler.events.stream().anyMatch(event -> event.contains(
+ "causeway.action.id=demo.ApplicationUser#updateEmailAddress()")));
+ }
+
@Test
void actionFailureIsRecordedAndRethrown() throws Exception {
final RecordingHandler handler = new RecordingHandler();
@@ -163,7 +183,10 @@ private static ActionExecutor actionExecutor(
final FacetHolder facetHolder = mock(FacetHolder.class);
when(facetHolder.getObjectManager()).thenReturn(objectManager);
+ final ObjectSpecification declaringType = mock(ObjectSpecification.class);
+ when(declaringType.logicalTypeName()).thenReturn("demo.Customer");
final ObjectAction owningAction = mock(ObjectAction.class);
+ when(owningAction.getDeclaringType()).thenReturn(declaringType);
when(owningAction.getFeatureIdentifier()).thenReturn(Identifier.actionIdentifier(
LogicalType.eager(InvocationTarget.class, "demo.Customer"),
"updateName"));
@@ -180,6 +203,51 @@ private static ActionExecutor actionExecutor(
mock(ActionInvocationFacetAbstract.class));
}
+ private static ActionExecutor mixedInActionExecutor(
+ final ManagedObject adaptedResult) throws Exception {
+ final InvocationTarget targetPojo = new InvocationTarget();
+ final ManagedObject target = mock(ManagedObject.class);
+ when(target.getPojo()).thenReturn(targetPojo);
+
+ final ObjectSpecification mixeeSpec = mock(ObjectSpecification.class);
+ when(mixeeSpec.logicalTypeName()).thenReturn("demo.ApplicationUser");
+ final ManagedObject owner = mock(ManagedObject.class);
+ when(owner.objSpec()).thenReturn(mixeeSpec);
+
+ final ObjectAction mixedInAction = mock(ObjectAction.class);
+ when(mixedInAction.getFeatureIdentifier()).thenReturn(Identifier.actionIdentifier(
+ LogicalType.eager(InvocationTarget.class, "demo.ApplicationUser"),
+ "updateEmailAddress"));
+ final ActionInteractionHead head = mock(ActionInteractionHead.class);
+ when(head.getTarget()).thenReturn(target);
+ when(head.getOwner()).thenReturn(owner);
+ when(head.getMetaModel()).thenReturn(mixedInAction);
+
+ final ObjectManager objectManager = mock(ObjectManager.class);
+ when(objectManager.adapt("ok")).thenReturn(adaptedResult);
+ final FacetHolder facetHolder = mock(FacetHolder.class);
+ when(facetHolder.getObjectManager()).thenReturn(objectManager);
+
+ final ObjectAction owningAction = mock(ObjectAction.class);
+ when(owningAction.isDeclaredOnMixin()).thenReturn(true);
+ when(owningAction.getFeatureIdentifier()).thenReturn(Identifier.actionIdentifier(
+ LogicalType.eager(
+ InvocationTarget.class,
+ "demo.ApplicationUser_updateEmailAddress"),
+ "act"));
+
+ return new ActionExecutor(
+ mock(MetaModelContext.class),
+ facetHolder,
+ InteractionInitiatedBy.PASS_THROUGH,
+ owningAction,
+ _MethodFacades.testing.regular(
+ InvocationTarget.class.getDeclaredMethod("succeed")),
+ head,
+ Can.empty(),
+ mock(ActionInvocationFacetAbstract.class));
+ }
+
private static String report(
final String scenario,
final List<String> checks,
diff --git a/openspec/changes/improve-semantic-span-names/design.md b/openspec/changes/improve-semantic-span-names/design.md
index 60f0c1a818e..e2e0fd6b3fc 100644
--- a/openspec/changes/improve-semantic-span-names/design.md
+++ b/openspec/changes/improve-semantic-span-names/design.md
@@ -4,7 +4,8 @@ Causeway creates Micrometer observations with stable names such as `causeway.act
It currently assigns the same value as the contextual name, so tracing backends display generic operation names even though the observations carry canonical logical identifiers as attributes.
Micrometer Observation distinguishes the stable observation name from the contextual name used by its tracing handler.
-In the pinned Micrometer Tracing 1.0.12 implementation, the tracing handler reads the contextual name when the observation stops, converts uppercase characters to lower-hyphen form, and truncates the result to 50 characters.
+The pinned Micrometer Tracing 1.0.12 `DefaultTracingObservationHandler` converts contextual names to lower-hyphen form and truncates them to 50 characters.
+That transformation obscures Causeway logical identifiers such as `isisExtSecMan.ApplicationUser#updateEmailAddress`, so Causeway needs a narrowly specialized handler for its dedicated observation registry.
Action invocation instrumentation already resolves the owning action's `FeatureIdentifier` before opening the observation.
Wicket entity pages already resolve the logical object type, and action prompt components retain an `ActionModel` that resolves the prompted action's `FeatureIdentifier`.
@@ -14,16 +15,19 @@ These are bounded metamodel identifiers, unlike object titles, bookmarks, argume
**Goals:**
-- Make coarse Causeway semantic spans understandable while scanning a trace tree.
+- Make Causeway semantic spans understandable while scanning a trace tree.
+- Preserve logical identifier casing in exported span display names.
+- Resolve mixed-in action invocations to their domain-facing logical member identifiers.
- Preserve stable observation names for conventions and any metric handling.
- Keep full canonical logical identifiers in existing span attributes.
- Add one enclosing render span for a Wicket action prompt without observing individual parameters.
+- Give fieldset, property, collection, and action-button render spans meaningful member-level display names.
- Preserve no-op behavior, Java-agent-owned trace context, and existing render lifecycle safety.
**Non-Goals:**
- Rename `causeway.root.interaction` according to request outcome.
-- Dynamically name fieldset, property, collection, or action-button render spans.
+- Include object-instance or runtime values in fieldset, property, collection, or action-button render span names.
- Observe prompt preparation, default calculation, choices calculation, validation, authorization, or action invocation as part of prompt rendering.
- Add instance identifiers, values, user data, or localized labels to telemetry.
- Change the OpenTelemetry SDK, exporter, collector, sampling policy, or dependencies.
@@ -38,24 +42,31 @@ Only the Micrometer contextual name will include a compact domain identifier.
This preserves machine-oriented classification while improving the span name rendered by tracing backends.
Replacing the observation name itself was rejected because it would unnecessarily increase metric and convention cardinality.
-### Use compact operation-first display names
+### Use logical-identifier display names with deterministic fallback
-Contextual names will use these conceptual forms:
+Contextual names will use these forms:
-- `invoke <action-member> on <simple-logical-type>` for action invocation;
-- `render <simple-logical-type>` for an entity page;
-- `prompt <action-member> on <simple-logical-type>` for action-prompt rendering.
+- `invoke <logical-type-name>#<action-id>` for action invocation;
+- `prompt <logical-type-name>#<action-id>` for action-prompt rendering;
+- `render <logical-type-name>` for an entity page;
+- `render fieldset <fieldset-id>` for a fieldset, using `default` for the unnamed fieldset;
+- `render property <property-id>` for a property;
+- `render collection <collection-id>` for a collection;
+- `render action <action-id>` for an action button.
-The implementation will derive the simple type from the final segment of the logical type name and will use the action's logical member name rather than a friendly or localized label.
-Display tokens will be normalized to lower-hyphen form before assignment so that the resulting name is predictable under Micrometer's normalization.
-The operation and action member appear before the type so that the most diagnostic information survives Micrometer's 50-character limit.
+Logical type, member, and layout identifiers retain their declared casing and are not converted to lower-hyphen form.
+Friendly names and localized labels remain excluded.
-The full logical type and action identity remain available in `causeway.object.type` and `causeway.action.id` and are authoritative when a compact display name is ambiguous or truncated.
-Using full logical identities directly in contextual names was rejected because namespace prefixes can consume the complete display-name limit before the member name appears.
+The display-name builder first tries the full logical type or logical member identifier.
+If a type-based display name exceeds 50 characters, it removes the logical type namespace and tries the simple logical type with the same member id where applicable.
+If that fallback still exceeds 50 characters, or if a member-region display name exceeds 50 characters, it truncates the result to exactly 50 characters.
-### Name the action invocation where its identity is already known
+The full logical type and member identity remain available in canonical attributes and are authoritative when a display name omits the namespace or is truncated.
-`MemberExecutorServiceDefault` will assign the contextual name before starting the existing action observation.
+### Resolve action invocations to their domain-facing identity
+
+`MemberExecutorServiceDefault` will use `IdentifierUtil.logicalMemberIdentifierFor(...)` with the action interaction head and owning action before starting the observation.
+This maps a mixin implementation such as `ApplicationUser_updateEmailAddress#act` to the domain-facing identity `isisExtSecMan.ApplicationUser#updateEmailAddress` and uses that same canonical value for `causeway.action.id`.
No late mutation of the root interaction or inference from descendants is required.
Renaming the root interaction was rejected because a single request can render an object, open a prompt, invoke an action, and render an Ajax response.
@@ -73,6 +84,14 @@ The observation covers the panel's actual render callback and descendant renderi
Individual action parameter fields remain excluded from property observations, preventing span amplification.
Instrumenting modal, sidebar, and inline prompt shells separately was rejected because presentation style should not create different semantic boundaries or duplicate prompt spans.
+### Preserve contextual names in the Causeway tracing handler
+
+Causeway will replace `DefaultTracingObservationHandler` in its dedicated observation registry with a small subclass or equivalent handler that retains the default lifecycle, parentage, tagging, error, event, and scope behavior but returns the contextual name without Micrometer's lower-hyphen conversion.
+The naming helper will enforce the 50-character limit before the handler exports the span.
+The Java agent remains responsible for automatic HTTP and JDBC spans, SDK ownership, sampling, and export.
+
+Changing Micrometer globally or renaming Java-agent-owned spans was rejected because only Causeway semantic observations need logical-identifier display names.
+
### Preserve canonical attributes and privacy rules
Dynamic contextual names will use only static metamodel structure.
@@ -83,8 +102,8 @@ The new prompt span follows the same `causeway.object.type` and `causeway.action
## Risks / Trade-offs
-- [Compact type names can collide across namespaces] → Keep the full logical type and action identity as authoritative attributes and document that display names are navigational aids.
-- [Micrometer truncates contextual names to 50 characters] → Put the operation and action member first, keep names compact, and test long identifiers without relying on the display name for exact filtering.
+- [Namespace fallback can make type names collide] → Keep the full logical type and action identity as authoritative attributes and document that display names are navigational aids.
+- [A logical identifier still exceeds 50 characters after namespace fallback] → Truncate deterministically at 50 characters and retain the complete canonical attribute.
- [Prompt work can occur before actual rendering] → Name the span explicitly as prompt rendering and document that preparation, choices, defaults, validation, and authorization may remain outside it.
- [A prompt component can be rendered more than once in an Ajax request] → Follow the existing component-render semantics and create one observation per actual enclosing prompt render callback.
- [Changing display names can affect saved backend queries based on operation name] → Preserve stable attributes and document the display-name change so queries can use canonical attributes.
@@ -98,5 +117,5 @@ Rollback consists of reverting the instrumentation change; SDK ownership, sampli
## Open Questions
-- Confirm during implementation whether the final logical-type segment should recognize separators other than `.` for all supported logical naming conventions.
-- Confirm with a representative modal, sidebar, and inline prompt that `ActionParametersPanel` is the single common render boundary and does not produce duplicate observations.
+No naming-policy questions remain.
+Implementation validation will retain coverage for modal, sidebar, and inline prompt use of the common `ActionParametersPanel` boundary.
diff --git a/openspec/changes/improve-semantic-span-names/proposal.md b/openspec/changes/improve-semantic-span-names/proposal.md
index 52034526309..44530e49c03 100644
--- a/openspec/changes/improve-semantic-span-names/proposal.md
+++ b/openspec/changes/improve-semantic-span-names/proposal.md
@@ -5,12 +5,14 @@ The framework already has stable logical type and member identifiers at the rele
## What Changes
-- Give action-invocation spans concise contextual display names derived from the invoked action's stable logical identifier while preserving `causeway.action.invocation` as the observation name and `causeway.action.id` as the canonical attribute.
-- Give Wicket entity-page render spans concise contextual display names derived from the rendered domain object's stable logical type while preserving `causeway.wicket.page.render` as the observation name and `causeway.object.type` as the canonical attribute.
+- Give action-invocation spans contextual display names based on the domain-facing logical member identifier, including correct mixin resolution, while preserving `causeway.action.invocation` as the observation name and `causeway.action.id` as the canonical attribute.
+- Give Wicket entity-page render spans contextual display names based on the rendered domain object's full logical type while preserving `causeway.wicket.page.render` as the observation name and `causeway.object.type` as the canonical attribute.
- Add one bounded Wicket action-prompt render observation identified by the prompted action, without creating spans for individual parameter fields.
-- Keep root-interaction and fine-grained fieldset, property, collection, and action-button render display names stable in this change.
+- Give Wicket fieldset, property, collection, and action-button render spans contextual display names based on their static layout or metamodel member identifiers.
+- Preserve logical-identifier casing in exported Causeway span names and enforce a deterministic 50-character limit with namespace fallback for logical type and member identifiers.
+- Keep the root-interaction display name stable.
- Continue to prohibit object titles, bookmarks, primary keys, argument values, user identities, tenancy identifiers, and other instance-specific data from span names and attributes.
-- Document display-name normalization and truncation constraints and require canonical attributes to remain authoritative for filtering and correlation.
+- Keep canonical attributes authoritative for filtering and correlation when display names omit a namespace or are truncated.
## Capabilities
@@ -25,4 +27,4 @@ The framework already has stable logical type and member identifiers at the rele
## Impact
The change affects core runtime action instrumentation, Wicket render observation descriptors and attachment points, focused observation tests, and the Micrometer tracing operations documentation.
-It changes exported span display names for action invocations and Wicket entity-page rendering but does not change activation, trace parentage, sampling, SDK ownership, dependencies, or canonical span attributes.
+It changes exported span display names for action invocations and Wicket page, prompt, fieldset, property, collection, and action-button rendering but does not change activation, trace parentage, sampling, SDK ownership, dependencies, or canonical span attributes.
diff --git a/openspec/changes/improve-semantic-span-names/specs/semantic-span-display-naming/spec.md b/openspec/changes/improve-semantic-span-names/specs/semantic-span-display-naming/spec.md
index 76f6b917e73..9f02ded7157 100644
--- a/openspec/changes/improve-semantic-span-names/specs/semantic-span-display-naming/spec.md
+++ b/openspec/changes/improve-semantic-span-names/specs/semantic-span-display-naming/spec.md
@@ -1,18 +1,23 @@
## ADDED Requirements
### Requirement: Meaningful action-invocation display name
-Causeway SHALL retain `causeway.action.invocation` as the stable observation name and SHALL assign each action-invocation observation a contextual display name derived from the action's stable logical type and logical member name.
-The display name SHALL identify the invocation operation and prompted member without requiring an operator to inspect span attributes.
+Causeway SHALL retain `causeway.action.invocation` as the stable observation name and SHALL assign each action-invocation observation the contextual display name `invoke <logical-member-identifier>`.
+The logical member identifier SHALL be the domain-facing identity of the invoked action, including for actions implemented by mixins.
-#### Scenario: Action identity is available
-- **WHEN** Causeway invokes an action with observation active
-- **THEN** the exported span display name identifies the operation as an invocation
-- **AND** it contains a compact form of the action's logical member and declaring type
+#### Scenario: Declared action identity is available
+- **WHEN** Causeway invokes a declared action with observation active
+- **THEN** the exported span display name begins with `invoke ` and contains the action's logical type name and member id separated by `#`
- **AND** the observation name remains `causeway.action.invocation`
- **AND** `causeway.action.id` retains the full canonical action identifier
+#### Scenario: Mixed-in action is invoked
+- **WHEN** Causeway invokes a mixed-in action whose implementation identity is `ApplicationUser_updateEmailAddress#act`
+- **THEN** the contextual name uses the domain-facing logical member identifier such as `isisExtSecMan.ApplicationUser#updateEmailAddress`
+- **AND** neither the contextual name nor `causeway.action.id` uses the implementation member `act`
+
### Requirement: Bounded contextual naming
-Causeway SHALL derive semantic span contextual names only from bounded operation names and static metamodel identifiers.
+Causeway SHALL derive semantic span contextual names only from bounded operation names and static metamodel or layout identifiers.
+Causeway SHALL preserve the declared casing of those identifiers.
Causeway MUST NOT include domain-object instance identifiers, object titles, bookmarks, values, arguments, localized labels, user identities, or tenancy identifiers in contextual names.
#### Scenario: Invocation has instance-specific context
@@ -29,9 +34,24 @@ Operators SHALL be able to use those attributes to disambiguate equal display na
- **THEN** their contextual names MAY be equal
- **AND** their `causeway.action.id` attributes distinguish the actions
-#### Scenario: Contextual name exceeds tracing limit
-- **WHEN** a generated contextual name exceeds the tracing integration's display-name limit
-- **THEN** truncation does not remove or alter the full canonical identity attributes
+#### Scenario: Full logical member name exceeds tracing limit
+- **WHEN** `invoke <logical-member-identifier>` exceeds 50 characters
+- **THEN** Causeway retries the display name using the logical type name without its namespace
+- **AND** the full canonical identity attribute remains unchanged
+
+#### Scenario: Namespace-free logical member name still exceeds tracing limit
+- **WHEN** the namespace-free action display name still exceeds 50 characters
+- **THEN** Causeway truncates the contextual name to 50 characters
+- **AND** truncation does not remove or alter the full canonical identity attribute
+
+### Requirement: Case-preserving Causeway trace export
+Causeway SHALL export its semantic observation contextual names without Micrometer's lower-hyphen conversion.
+The specialized handling SHALL apply only to Causeway's dedicated observation registry and SHALL preserve existing tracing lifecycle, parentage, tags, errors, and scope behavior.
+
+#### Scenario: Logical identifier contains uppercase characters
+- **WHEN** a Causeway contextual name contains a logical identifier such as `isisExtSecMan.ApplicationUser`
+- **THEN** the exported span name retains that exact identifier casing
+- **AND** automatic Java-agent HTTP and JDBC span naming remains unchanged
### Requirement: Generic root-interaction naming
Causeway SHALL retain `causeway.root.interaction` as the contextual and stable observation name for the root interaction.
diff --git a/openspec/changes/improve-semantic-span-names/specs/wicket-region-render-observation/spec.md b/openspec/changes/improve-semantic-span-names/specs/wicket-region-render-observation/spec.md
index 6b3a5eee195..70f3610263f 100644
--- a/openspec/changes/improve-semantic-span-names/specs/wicket-region-render-observation/spec.md
+++ b/openspec/changes/improve-semantic-span-names/specs/wicket-region-render-observation/spec.md
@@ -2,14 +2,15 @@
### Requirement: Entity-page render observation
When observation is active, the Wicket viewer SHALL create one `causeway.wicket.page.render` observation for each server-side render of an entity page.
-The observation SHALL join the current Java-agent-owned trace, SHALL use the Wicket viewer module metadata convention, and SHALL have a contextual display name derived from the rendered object's stable logical type.
+The observation SHALL join the current Java-agent-owned trace, SHALL use the Wicket viewer module metadata convention, and SHALL have the contextual display name `render <logical-type-name>`.
The stable observation name SHALL remain `causeway.wicket.page.render`, and `causeway.object.type` SHALL retain the full canonical logical type.
#### Scenario: Full entity-page render
- **WHEN** Wicket renders an entity page during a full HTTP response with observation active
- **THEN** one `causeway.wicket.page.render` observation covers the page's actual server-side rendering
- **AND** the observation is a descendant of the current request or Causeway interaction span
-- **AND** its contextual display name identifies the render operation and a compact form of the logical object type
+- **AND** its contextual display name begins with `render ` and contains the full logical type name when that name fits within 50 characters
+- **AND** an overlength name falls back to the namespace-free logical type before truncation
- **AND** its `causeway.object.type` attribute contains the full canonical logical type
#### Scenario: Observation is inactive
@@ -21,12 +22,13 @@ The stable observation name SHALL remain `causeway.wicket.page.render`, and `cau
### Requirement: Action-prompt render observation
When observation is active, the Wicket viewer SHALL create one `causeway.wicket.action.prompt.render` observation around each actual render callback of an enclosing action-parameter prompt panel.
-The observation SHALL use a contextual display name derived from the prompted action's stable logical type and logical member name and SHALL use the existing Wicket render lifecycle infrastructure.
+The observation SHALL use the contextual display name `prompt <logical-member-identifier>` and SHALL use the existing Wicket render lifecycle infrastructure.
#### Scenario: Parameterized action prompt is rendered
- **WHEN** Wicket renders the enclosing prompt panel for a parameterized action
- **THEN** one `causeway.wicket.action.prompt.render` observation covers the panel's actual render callback and descendant rendering
-- **AND** its contextual display name identifies the prompt operation and a compact form of the action's logical member and declaring type
+- **AND** its contextual display name begins with `prompt ` and uses the full domain-facing logical member identifier when that name fits within 50 characters
+- **AND** an overlength name falls back to the namespace-free logical type and member id before truncation
- **AND** it joins the current request trace with the active render region as its parent when one exists
#### Scenario: Prompt presentation styles
@@ -57,11 +59,37 @@ The observation SHALL represent rendering only and SHALL NOT be presented as cov
- **THEN** that work is not attributed to `causeway.wicket.action.prompt.render`
- **AND** operational documentation describes the render-only boundary
-### Requirement: Stable fine-grained render display names
-The Wicket viewer SHALL retain the existing stable contextual names for fieldset, property, collection, and action-button render observations in this change.
+### Requirement: Meaningful fine-grained render display names
+The Wicket viewer SHALL retain stable observation names while assigning member-level contextual names to fieldset, property, collection, and action-button render observations.
+The contextual names SHALL preserve the casing of static layout or metamodel identifiers and SHALL be truncated to 50 characters when necessary.
Their canonical layout and metamodel attributes SHALL continue to identify the rendered region.
-#### Scenario: Entity member region is rendered
-- **WHEN** Wicket renders an observed fieldset, property, collection, or action-button region
-- **THEN** its contextual name remains the applicable stable `causeway.wicket.*.render` name
-- **AND** its existing canonical region attributes remain available for identification
+#### Scenario: Named fieldset is rendered
+- **WHEN** Wicket renders an observed fieldset with id `identity`
+- **THEN** its contextual name is `render fieldset identity`
+- **AND** its observation name remains `causeway.wicket.fieldset.render`
+
+#### Scenario: Unnamed fieldset is rendered
+- **WHEN** Wicket renders the default unnamed fieldset
+- **THEN** its contextual name is `render fieldset default`
+- **AND** the internal marker `<default>` is not exposed in the contextual name
+
+#### Scenario: Property is rendered
+- **WHEN** Wicket renders an observed property with member id `emailAddress`
+- **THEN** its contextual name is `render property emailAddress`
+- **AND** its observation name remains `causeway.wicket.property.render`
+
+#### Scenario: Collection is rendered
+- **WHEN** Wicket renders an observed collection with member id `roles`
+- **THEN** its contextual name is `render collection roles`
+- **AND** its observation name remains `causeway.wicket.collection.render`
+
+#### Scenario: Action button is rendered
+- **WHEN** Wicket renders an observed action button with member id `updateEmailAddress`
+- **THEN** its contextual name is `render action updateEmailAddress`
+- **AND** its observation name remains `causeway.wicket.action.render`
+
+#### Scenario: Fine-grained display name exceeds the limit
+- **WHEN** a fieldset or member render contextual name exceeds 50 characters
+- **THEN** Causeway truncates the contextual name to 50 characters
+- **AND** its full canonical region attribute remains unchanged
diff --git a/openspec/changes/improve-semantic-span-names/tasks.md b/openspec/changes/improve-semantic-span-names/tasks.md
index 677d74f4f59..a7952834cf8 100644
--- a/openspec/changes/improve-semantic-span-names/tasks.md
+++ b/openspec/changes/improve-semantic-span-names/tasks.md
@@ -20,3 +20,28 @@
- [x] 4.1 Update `adoc/micrometer-tracing-operations.adoc` with the contextual naming convention, canonical-attribute guidance, 50-character tracing limit, prompt render boundary, privacy rules, and changed example trace tree.
- [x] 4.2 Run the focused core configuration, runtime-services, and Wicket UI observation test suites and record the results.
- [x] 4.3 Validate a representative action invocation, entity-page render, and parameterized action prompt against the Java-agent tracing fixture or local Jaeger, confirming meaningful display names, canonical attributes, correct nesting, and no per-parameter span amplification.
+
+## 5. Logical-Identifier Naming Refinement
+
+- [x] 5.1 Replace lower-hyphen token naming with case-preserving builders for logical types, logical members, and fine-grained render regions.
+- [x] 5.2 Implement the 50-character policy: full logical identifier first, namespace-free fallback for type-based names, then deterministic truncation.
+- [x] 5.3 Extend naming tests for exact casing, boundary lengths, namespace fallback, final truncation, member-region names, and default fieldset naming.
+
+## 6. Case-Preserving Trace Export and Invocation Identity
+
+- [x] 6.1 Add a Causeway tracing observation handler that preserves bounded contextual names while retaining the default Micrometer tracing lifecycle and tagging behavior.
+- [x] 6.2 Configure the dedicated Causeway observation registry to use the case-preserving handler without affecting Java-agent-owned spans.
+- [x] 6.3 Resolve action invocations through `IdentifierUtil.logicalMemberIdentifierFor(...)` so mixed-in actions use their domain-facing logical identity in both the contextual name and `causeway.action.id`.
+- [x] 6.4 Extend configuration and runtime observation tests for case preservation, 50-character enforcement, declared actions, and mixed-in action identities.
+
+## 7. Wicket Render Name Refinement
+
+- [x] 7.1 Update page and action-prompt contextual names to use full logical identifiers with namespace fallback and truncation.
+- [x] 7.2 Give fieldset, property, collection, and action-button observations meaningful `render <region> <id>` contextual names while retaining stable observation names and canonical attributes.
+- [x] 7.3 Extend Wicket observation tests for page, prompt, fieldset, default fieldset, property, collection, and action-button display names and limits.
+
+## 8. Refinement Documentation and Validation
+
+- [x] 8.1 Update the tracing operations documentation with the final case-preserving taxonomy, fallback algorithm, examples, and authoritative-attribute guidance.
+- [x] 8.2 Update the Java-agent compatibility fixture to assert exact action, page, prompt, and fine-grained render names while automatic HTTP and JDBC naming remains unchanged.
+- [x] 8.3 Run the focused naming, configuration, runtime-services, Wicket, and Java-agent compatibility suites and record the refinement results.
diff --git a/openspec/changes/improve-semantic-span-names/validation.md b/openspec/changes/improve-semantic-span-names/validation.md
index 28e655157ef..b829edc2c10 100644
--- a/openspec/changes/improve-semantic-span-names/validation.md
+++ b/openspec/changes/improve-semantic-span-names/validation.md
@@ -1,14 +1,16 @@
## Automated Validation
-Production compilation succeeded through `viewers/wicket/ui` with Java 11 release output and tests skipped.
+Production compilation succeeded through `viewers/wicket/ui` with Java 25 producing Java 11 release output and tests skipped.
The focused suites were run in the Maven reactor with Java 25, `maven.compiler.release=11`, and `maven.compiler.proc=full`:
-- `CausewayObservationNamingTest`: 4 tests, 0 failures, 0 errors, 0 skipped.
-- `MemberExecutorServiceDefaultObservationTest`: 3 tests, 0 failures, 0 errors, 0 skipped.
-- `WicketRenderObservationTest`: 11 tests, 0 failures, 0 errors, 0 skipped.
+- `CausewayObservationNamingTest`: 7 tests, 0 failures, 0 errors, 0 skipped.
+- `CausewayTracingObservationHandlerTest`: 3 tests, 0 failures, 0 errors, 0 skipped.
+- `CausewayObservationConfigurationTest`: 3 tests, 0 failures, 0 errors, 0 skipped.
+- `MemberExecutorServiceDefaultObservationTest`: 4 tests, 0 failures, 0 errors, 0 skipped.
+- `WicketRenderObservationTest`: 12 tests, 0 failures, 0 errors, 0 skipped.
-The tracing compatibility fixture was compiled in the reactor and then run on its validated Java 11 and OpenTelemetry Java agent 1.31.0 baseline:
+The tracing compatibility test was compiled in the Java 25 reactor while its application fixture was launched on the validated Java 11 and OpenTelemetry Java agent 1.31.0 baseline:
- `MicrometerTracingCompatibilityTest`: 2 tests, 0 failures, 0 errors, 0 skipped.
@@ -21,14 +23,20 @@ The observed semantic hierarchy included:
[source,text]
----
causeway.root.interaction
-├── render tracing-fixture
-│ └── prompt execute-jdbc on tracing-fixture
-└── invoke execute-jdbc on tracing-fixture
+├── render causeway.TracingFixture
+│ ├── render fieldset identity
+│ │ ├── render property emailAddress
+│ │ └── render action executeJdbc
+│ ├── render collection roles
+│ └── prompt causeway.TracingFixture#executeJdbc
+└── invoke causeway.TracingFixture#executeJdbc
└── JDBC
----
The page span exported `causeway.object.type=causeway.TracingFixture`.
The prompt span exported `causeway.object.type=causeway.TracingFixture` and `causeway.action.id=causeway.TracingFixture#executeJdbc()`.
-The action span exported the same canonical action identifier, and the JDBC span remained a child of the action invocation.
+The action span exported the same complete domain-facing canonical identifier, and the automatic JDBC span remained a child of the action invocation.
+The automatic HTTP entry span retained the Java-agent name `GET /trace` and the Causeway foreground classification.
The Wicket focused suite additionally verified that the enclosing action prompt receives one render behavior, individual parameter models remain excluded from property spans, no-op rendering is unchanged, descriptors remain serializable without active telemetry, and prompt rendering retains page parentage.
+It also verified full logical identifiers, namespace fallback, member-region identifiers, and the `default` display for an unnamed fieldset.
diff --git a/regressiontests/tracing-compatibility/src/test/java/org/apache/causeway/regressiontests/tracing/MicrometerTracingAgentFixture.java b/regressiontests/tracing-compatibility/src/test/java/org/apache/causeway/regressiontests/tracing/MicrometerTracingAgentFixture.java
index 0c2cd1cf5cc..82adb9f4ffe 100644
--- a/regressiontests/tracing-compatibility/src/test/java/org/apache/causeway/regressiontests/tracing/MicrometerTracingAgentFixture.java
+++ b/regressiontests/tracing-compatibility/src/test/java/org/apache/causeway/regressiontests/tracing/MicrometerTracingAgentFixture.java
@@ -63,6 +63,7 @@
import org.apache.causeway.core.metamodel.object.ManagedObject;
import org.apache.causeway.core.metamodel.objectmanager.ObjectManager;
import org.apache.causeway.core.metamodel.services.publishing.CommandPublisher;
+import org.apache.causeway.core.metamodel.spec.ObjectSpecification;
import org.apache.causeway.core.metamodel.spec.feature.ObjectAction;
import org.apache.causeway.core.metamodel.specloader.SpecificationLoader;
import org.apache.causeway.core.runtime.events.MetamodelEventService;
@@ -93,9 +94,15 @@
public final class MicrometerTracingAgentFixture {
static final String ROOT_INTERACTION_NAME = "causeway.root.interaction";
- static final String ACTION_INVOCATION_NAME = "invoke execute-jdbc on tracing-fixture";
- static final String PAGE_RENDER_NAME = "render tracing-fixture";
- static final String PROMPT_RENDER_NAME = "prompt execute-jdbc on tracing-fixture";
+ static final String ACTION_INVOCATION_NAME =
+ "invoke causeway.TracingFixture#executeJdbc";
+ static final String PAGE_RENDER_NAME = "render causeway.TracingFixture";
+ static final String FIELDSET_RENDER_NAME = "render fieldset identity";
+ static final String PROPERTY_RENDER_NAME = "render property emailAddress";
+ static final String COLLECTION_RENDER_NAME = "render collection roles";
+ static final String ACTION_RENDER_NAME = "render action executeJdbc";
+ static final String PROMPT_RENDER_NAME =
+ "prompt causeway.TracingFixture#executeJdbc";
static final String ACTION_ID = "causeway.TracingFixture#executeJdbc()";
static final String OBJECT_TYPE = "causeway.TracingFixture";
static final String SUCCESS_MARKER = "CAUSEWAY_TRACING_FIXTURE_OK";
@@ -160,14 +167,36 @@ public void trace() {
private void renderPageAndPrompt() {
final WicketRenderObservationDescriptor page =
WicketRenderObservationDescriptor.page(OBJECT_TYPE);
+ final WicketRenderObservationDescriptor fieldset =
+ WicketRenderObservationDescriptor.fieldset(OBJECT_TYPE, "identity");
+ final WicketRenderObservationDescriptor property =
+ WicketRenderObservationDescriptor.property(
+ OBJECT_TYPE, OBJECT_TYPE + "#emailAddress");
+ final WicketRenderObservationDescriptor collection =
+ WicketRenderObservationDescriptor.collection(
+ OBJECT_TYPE, OBJECT_TYPE + "#roles");
+ final WicketRenderObservationDescriptor action =
+ WicketRenderObservationDescriptor.action(
+ OBJECT_TYPE, ACTION_ID);
final WicketRenderObservationDescriptor prompt =
WicketRenderObservationDescriptor.actionPrompt(
OBJECT_TYPE, ACTION_ID, "executeJdbc");
- page.customize(observationIntegration.createNotStarted(
- getClass(), page.getRegion().getObservationName()))
- .observe(() -> prompt.customize(observationIntegration.createNotStarted(
- getClass(), prompt.getRegion().getObservationName()))
- .observe(() -> {}));
+ observe(page, () -> {
+ observe(fieldset, () -> {
+ observe(property, () -> {});
+ observe(action, () -> {});
+ });
+ observe(collection, () -> {});
+ observe(prompt, () -> {});
+ });
+ }
+
+ private void observe(
+ final WicketRenderObservationDescriptor descriptor,
+ final Runnable rendering) {
+ descriptor.customize(observationIntegration.createNotStarted(
+ getClass(), descriptor.getRegion().getObservationName()))
+ .observe(rendering);
}
}
@@ -232,7 +261,10 @@ private static ActionExecutor actionExecutor() throws Exception {
final FacetHolder facetHolder = mock(FacetHolder.class);
when(facetHolder.getObjectManager()).thenReturn(objectManager);
+ final ObjectSpecification declaringType = mock(ObjectSpecification.class);
+ when(declaringType.logicalTypeName()).thenReturn(OBJECT_TYPE);
final ObjectAction owningAction = mock(ObjectAction.class);
+ when(owningAction.getDeclaringType()).thenReturn(declaringType);
when(owningAction.getFeatureIdentifier()).thenReturn(Identifier.actionIdentifier(
LogicalType.eager(JdbcAction.class, OBJECT_TYPE),
"executeJdbc"));
diff --git a/regressiontests/tracing-compatibility/src/test/java/org/apache/causeway/regressiontests/tracing/MicrometerTracingCompatibilityTest.java b/regressiontests/tracing-compatibility/src/test/java/org/apache/causeway/regressiontests/tracing/MicrometerTracingCompatibilityTest.java
index 2ed48b4b71c..a11cb464f0a 100644
--- a/regressiontests/tracing-compatibility/src/test/java/org/apache/causeway/regressiontests/tracing/MicrometerTracingCompatibilityTest.java
+++ b/regressiontests/tracing-compatibility/src/test/java/org/apache/causeway/regressiontests/tracing/MicrometerTracingCompatibilityTest.java
@@ -87,13 +87,31 @@ void javaAgentExportsHttpRootInteractionActionAndJdbcAncestry() throws Exception
.findFirst()
.orElseGet(() -> fail("Page render span is not a child of the root interaction.\n"
+ describe(spans) + "\n" + result.output));
- final ExportedSpan promptSpan = spans.stream()
- .filter(span -> MicrometerTracingAgentFixture.PROMPT_RENDER_NAME.equals(span.name))
- .filter(span -> pageSpan.traceId.equals(span.traceId))
- .filter(span -> pageSpan.spanId.equals(span.parentSpanId))
- .findFirst()
- .orElseGet(() -> fail("Prompt render span is not a child of the page render.\n"
- + describe(spans) + "\n" + result.output));
+ final ExportedSpan fieldsetSpan = childSpanNamed(
+ spans,
+ pageSpan,
+ MicrometerTracingAgentFixture.FIELDSET_RENDER_NAME,
+ result.output);
+ final ExportedSpan propertySpan = childSpanNamed(
+ spans,
+ fieldsetSpan,
+ MicrometerTracingAgentFixture.PROPERTY_RENDER_NAME,
+ result.output);
+ final ExportedSpan actionRenderSpan = childSpanNamed(
+ spans,
+ fieldsetSpan,
+ MicrometerTracingAgentFixture.ACTION_RENDER_NAME,
+ result.output);
+ final ExportedSpan collectionSpan = childSpanNamed(
+ spans,
+ pageSpan,
+ MicrometerTracingAgentFixture.COLLECTION_RENDER_NAME,
+ result.output);
+ final ExportedSpan promptSpan = childSpanNamed(
+ spans,
+ pageSpan,
+ MicrometerTracingAgentFixture.PROMPT_RENDER_NAME,
+ result.output);
final ExportedSpan jdbcSpan = spans.stream()
.filter(span -> actionSpan.traceId.equals(span.traceId))
.filter(span -> actionSpan.spanId.equals(span.parentSpanId))
@@ -119,6 +137,14 @@ void javaAgentExportsHttpRootInteractionActionAndJdbcAncestry() throws Exception
promptSpan.attributes.get("causeway.object.type"));
assertEquals(MicrometerTracingAgentFixture.ACTION_ID,
promptSpan.attributes.get("causeway.action.id"));
+ assertEquals("identity",
+ fieldsetSpan.attributes.get("causeway.fieldset.id"));
+ assertEquals(MicrometerTracingAgentFixture.OBJECT_TYPE + "#emailAddress",
+ propertySpan.attributes.get("causeway.property.id"));
+ assertEquals(MicrometerTracingAgentFixture.OBJECT_TYPE + "#roles",
+ collectionSpan.attributes.get("causeway.collection.id"));
+ assertEquals(MicrometerTracingAgentFixture.ACTION_ID,
+ actionRenderSpan.attributes.get("causeway.action.id"));
System.out.printf(
"CAUSEWAY_TRACING_EVIDENCE traceId=%s http=%s rootSpanId=%s page=%s prompt=%s action=%s jdbcSpanId=%s%n",
rootSpan.traceId,
@@ -179,7 +205,12 @@ private static String javaExecutable() {
final String executable = System.getProperty("os.name").toLowerCase().contains("win")
? "java.exe"
: "java";
- return Paths.get(System.getProperty("java.home"), "bin", executable).toString();
+ return Paths.get(
+ System.getProperty(
+ "causeway.tracing.fixture.java.home",
+ System.getProperty("java.home")),
+ "bin",
+ executable).toString();
}
private static ExportedSpan spanNamed(
@@ -193,6 +224,20 @@ private static ExportedSpan spanNamed(
+ describe(spans) + "\n" + processOutput));
}
+ private static ExportedSpan childSpanNamed(
+ final List<ExportedSpan> spans,
+ final ExportedSpan parent,
+ final String name,
+ final String processOutput) {
+ return spans.stream()
+ .filter(span -> name.equals(span.name))
+ .filter(span -> parent.traceId.equals(span.traceId))
+ .filter(span -> parent.spanId.equals(span.parentSpanId))
+ .findFirst()
+ .orElseGet(() -> fail("Span is not a child of its expected parent: " + name + "\n"
+ + describe(spans) + "\n" + processOutput));
+ }
+
private static ExportedSpan ancestorNamed(
final List<ExportedSpan> spans,
final ExportedSpan descendant,
diff --git a/viewers/wicket/ui-test/src/test/java/org/apache/causeway/viewer/wicket/ui/observation/WicketRenderObservationTest.java b/viewers/wicket/ui-test/src/test/java/org/apache/causeway/viewer/wicket/ui/observation/WicketRenderObservationTest.java
index 527e12613df..87259547685 100644
--- a/viewers/wicket/ui-test/src/test/java/org/apache/causeway/viewer/wicket/ui/observation/WicketRenderObservationTest.java
+++ b/viewers/wicket/ui-test/src/test/java/org/apache/causeway/viewer/wicket/ui/observation/WicketRenderObservationTest.java
@@ -75,14 +75,25 @@ void descriptorsUseStableNamesAndSafeIdentifiers() {
descriptor.getRegion().getObservationName(), registry));
assertEquals("causeway.wicket.property.render", observation.getContext().getName());
- assertEquals("causeway.wicket.property.render", observation.getContext().getContextualName());
+ assertEquals("render property name", observation.getContext().getContextualName());
assertEquals(OBJECT_TYPE,
observation.getContext().getLowCardinalityKeyValue("causeway.object.type").getValue());
assertEquals(OBJECT_TYPE + "#name",
observation.getContext().getLowCardinalityKeyValue("causeway.property.id").getValue());
assertNull(observation.getContext().getLowCardinalityKeyValue("causeway.action.id"));
- assertEquals("<default>",
- WicketRenderObservationDescriptor.fieldset(OBJECT_TYPE, null).getMemberId());
+ final WicketRenderObservationDescriptor defaultFieldset =
+ WicketRenderObservationDescriptor.fieldset(OBJECT_TYPE, null);
+ assertEquals("<default>", defaultFieldset.getMemberId());
+ assertEquals("render fieldset default", defaultFieldset.getContextualName());
+ assertEquals("render fieldset identity",
+ WicketRenderObservationDescriptor.fieldset(
+ OBJECT_TYPE, "identity").getContextualName());
+ assertEquals("render collection orders",
+ WicketRenderObservationDescriptor.collection(
+ OBJECT_TYPE, OBJECT_TYPE + "#orders").getContextualName());
+ assertEquals("render action updateName",
+ WicketRenderObservationDescriptor.action(
+ OBJECT_TYPE, OBJECT_TYPE + "#updateName()").getContextualName());
}
@Test
@@ -102,9 +113,9 @@ void pageAndPromptDescriptorsUseMeaningfulContextualNames() {
Observation.createNotStarted(prompt.getRegion().getObservationName(), registry));
assertEquals("causeway.wicket.page.render", pageObservation.getContext().getName());
- assertEquals("render customer", pageObservation.getContext().getContextualName());
+ assertEquals("render demo.Customer", pageObservation.getContext().getContextualName());
assertEquals("causeway.wicket.action.prompt.render", promptObservation.getContext().getName());
- assertEquals("prompt update-name on customer",
+ assertEquals("prompt demo.Customer#updateName",
promptObservation.getContext().getContextualName());
assertEquals(OBJECT_TYPE,
promptObservation.getContext().getLowCardinalityKeyValue(
@@ -114,6 +125,21 @@ void pageAndPromptDescriptorsUseMeaningfulContextualNames() {
"causeway.action.id").getValue());
}
+ @Test
+ void pageAndPromptNamesFallBackToSimpleLogicalType() {
+ final String longObjectType =
+ "aVeryLongApplicationNamespaceThatExceedsTheLimit.Customer";
+
+ assertEquals("render Customer",
+ WicketRenderObservationDescriptor.page(
+ longObjectType).getContextualName());
+ assertEquals("prompt Customer#updateName",
+ WicketRenderObservationDescriptor.actionPrompt(
+ longObjectType,
+ longObjectType + "#updateName()",
+ "updateName").getContextualName());
+ }
+
@Test
void nestedLifecycleClosesScopesInReverseOrder() {
final RecordingHandler handler = new RecordingHandler();
@@ -208,8 +234,8 @@ void actualWicketRenderingPreservesComponentTreeParentage() {
"causeway.wicket.action.prompt.render<-causeway.wicket.page.render"),
handler.parents);
assertEquals(List.of(
- "render customer",
- "prompt update-name on customer"), handler.contextualNames);
+ "render demo.Customer",
+ "prompt demo.Customer#updateName"), handler.contextualNames);
assertEquals(List.of(
"start:causeway.wicket.page.render",
"scope-opened:causeway.wicket.page.render",
@@ -302,7 +328,7 @@ void serializationRetainsDescriptorButNotActiveTelemetry() throws Exception {
assertFalse(restored.isActive());
assertEquals("causeway.wicket.action.prompt.render",
restored.descriptor().getRegion().getObservationName());
- assertEquals("prompt update-name on customer",
+ assertEquals("prompt demo.Customer#updateName",
restored.descriptor().getContextualName());
assertEquals(OBJECT_TYPE, restored.descriptor().getObjectType());
assertEquals(OBJECT_TYPE + "#updateName()", restored.descriptor().getMemberId());
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/observation/WicketRenderObservationDescriptor.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/observation/WicketRenderObservationDescriptor.java
index 81261cf8251..b92b39e8b5e 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/observation/WicketRenderObservationDescriptor.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/observation/WicketRenderObservationDescriptor.java
@@ -65,28 +65,32 @@ public static WicketRenderObservationDescriptor page(final String objectType) {
public static WicketRenderObservationDescriptor fieldset(
final String objectType,
final String fieldsetId) {
- return stableDescriptor(
+ return regionDescriptor(
Region.FIELDSET,
objectType,
- fieldsetId != null && !fieldsetId.isEmpty() ? fieldsetId : "<default>");
+ fieldsetId != null && !fieldsetId.isEmpty() ? fieldsetId : "<default>",
+ "fieldset");
}
public static WicketRenderObservationDescriptor property(
final String objectType,
final String propertyId) {
- return stableDescriptor(Region.PROPERTY, objectType, propertyId);
+ return regionDescriptor(
+ Region.PROPERTY, objectType, propertyId, "property");
}
public static WicketRenderObservationDescriptor collection(
final String objectType,
final String collectionId) {
- return stableDescriptor(Region.COLLECTION, objectType, collectionId);
+ return regionDescriptor(
+ Region.COLLECTION, objectType, collectionId, "collection");
}
public static WicketRenderObservationDescriptor action(
final String objectType,
final String actionId) {
- return stableDescriptor(Region.ACTION, objectType, actionId);
+ return regionDescriptor(
+ Region.ACTION, objectType, actionId, "action");
}
public static WicketRenderObservationDescriptor actionPrompt(
@@ -101,12 +105,17 @@ public static WicketRenderObservationDescriptor actionPrompt(
"prompt", objectType, actionMemberName));
}
- private static WicketRenderObservationDescriptor stableDescriptor(
+ private static WicketRenderObservationDescriptor regionDescriptor(
final Region region,
final String objectType,
- final String memberId) {
+ final String memberId,
+ final String regionName) {
return new WicketRenderObservationDescriptor(
- region, objectType, memberId, region.getObservationName());
+ region,
+ objectType,
+ memberId,
+ CausewayObservationNaming.forRenderRegion(
+ regionName, memberId));
}
private final Region region;