ExportFormatter.FormatSingle(Activity, Resource) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.