|
MediaWiki master
|
Service for handling telemetry data. More...
Inherits Wikimedia\Http\TelemetryHeadersInterface.

Public Member Functions | |
| __construct (array $server, ?bool $allowExternalReqID=null) | |
| getRequestHeaders () | |
| Return Telemetry data in form of request headers. | |
| getRequestId () | |
| Get the current request ID. | |
| getTraceparent () | |
| Get the OpenTelemetry traceparent info, Returns null when not present or AllowExternalReqID is set to false. | |
| getTracestate () | |
| Get the OpenTelemetry tracestate info Returns null when not present or AllowExternalReqID is set to false. | |
| overrideRequestId (string $newId) | |
| Override the unique request ID. | |
| regenerateRequestId () | |
Regenerate the request id by setting it to null, next call to getRequestId will refetch the request id from header/UNIQUE_ID or regenerate it. | |
Static Public Member Functions | |
| static | getInstance () |
Service for handling telemetry data.
Definition at line 15 of file Telemetry.php.
| MediaWiki\Http\Telemetry::__construct | ( | array | $server, |
| ?bool | $allowExternalReqID = null ) |
| array | $server | Server and execution environment information, most likely the $_SERVER variable |
Definition at line 37 of file Telemetry.php.
|
static |
Definition at line 42 of file Telemetry.php.
References $wgAllowExternalReqID.
Referenced by MediaWiki\Http\HttpRequestFactory\createMultiClient().
| MediaWiki\Http\Telemetry::getRequestHeaders | ( | ) |
Return Telemetry data in form of request headers.
Implements Wikimedia\Http\TelemetryHeadersInterface.
Definition at line 112 of file Telemetry.php.
| MediaWiki\Http\Telemetry::getRequestId | ( | ) |
Get the current request ID.
This is usually based on the X-Request-Id header, or the UNIQUE_ID environment variable, falling back to (process cached) randomly-generated string.
Definition at line 57 of file Telemetry.php.
References wfRandomString().
| MediaWiki\Http\Telemetry::getTraceparent | ( | ) |
Get the OpenTelemetry traceparent info, Returns null when not present or AllowExternalReqID is set to false.
Definition at line 105 of file Telemetry.php.
| MediaWiki\Http\Telemetry::getTracestate | ( | ) |
Get the OpenTelemetry tracestate info Returns null when not present or AllowExternalReqID is set to false.
Definition at line 95 of file Telemetry.php.
| MediaWiki\Http\Telemetry::overrideRequestId | ( | string | $newId | ) |
Override the unique request ID.
This is for sub-requests, such as jobs, that wish to use the same id but are not part of the same execution context.
Definition at line 76 of file Telemetry.php.
| MediaWiki\Http\Telemetry::regenerateRequestId | ( | ) |
Regenerate the request id by setting it to null, next call to getRequestId will refetch the request id from header/UNIQUE_ID or regenerate it.
Definition at line 85 of file Telemetry.php.