Freigeben über


ExportFormatter.FormatSingle(Activity, Resource) Method

Definition

Formats a single Activity span into an OTLP JSON payload compatible with the Agent 365 Observability ingestion service.

public static string FormatSingle(System.Diagnostics.Activity activity, OpenTelemetry.Resources.Resource resource);
static member FormatSingle : System.Diagnostics.Activity * OpenTelemetry.Resources.Resource -> string
Public Shared Function FormatSingle (activity As Activity, resource As Resource) As String

Parameters

activity
Activity

The Activity span to be formatted into the OTLP payload.

resource
OpenTelemetry.Resources.Resource

The OpenTelemetry resource associated with the span, containing resource attributes.

Returns

A JSON string representing the OTLP payload for the provided activity and resource.

Applies to