microsoft.opentelemetry.a365.runtime package
- microsoft.opentelemetry.a365.runtime.get_observability_authentication_scope()[source]
Returns the scope for authenticating to the observability service based on the current environment.
The scope can be overridden via the A365_OBSERVABILITY_SCOPE_OVERRIDE environment variable to enable testing against pre-production environments.
- class microsoft.opentelemetry.a365.runtime.PowerPlatformApiDiscovery(cluster_category)[source]
Bases:
objectDiscovery helper for Power Platform API endpoints.
- class microsoft.opentelemetry.a365.runtime.Utility[source]
Bases:
objectUtility class providing common runtime operations for Agent 365.
This class contains static methods for token processing, agent identity resolution, and other utility functions used across the Agent 365 runtime.
- static get_app_id_from_token(token)[source]
Decodes the current token and retrieves the App ID (appid or azp claim).
WARNING: NO SIGNATURE VERIFICATION - This method uses jwt.decode() which does NOT verify the token signature. The token claims can be spoofed by malicious actors. This method is ONLY suitable for logging, analytics, and diagnostics purposes. Do NOT use the returned value for authorization, access control, or security decisions.
Note: Returns a default GUID (‘00000000-0000-0000-0000-000000000000’) for empty tokens for backward compatibility with callers that expect a valid-looking GUID. For agent identification where empty string is preferred, use get_agent_id_from_token().
- static get_agent_id_from_token(token)[source]
Decodes the token and retrieves the best available agent identifier. Checks claims in priority order: xms_par_app_azp (agent blueprint ID) > appid > azp.
WARNING: NO SIGNATURE VERIFICATION - This method uses jwt.decode() which does NOT verify the token signature. The token claims can be spoofed by malicious actors. This method is ONLY suitable for logging, analytics, and diagnostics purposes. Do NOT use the returned value for authorization, access control, or security decisions.
Note: Returns empty string for empty/missing tokens (unlike get_app_id_from_token() which returns a default GUID). This allows callers to omit headers when no identifier is available.
- static resolve_agent_identity(context, auth_token)[source]
Resolves the agent identity from the turn context or auth token.
- Parameters:
- Returns:
- The agent identity (App ID). Returns the agentic instance ID if the
request is agentic, otherwise returns the App ID from the auth token.
- Return type:
- static get_user_agent_header(orchestrator=None)[source]
Generates a User-Agent header string for SDK requests.
- class microsoft.opentelemetry.a365.runtime.OperationError(exception)[source]
Bases:
objectRepresents an error that occurred during an operation.
This class wraps an exception and provides a consistent interface for accessing error information.
- class microsoft.opentelemetry.a365.runtime.OperationResult(succeeded, errors=None)[source]
Bases:
objectRepresents the result of an operation.
This class encapsulates the success or failure state of an operation along with any associated errors.
- property succeeded: bool
Get a flag indicating whether the operation succeeded.
- Returns:
True if the operation succeeded, otherwise False.
- Return type:
- property errors: List[OperationError]
Get the list of errors that occurred during the operation.
Note
This property returns a defensive copy of the internal error list to prevent external modifications, which is especially important for protecting the singleton instance returned by success().
- Returns:
A copy of the list of operation errors.
- Return type:
List[OperationError]
- static success()[source]
Return an OperationResult indicating a successful operation.
- Returns:
An OperationResult indicating a successful operation.
- Return type:
- static failed(*errors)[source]
Create an OperationResult indicating a failed operation.
- Parameters:
*errors (
OperationError) – Variable number of OperationError instances.- Returns:
An OperationResult indicating a failed operation.
- Return type:
Submodules
- microsoft.opentelemetry.a365.runtime.environment_utils module
- microsoft.opentelemetry.a365.runtime.operation_error module
- microsoft.opentelemetry.a365.runtime.operation_result module
- microsoft.opentelemetry.a365.runtime.power_platform_api_discovery module
- microsoft.opentelemetry.a365.runtime.utility module
- microsoft.opentelemetry.a365.runtime.version_utils module