Class TraceOperation

java.lang.Object
org.apache.juneau.rest.server.tracing.TraceOperation

public final class TraceOperation extends Object
Immutable, low-cardinality description of the operation a TracerHook bridge should name a span after, supplied to TracerHook.startSpan(org.apache.juneau.rest.server.RestRequest, TraceContextCarrier, TraceOperation) alongside the extracted TraceContextCarrier.

juneau-rest-server has no notion of MCP, JSON-RPC, or OpenTelemetry — this type exists so a neutral TraceContextExtractor (for example the juneau-rest-server-mcp-v20260728 binding, added in a later task) can hand a bridge (for example the OpenTelemetry bridge in juneau-rest-server-tracing-otel) a low-cardinality span name plus a small set of attributes derived from resolved request arguments, without either side depending on the other's types.

Default operation

DEFAULT carries no span name and no attributes. It is the value TraceContextExtractor.operation(org.apache.juneau.rest.server.RestRequest, java.lang.Object[]) returns when an extractor implementation supplies only extract(...) — a bridge receiving DEFAULT keeps whatever span name / attributes it would otherwise derive from the RestRequest itself (HTTP method, route, etc.); it is not required to name every span after a non-HTTP operation.

Attribute-name constants

The attribute-name constants declared here are the exact, pinned MCP/GenAI span-attribute keys that a later OpenTelemetry-bridge task and MCP-binding task both need to agree on. They are declared on this neutral type — rather than duplicated as private literals in each of those two modules — specifically so juneau-rest-server stays free of any OpenTelemetry or MCP import while still being the single source of truth for the wire-level attribute name. Attribute values are supplied per-operation via getAttributes(); these constants are only the keys.

Pinned to the OpenTelemetry GenAI semantic-conventions snapshot at commit c739977ae690961f36e435504e5c1febaef1f7f3 plus core OpenTelemetry semantic conventions v1.43.0. All of these attributes are experimental/development — names and requirement levels may change in a future semantic-conventions release; this pin must be re-checked before any OpenTelemetry or semantic-conventions dependency upgrade touches MCP tracing.

See Also:
Since:
10.0.0