Skip to content

Instantly share code, notes, and snippets.

View shairyar's full-sized avatar

shairyar shairyar

View GitHub Profile
@shairyar
shairyar / PaginatedPerformanceIncidentsQuery.gql
Created June 5, 2025 15:01
Fetch performance incidents of logged by AppSignal
query PaginatedPerformanceIncidentsQuery($appId: String!, $namespaces: [String], $limit: Int, $offset: Int) {
app(id: $appId) {
id
paginatedPerformanceIncidents(
namespaces: $namespaces
limit: $limit
offset: $offset
) {
total
rows {
@shairyar
shairyar / AssignedIncidentsQuery.gql
Created June 3, 2025 11:42
Fetch the list of tasks assigned to a user
query AssignedIncidentsQuery($appId: String, $limit: Int, $offset: Int, $state: [IncidentStateEnum!], $severity: IncidentSeverityEnum, $query: String, $assigneeIds: [String!]) {
viewer {
id
incidents(
limit: $limit
offset: $offset
appId: $appId
state: $state
severity: $severity
query: $query
@shairyar
shairyar / OrganizationsQuery.gql
Created June 3, 2025 11:40
Fetch the list of all organizations in AppSignal with users
query OrganizationsQuery {
viewer {
id
organizations {
id
name
users {
id
name
}
@shairyar
shairyar / query.gql
Last active May 8, 2025 10:46
GraphQL Query to close an incident
mutation updateIncidentMutation($appId: String!, $number: Int!, $state: IncidentStateEnum, $description: String) {
updateIncident(
appId: $appId
number: $number
state: $state
description: $description
) {
... on ExceptionIncident {
id
state
@shairyar
shairyar / app.rb
Created March 17, 2025 12:31
Using Ruby script to start AppSignal
# Requirements:
# bundle install
# bundle exec ruby app.rb
# app.rb
require "appsignal"
# Configure appsignal if needed
Appsignal.configure do |config|
# config.<option> = value
```
query uptimeMonitorNotifierQuery($appId: String!) {
app(id: $appId) {
id
notifiers {
id
name
}
}
}
query OrganizationQuery($slug: String!) {
organization(slug: $slug) {
id
name
slug
apps {
id
name
environment
viewerPinned
@shairyar
shairyar / actionsThroughput.gql
Created May 16, 2024 07:07
List of actions with throughput
query PaginatedMetricsListQuery($appId: String!, $timeframe: TimeframeEnum, $query: [MetricAggregation!]!, $limit: Int, $offset: Int) {
app(id: $appId) {
id
metrics {
list(
query: $query
timeframe: $timeframe
limit: $limit
offset: $offset
) {
@shairyar
shairyar / importDashboardMutation.gql
Created February 19, 2024 12:45
GraphQL query to important dashboard
```gql
mutation importDashboardMutation($appId: String!, $json: String!) {
importDashboard(appId: $appId, json: $json) {
...Dashboard
__typename
}
}
fragment Dashboard on Dashboard {
id
@shairyar
shairyar / createAppMutation.gql
Created February 12, 2024 13:00
Create an application in AppSignal using GraphQL API
mutation createAppMutation($organizationSlug: String!, $name: String!, $environment: String!) {
createApp(
organizationSlug: $organizationSlug
name: $name
environment: $environment
) {
...FrontendApp
}
}