Documentation
¶
Index ¶
- Constants
- type BuildInfoProvider
- type GetIssuesInput
- type GetStatsV2Input
- type HTTPClient
- type SentryClient
- func (sc *SentryClient) Fetch(path string, out interface{}) error
- func (sc *SentryClient) GetIssues(gii GetIssuesInput) ([]SentryIssue, string, error)
- func (sc *SentryClient) GetOrganizations() ([]SentryOrganization, error)
- func (sc *SentryClient) GetProjects(organizationSlug string) ([]SentryProject, error)
- func (sc *SentryClient) GetStatsV2(args GetStatsV2Input) (StatsV2Response, string, error)
- type SentryErrorResponse
- type SentryIssue
- type SentryOrganization
- type SentryProject
- type StatsV2Response
Constants ¶
View Source
const ( PluginID string = "grafana-sentry-datasource" DefaultSentryURL string = "https://sentry.io" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildInfoProvider ¶
BuildInfoProvider is a function that returns the build.Info for the plugin
type GetIssuesInput ¶
type GetIssuesInput struct {
OrganizationSlug string
ProjectIds []string
Environments []string
Query string
From time.Time
To time.Time
Sort string
Limit int64
}
func (*GetIssuesInput) ToQuery ¶
func (gii *GetIssuesInput) ToQuery() string
type GetStatsV2Input ¶
type GetStatsV2Input struct {
OrganizationSlug string
From time.Time
To time.Time
Interval string
Category []string
Fields []string
GroupBy []string
ProjectIds []string
Outcome []string
Reason []string
}
func (*GetStatsV2Input) ToQuery ¶
func (args *GetStatsV2Input) ToQuery() string
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTP creates an HTTP client with a 'Do' method. It automatically injects the provided api token into every request with an `Authorization: Bearer AuthToken` header
func NewHTTPClient ¶
func NewHTTPClient(d doer, pluginId string, b BuildInfoProvider, authToken string) HTTPClient
NewHTTPClient creates a new AuthHTTP client
type SentryClient ¶
type SentryClient struct {
BaseURL string
OrgSlug string
// contains filtered or unexported fields
}
func NewSentryClient ¶
func NewSentryClient(baseURL string, orgSlug string, authToken string, doerClient doer) (*SentryClient, error)
func (*SentryClient) Fetch ¶
func (sc *SentryClient) Fetch(path string, out interface{}) error
func (*SentryClient) GetIssues ¶
func (sc *SentryClient) GetIssues(gii GetIssuesInput) ([]SentryIssue, string, error)
func (*SentryClient) GetOrganizations ¶
func (sc *SentryClient) GetOrganizations() ([]SentryOrganization, error)
func (*SentryClient) GetProjects ¶
func (sc *SentryClient) GetProjects(organizationSlug string) ([]SentryProject, error)
func (*SentryClient) GetStatsV2 ¶
func (sc *SentryClient) GetStatsV2(args GetStatsV2Input) (StatsV2Response, string, error)
type SentryErrorResponse ¶
type SentryErrorResponse struct {
Detail string `json:"detail"`
}
type SentryIssue ¶
type SentryIssue struct {
ID string `json:"id"`
ShortID string `json:"shortId"`
Title string `json:"title"`
Count string `json:"count"`
UserCount int64 `json:"userCount"`
Status string `json:"status"`
Level string `json:"level"`
Type string `json:"type"`
Platform string `json:"platform"`
FirstSeen time.Time `json:"firstSeen"`
LastSeen time.Time `json:"lastSeen"`
Culprit string `json:"culprit"`
HasSeen bool `json:"hasSeen"`
IsUnhandled bool `json:"isUnhandled"`
Permalink string `json:"permalink"`
IsPublic bool `json:"isPublic"`
Project struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Platform string `json:"platform"`
} `json:"project"`
Metadata struct {
Value string `json:"value"`
Type string `json:"type"`
Filename string `json:"filename"`
Function string `json:"function"`
} `json:"metadata"`
NumComments int64 `json:"numComments"`
AssignedTo struct {
Email string `json:"email"`
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
} `json:"assignedTo"`
IsBookmarked bool `json:"isBookmarked"`
IsSubscribed bool `json:"isSubscribed"`
SubscriptionDetails struct {
Reason string `json:"reason"`
} `json:"subscriptionDetails"`
}
type SentryOrganization ¶
type SentryOrganization struct {
DateCreated time.Time `json:"dateCreated"`
ID string `json:"id"`
IsEarlyAdopter bool `json:"isEarlyAdopter"`
Name string `json:"name"`
Require2FA bool `json:"require2FA"`
Slug string `json:"slug"`
Status struct {
ID string `json:"id"`
Name string `json:"name"`
} `json:"status"`
Avatar struct {
AvatarType string `json:"avatarType"`
} `json:"avatar"`
}
type SentryProject ¶
type SentryProject struct {
DateCreated time.Time `json:"dateCreated"`
HasAccess bool `json:"hasAccess"`
ID string `json:"id"`
IsBookmarked bool `json:"isBookmarked"`
IsMember bool `json:"isMember"`
Environments []string `json:"environments"`
Name string `json:"name"`
Slug string `json:"slug"`
Team struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
} `json:"team"`
Teams []struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
} `json:"teams"`
}
type StatsV2Response ¶
type StatsV2Response struct {
Start time.Time `json:"start"`
End time.Time `json:"end"`
Intervals []time.Time `json:"intervals"`
Groups []struct {
By struct {
Reason string `json:"reason"`
Category string `json:"category"`
Outcome string `json:"outcome"`
} `json:"by"`
Totals struct {
SumTimesSeen int64 `json:"sum(times_seen)"`
SumQuantity int64 `json:"sum(quantity)"`
} `json:"totals"`
Series struct {
SumTimesSeen []int64 `json:"sum(times_seen)"`
SumQuantity []int64 `json:"sum(quantity)"`
} `json:"series"`
} `json:"groups"`
}
Click to show internal directories.
Click to hide internal directories.