Subscription Logging Events
GraphQL ASP.NET tracks some special events related to the management of subscriptions. They are outlined below.
Common Event Properties
The common event properties outlined on the standard events page apply to all subscription events as well.
Server Level Events
Subscription Event Dispatch Queue Alert
This event is recorded when the server's schema-agnostic, internal dispatch queue reaches a given threshold. The internal dispatch queue is where all subscription events destined for connected clients are staged before being processed. The thresholds at which this alert is recorded can be customized.
Property | Description |
---|---|
ThresholdLevelReached | The declared threshold level that was reached causing this entry to be recorded. (Expressed in # of queued events) |
EventQueueCount | The actual number of events currently queued. |
CustomMessage | An optional, staticly declared message registered with the threshold level. |
Schema Level Events
Subscription Route Registered
This event is recorded when GraphQL successfully registers an entry in the ASP.NET route table to accept requests for a target schema as well as register the middleware component necessary to receive websocket requests.
Important Properties
Property | Description |
---|---|
SchemaTypeName | The full name of your your schema type. For most single schema applications this will be GraphQL.AspNet.Schemas.GraphSchema . |
SchemaSubscriptionRoutePath | The relative URL that was registered for the schema type, e.g. '/graphql |
Client Connection Events
Client Registered
This event is recorded when GraphQL successfully accepts a client and has assigned a client proxy to manage the connection. This event is recorded just prior to the connection is "started" and messaging begins.
Important Properties
Property | Description |
---|---|
ClientId | A unique id asigned to the client when it first connected. |
SchemaTypeName | The full name of your your schema type. For most single schema applications this will be GraphQL.AspNet.Schemas.GraphSchema . |
ClientTypeName | The full name of the assigned client proxy type. In general, a different type is used per messaging protocol. |
ClientProtocol | The protocol negotiated by the client and server that will be used for the duration of the connection. |
Client Dropped
This event is recorded when GraphQL is releasing a client. The connection has been "stopped" and no additional messagings are being broadcast. This event occurs just before the HTTP connection is closed.
Important Properties
Property | Description |
---|---|
ClientId | A unique id asigned to the client when it first connected. |
ClientTypeName | The full name of the assigned client proxy type. In general, a different type is used per messaging protocol. |
ClientProtocol | The protocol negotiated by the client and server that will be used for the duration of the connection. |
Unsupported Client Protocol
This event is recorded when GraphQL attempts to create an appropriate proxy class for the connection but no such proxy could be deteremined from the details providied in the initial request. In general, this means the provided websocket sub protocols did not match a supported protocol for this server and schema combination.
Property | Description |
---|---|
SchemaTypeName | The full name of your your schema type. For most single schema applications this will be GraphQL.AspNet.Schemas.GraphSchema . |
ClientProtocol | The protocol(s) requested by the client connection that were not accepted |
Important Properties
Property | Description |
---|---|
ClientId | A unique id asigned to the client when it first connected. |
ClientTypeName | The full name of the assigned client proxy type. In general, a different type is used per messaging protocol. |
Client Messaging Events
Subscription Event Received
This event is recorded by a client proxy when it received an event from the router and has determined that it should be handled.
Important Properties
Property | Description |
---|---|
ClientId | A unique id asigned to the client when it first connected. |
SchemaTypeName | The full name of your your schema type. For most single schema applications this will be GraphQL.AspNet.Schemas.GraphSchema . |
SubscriptionPath | The path to the target top-level subscription field in the schema |
SubscriptionCount | The number of registered subscriptions, for this client, that will receive this event. |
SubscriptionIds | A comma seperated list of id values representing the subscriptions that will receive this event. |
MachineName | The Environment.MachineName of the current server. |
Subscription Registered
This event is recorded by a client proxy when it starts a new subscription on behalf of its connected client.
Important Properties
Property | Description |
---|---|
ClientId | A unique id asigned to the client when it first connected. |
SubscriptionPath | The path to the target top-level subscription field in the schema |
SubscriptionId | The subscription id requested by the client. |
Subscription Registered
This event is recorded by a client proxy when it unregistered and abandons an existing subscription. This may be due to the server ending the subscription or the client requesting it be stopped.
Important Properties
Property | Description |
---|---|
ClientId | A unique id asigned to the client when it first connected. |
SubscriptionPath | The path to the target top-level subscription field in the schema |
SubscriptionId | The subscription id requested by the client. |
Client Message Received
This event is recorded by a client proxy when it successfully receives and deserializes a message from its connected client. Not all client proxies may record this event. The messages a client proxy defines must implement ILoggableClientProxyMessage
in order to use this event.
Important Properties
Property | Description |
---|---|
ClientId | A unique id asigned to the client when it first connected. |
MessageType | A string value representing the type of the message that was received |
MessageId | The globally unique message id that was assigned to the incoming message. |
Client Message Sent
This event is recorded by a client proxy when it successfully serializes and transmits a message to its connected client. Not all client proxies may record this event. The messages a client proxy defines must implement ILoggableClientProxyMessage
in order to use this event.
Important Properties
Property | Description |
---|---|
ClientId | A unique id asigned to the client when it first connected. |
MessageType | A string value representing the type of the message that was received |
MessageId | The globally unique message id that was assigned to the incoming message. |
Subscription Events
Subscription events refer to the events that are raised from mutations and processed by client proxies with registered subscriptions against those events.
Subscription Event Published
This event is recorded just after an event is handed off to a ISubscriptionEventPublisher
for publishing to a storage medium. Custom publishers do not need to record this event manually.
Important Properties
Property | Description |
---|---|
SchemaType | The schema type name as it was published. This will likely include additional information not recorded in standard schema level events. |
DataType | The data type name of the data object that was published. |
SubscriptionEventId | The globally unique id of the subscription event. |
SubscriptionEventName | The name of the event as its defined in the schema. |
MachineName | The Environment.MachineName of the current server. |
Subscription Event Received
This event is recorded by the event router just after it receives an event. The router will then proceed to forward the event to the correct client instances for processing.
Important Properties
Property | Description |
---|---|
SchemaType | The schema type name as it was recevied. This will likely include additional information not recorded in standard schema level events. |
DataType | The data type name of the data object that was received. |
SubscriptionEventId | The globally unique id of the subscription event. |
SubscriptionEventName | The name of the event as its defined in the schema. |
MachineName | The Environment.MachineName of the current server. |