span_queries
Creates, updates, deletes, gets or lists a span_queries resource.
Overview​
| Name | span_queries |
| Type | Resource |
| Id | sumologic.tracing.span_queries |
Fields​
The following fields are returned by SELECT queries:
- get
Details about the given span query.
| Name | Datatype | Description |
|---|---|---|
query_rows | array | A list of span analytics queries. (wire: queryRows) |
status | string | Status 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | query_id, region | 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. | |
create | insert | region, query_rows, time_range | 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. | |
delete | delete | query_id, region | Cancel a currently processed span search query with the given id. | |
pause | exec | queryId, region | Pause a currently processed span search query with the given id. | |
resume | exec | queryId, region | Resume 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.
| Name | Datatype | Description |
|---|---|---|
queryId | string | Identifier of the query to resume. |
query_id | string | Identifier of the query to cancel. (wire: queryId) |
region | string | Sumo 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
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​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: span_queries
props:
- name: region
value: "{{ region }}"
description: Required parameter for the span_queries resource.
- name: query_rows
description: |
A list of span analytics queries.
value:
- queryString: "{{ queryString }}"
rowId: "{{ rowId }}"
- name: time_range
value:
type: "{{ type }}"
- name: time_zone
value: "{{ time_zone }}"
description: |
Time zone for the query time ranges. Follow the format in the [IANA Time Zone Database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
default: UTC
DELETE examples​
- delete
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
- resume
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
;
Resume a previously paused span search query with the given id.
EXEC sumologic.tracing.span_queries.resume
@queryId='{{ queryId }}' --required,
@region='{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
;