Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AppSync alarms and dashboard #104

Closed
wants to merge 4 commits into from
Closed

Conversation

direnakkoc
Copy link
Collaborator

@direnakkoc direnakkoc commented Nov 25, 2022

Description

Add support for AppSync alarms for the metrics are:

  • 5XXError
  • Latency

Add support for AppSync dashboard for the metrics are:

  • 5XXError
  • Latency
  • 4XXError
  • Requests
  • ConnectServerError
  • DisconnectServerError
  • SubscribeServerError
  • UnsubscribeServerError
  • PublishDataMessageServerError

Motivation and Context

  • 5XXError: Errors encountered during the running of a GraphQL query. For example, this can occur when invoking a query for an empty or incorrect schema. It can also occur when the Amazon Cognito user pool ID or AWS Region is not valid. Alternatively, this could also happen if AWS AppSync encounters an issue during processing of a request.
  • Latency: The time between when AWS AppSync receives a request from a client and when it returns a response to the client. This doesn’t include the network latency encountered for a response to reach the end devices.
  • 4XXError: Errors resulting from requests that are not valid due to an incorrect client configuration. Typically, these errors happen anywhere outside of GraphQL processing. For example, these errors can occur when the request includes an incorrect JSON payload or an incorrect query, when the service is throttled, or when the authorization settings are misconfigured.
  • Requests: The number of requests (queries + mutations) that all APIs in your account have processed, by Region.
  • ConnectServerError: The number of errors that originated from AWS AppSync while processing connections. This usually happens when an unexpected server-side issue occurs.
  • DisconnectServerError: The number of server errors that originated from AWS AppSync while disconnecting WebSocket connections.
  • SubscribeServerError: The number of errors that originated from AWS AppSync while processing subscriptions. This usually happens when an unexpected server-side issue occurs.
  • UnsubscribeServerError: The number of errors that originated from AWS AppSync while processing unsubscribe requests. This usually happens when an unexpected server-side issue occurs.
  • PublishDataMessageServerError: The number of errors that originated from AWS AppSync while publishing subscription event messages. This usually happens when an unexpected server-side issue occurs.

How Has This Been Tested?

  • Unit tests added

Screenshots (if appropriate):

appsyncAPI

appsyncRealTimeSubscriptions

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@direnakkoc direnakkoc requested a review from eoinsha November 25, 2022 16:29
@coveralls
Copy link

coveralls commented Nov 25, 2022

Coverage Status

Coverage remained the same at 100.0% when pulling 8afae38 on appsync-metrics into 78d0d87 on main.

- Remove redundant resources
Copy link
Contributor

@eoinsha eoinsha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good. Some comments added for now. Will review again when remaining tests and documentation updates are done.

function createAppSyncWidgets (appSyncResources) {
const appSyncWidgets = []
const metricGroups = {
CloudWatch: ['5XXError', '4XXError', 'Latency', 'Requests'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "API" makes more sense here than "CloudWatch" as a group label

function createAppSyncWidgets (appSyncResources) {
const appSyncWidgets = []
const metricGroups = {
CloudWatch: ['5XXError', '4XXError', 'Latency', 'Requests'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have to use different y-axes for metrics of different units

@@ -16,7 +16,7 @@ custom:
- Key: Stage
Value: ${self:provider.stage}
slicWatch:
topicArn: ${env:ALARM_TOPIC}
# topicArn: ${env:ALARM_TOPIC}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment # should be removed before merge

- ALLOW_REFRESH_TOKEN_AUTH
PreventUserExistenceErrors: ENABLED

#Cognito users pool Admin group
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add a space after all comment markers (#).

@@ -8,7 +8,7 @@ plugins:
- serverless-slic-watch-plugin
custom:
slicWatch:
topicArn: ${env:ALARM_TOPIC}
# topicArn: ${env:ALARM_TOPIC}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment before merge

@eoinsha
Copy link
Contributor

eoinsha commented Nov 2, 2023

Already merged as part of #105

@eoinsha eoinsha closed this Nov 2, 2023
@eoinsha eoinsha deleted the appsync-metrics branch November 2, 2023 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants