Query logs (GraphQL)

Related queries and mutations in Integrations and connections. Each has its own section.

Queries

getAggregatedQueries (query)

getAggregatedQueries is a query in the Monte Carlo GraphQL API, in Integrations and connections. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Deprecated: Use GetMetricsV4 instead

DEPRECATED. Retrieve aggregated metrics

Arguments

ArgumentTypeDescription
mconString!MCON for the table
startTimeDateTime!Filter for queries on or after this date
endTimeDateTime!Filter for queries on or before this date
queryTypeQueryType!Filter for reads or writes to the table
limitInt!Number of aggregated queries to return. Up to a maximum of 1000
endCursorStringCursor used to get results from the next page
categoryQueryCategoryFilter queries by category. Matches either the query's category or its sub-category.
userStringFilter queries by user
categories[QueryCategory!]Filter queries matching any of these categories. Matches the query's sub-category. The broader category is used only when the query has no sub-category. Combined with category (AND) if both are provided.
users[String!]Filter queries run by any of these users. Combined with user (AND) if both are provided.
queryCharactersIntNumber of characters to return for the sample query Default: 50.

Returns

AggregatedQueryResults

Example

query GetAggregatedQueries($mcon: String!, $startTime: DateTime!, $endTime: DateTime!, $queryType: QueryType!, $limit: Int!) {
  getAggregatedQueries(mcon: $mcon, startTime: $startTime, endTime: $endTime, queryType: $queryType, limit: $limit) {
    aggregatedQueries {
      date
      groupId
      queryHash
      user
      category
      latestQuery
      latestQueryId
      latestQueryTimestamp
      count
      averageRunTime
      onDemandRuns
      onDemandBytesBilled
      reservedRuns
      reservedSlotMs
      failedRuns
    }
  }
}

Types used only by getAggregatedQueries

AggregatedQuery

Object type.

FieldTypeDescription
dateDateDate the queries occurred on
groupIdStringHash that is shared by all the aggregated queries for writes
queryHashStringHash that is shared by all the aggregated queries for reads
userStringUser of the aggregated queries
categoryQueryCategoryCategory of the aggregated queries
latestQueryStringSubstring of the latest query from the aggregated group containing the first n characters defined by the query_characters parameter in the request
latestQueryIdStringID of the latest query
latestQueryTimestampDateTimeTimestamp of the latest query
countIntCount of the number of queries aggregated
averageRunTimeIntAverage run time of the aggregated queries in milliseconds
onDemandRunsIntSuccessful runs billed on demand, by bytes billed. Excludes runs collected before slot time and reservations were recorded. Runs not counted as on demand, reserved or failed have an unknown billing model. Null unless the queries write a BigQuery table
onDemandBytesBilledBigIntBytes billed across the on-demand runs. Null unless the queries write a BigQuery table
reservedRunsIntSuccessful runs on reserved BigQuery capacity, which is paid for whether or not it is used. Excludes free load jobs. Null unless the queries write a BigQuery table
reservedSlotMsBigIntSlot time the reserved runs used, in milliseconds. Null unless the queries write a BigQuery table
failedRunsIntRuns that failed. Null when the queries read the table
AggregatedQueryResults

Object type.

FieldTypeDescription
aggregatedQueries[AggregatedQuery]List of aggregated queries which are grouped based on their group ID
pageInfoNextPageInfoData necessary to paginate aggregated queries

Related types

BigInt, Date, DateTime, NextPageInfo, QueryCategory, QueryType

getQueriedTables (query)

getQueriedTables is a query in the Monte Carlo GraphQL API, in Integrations and connections. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Tables queried in the period, most-queried first. A table path present in more than one warehouse yields one row per warehouse, so limit bounds paths rather than rows.

Arguments

ArgumentTypeDescription
startTimeDateTime!Start of the period to consider
endTimeDateTime!End of the period to consider
limitInt!Number of tables to return.
userStringFilter queries by user (email)
restrictToAccessibleDomainsBooleanDrop tables the caller cannot prove access to. Off by default, which answers over the whole account. limit bounds the table paths read before narrowing, so a restricted caller may receive fewer rows than requested, and a row with no mcon is always dropped.

Returns

[QueriedTable]

Example

query GetQueriedTables($startTime: DateTime!, $endTime: DateTime!, $limit: Int!) {
  getQueriedTables(startTime: $startTime, endTime: $endTime, limit: $limit) {
    table
    mcon
    count
  }
}

Types used only by getQueriedTables

QueriedTable

Object type.

FieldTypeDescription
tableStringFull table ID of the table
mconStringMCON of the table, or null when the catalog does not hold this path (dropped, never ingested, or not a table).
countIntNumber of times the table was queried

Related types

DateTime

getQueryDimensions (query)

getQueryDimensions is a query in the Monte Carlo GraphQL API, in Integrations and connections. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Arguments

ArgumentTypeDescription
mconString!Mcon of the table or job to get query dimensions for
startTimeDateTime!Filter for queries on or after this date
endTimeDateTime!Filter for queries on or before this date
queryTypeQueryTypeFilter for reads or writes. Required for a table. Optional for a job: omit it for every query the job ran.

Returns

QueryDimensions

Example

query GetQueryDimensions($mcon: String!, $startTime: DateTime!, $endTime: DateTime!) {
  getQueryDimensions(mcon: $mcon, startTime: $startTime, endTime: $endTime) {
    users
    categories
  }
}

Types used only by getQueryDimensions

QueryDimensions

Object type.

FieldTypeDescription
users[String]A distinct list of users for a list of queries
categories[QueryCategory]A distinct list of query categories for a list of queries

Related types

DateTime, QueryCategory, QueryType

getQueryRcas (query)

getQueryRcas is a query in the Monte Carlo GraphQL API, in Integrations and connections. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Get query RCAs for a given incident.

Arguments

ArgumentTypeDescription
incidentIdUUIDIncident identifier. Deprecated, use alertId instead
alertIdUUIDAlert identifier

Returns

[QueryRca]

Example

query GetQueryRcas {
  getQueryRcas {
    tableMcon
    groupId
    timestamp
    type
    rcaData
    eventUuid
  }
}

Types used only by getQueryRcas

QueryRca

Object type. Query RCA result

FieldTypeDescription
tableMconStringMCON of affected table
groupIdStringIdentifier for a grouping of like/same queries
timestampDateTimeTime RCA was executed
typeQueryRcaTypeType of query RCA
rcaDataJSONStringGet full rca data
eventUuidUUID!The uuid connected of the event the RCA is connected to
QueryRcaType

Enum type. Types of query RCAs

ValueDescription
NEW
UPDATE
FAILED
EMPTY
UPSTREAM
QDR
DBT_FAIL_SKIP
AFR

Related types

DateTime, JSONString, UUID

getQueryText (query)

getQueryText is a query in the Monte Carlo GraphQL API, in Integrations and connections. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Arguments

ArgumentTypeDescription
keyString!Query text key

Returns

String

Example

query GetQueryText($key: String!) {
  getQueryText(key: $key)
}

Source: The GraphQL API reference

This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.