Skip to main content

span_queries

Creates, updates, deletes, gets or lists a span_queries resource.

Overview​

Namespan_queries
TypeResource
Idsumologic.tracing.span_queries

Fields​

The following fields are returned by SELECT queries:

Details about the given span query.

NameDatatypeDescription
query_rowsarrayA list of span analytics queries. (wire: queryRows)
statusstringStatus of the query. Possible values: Processing, Finished, Error, Paused (pattern: <code>^(Processing|Finished|Error|Paused)$</code>, example: Processing, x-pattern-message: Should be either Processing, Finished, Error, Paused.)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectquery_id, regionGet a status of a span analytics query with the given id. When the query has been completed, use the Span Query Result endpoint to get the result of the asynchronous query.
createinsertregion, query_rows, time_rangeExecute a span analytics query and get the id to fetch its status and results. Use the Span Query Status endpoint to check a query status. When the query has been completed, use the Span Query Result endpoint to get the result of the asynchronous query.
deletedeletequery_id, regionCancel a currently processed span search query with the given id.
pauseexecqueryId, regionPause a currently processed span search query with the given id.
resumeexecqueryId, regionResume a previously paused span search query with the given id.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
queryIdstringIdentifier of the query to resume.
query_idstringIdentifier of the query to cancel. (wire: queryId)
regionstringSumo Logic deployment (au, ca, ch, de, eu, fed, in, jp, kr, us1, us2). Resolved from the SUMOLOGIC_ENVIRONMENT environment variable when it is set (x-stackQL-envVar, the same variable the Terraform provider reads); otherwise defaults to us2. A WHERE region = '...' value always takes precedence. (enum: [au, ca, ch, de, eu, fed, in, jp, kr, us1, us2], default: us2, x-stackQL-envVar: SUMOLOGIC_ENVIRONMENT)

SELECT examples​

Get a status of a span analytics query with the given id. When the query has been completed, use the Span Query Result endpoint to get the result of the asynchronous query.

SELECT
query_rows,
status
FROM sumologic.tracing.span_queries
WHERE query_id = '{{ query_id }}' -- required
AND region = '{{ region }}' -- required unless SUMOLOGIC_ENVIRONMENT is set
;

INSERT examples​

Execute a span analytics query and get the id to fetch its status and results. Use the Span Query Status endpoint to check a query status. When the query has been completed, use the Span Query Result endpoint to get the result of the asynchronous query.

INSERT INTO sumologic.tracing.span_queries (
query_rows,
time_range,
time_zone,
region
)
SELECT
'{{ query_rows }}' /* required */,
'{{ time_range }}' /* required */,
'{{ time_zone }}',
'{{ region }}'
RETURNING
query_id,
has_errors,
query_rows,
time_range
;

DELETE examples​

Cancel a currently processed span search query with the given id.

DELETE FROM sumologic.tracing.span_queries
WHERE query_id = '{{ query_id }}' --required
AND region = '{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Pause a currently processed span search query with the given id.

EXEC sumologic.tracing.span_queries.pause
@queryId='{{ queryId }}' --required,
@region='{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
;