Documentation ¶
Index ¶
- Variables
- type APM
- func (apm *APM) CreateDeployment(applicationID int, deployment Deployment) (*Deployment, error)
- func (apm *APM) CreateLabel(label Label) (*Label, error)
- func (apm *APM) DeleteApplication(applicationID int) (*Application, error)
- func (apm *APM) DeleteDeployment(applicationID int, deploymentID int) (*Deployment, error)
- func (apm *APM) DeleteLabel(key string) (*Label, error)
- func (apm *APM) GetApplication(applicationID int) (*Application, error)
- func (apm *APM) GetKeyTransaction(id int) (*KeyTransaction, error)
- func (apm *APM) GetLabel(key string) (*Label, error)
- func (apm *APM) ListApplications(params *ListApplicationsParams) ([]Application, error)
- func (apm *APM) ListDeployments(applicationID int) ([]*Deployment, error)
- func (apm *APM) ListKeyTransactions(params *ListKeyTransactionsParams) ([]*KeyTransaction, error)
- func (apm *APM) ListLabels() ([]*Label, error)
- func (apm *APM) UpdateApplication(applicationID int, params UpdateApplicationParams) (*Application, error)
- type Application
- type ApplicationEndUserSummary
- type ApplicationLinks
- type ApplicationSettings
- type ApplicationSummary
- type Deployment
- type DeploymentLinks
- type KeyTransaction
- type KeyTransactionLinks
- type Label
- type LabelLinks
- type ListApplicationsParams
- type ListKeyTransactionsParams
- type UpdateApplicationParams
Constants ¶
This section is empty.
Variables ¶
var BaseURLs = config.DefaultBaseURLs
BaseURLs represents the base API URLs for the different environments of the New Relic REST API V2.
Functions ¶
This section is empty.
Types ¶
type APM ¶
type APM struct {
// contains filtered or unexported fields
}
APM is used to communicate with the New Relic APM product.
func (*APM) CreateDeployment ¶
func (apm *APM) CreateDeployment(applicationID int, deployment Deployment) (*Deployment, error)
CreateDeployment creates a deployment marker for an application.
func (*APM) CreateLabel ¶
CreateLabel creates a new label within an account.
func (*APM) DeleteApplication ¶
func (apm *APM) DeleteApplication(applicationID int) (*Application, error)
DeleteApplication is used to delete a New Relic application. This process will only succeed if the application is no longer reporting data.
func (*APM) DeleteDeployment ¶
func (apm *APM) DeleteDeployment(applicationID int, deploymentID int) (*Deployment, error)
DeleteDeployment deletes a deployment marker for an application.
func (*APM) DeleteLabel ¶
DeleteLabel deletes a label by key. A label's key is a string hash formatted as <Category>:<Name>.
func (*APM) GetApplication ¶
func (apm *APM) GetApplication(applicationID int) (*Application, error)
GetApplication is used to retrieve a single New Relic application.
func (*APM) GetKeyTransaction ¶
func (apm *APM) GetKeyTransaction(id int) (*KeyTransaction, error)
GetKeyTransaction returns a specific key transaction by ID.
func (*APM) GetLabel ¶
GetLabel gets a label by key. A label's key is a string hash formatted as <Category>:<Name>.
func (*APM) ListApplications ¶
func (apm *APM) ListApplications(params *ListApplicationsParams) ([]Application, error)
ListApplications is used to retrieve New Relic applications.
func (*APM) ListDeployments ¶
func (apm *APM) ListDeployments(applicationID int) ([]*Deployment, error)
ListDeployments returns deployments for an application.
func (*APM) ListKeyTransactions ¶
func (apm *APM) ListKeyTransactions(params *ListKeyTransactionsParams) ([]*KeyTransaction, error)
ListKeyTransactions returns all key transactions for an account.
func (*APM) ListLabels ¶
ListLabels returns the labels within an account.
func (*APM) UpdateApplication ¶
func (apm *APM) UpdateApplication(applicationID int, params UpdateApplicationParams) (*Application, error)
UpdateApplication is used to update a New Relic application's name and/or settings.
type Application ¶
type Application struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Language string `json:"language,omitempty"` HealthStatus string `json:"health_status,omitempty"` Reporting bool `json:"reporting"` LastReportedAt string `json:"last_reported_at,omitempty"` Summary ApplicationSummary `json:"application_summary,omitempty"` EndUserSummary ApplicationEndUserSummary `json:"end_user_summary,omitempty"` Settings ApplicationSettings `json:"settings,omitempty"` Links ApplicationLinks `json:"links,omitempty"` }
Application represents information about a New Relic application.
type ApplicationEndUserSummary ¶
type ApplicationEndUserSummary struct { ResponseTime float64 `json:"response_time"` Throughput float64 `json:"throughput"` ApdexTarget float64 `json:"apdex_target"` ApdexScore float64 `json:"apdex_score"` }
ApplicationEndUserSummary represents performance information about a New Relic application.
type ApplicationLinks ¶
type ApplicationLinks struct { ServerIDs []int `json:"servers,omitempty"` HostIDs []int `json:"application_hosts,omitempty"` InstanceIDs []int `json:"application_instances,omitempty"` AlertPolicyID int `json:"alert_policy"` }
ApplicationLinks represents all the links for a New Relic application.
type ApplicationSettings ¶
type ApplicationSettings struct { AppApdexThreshold float64 `json:"app_apdex_threshold,omitempty"` EndUserApdexThreshold float64 `json:"end_user_apdex_threshold,omitempty"` EnableRealUserMonitoring bool `json:"enable_real_user_monitoring"` UseServerSideConfig bool `json:"use_server_side_config"` }
ApplicationSettings represents some of the settings of a New Relic application.
type ApplicationSummary ¶
type ApplicationSummary struct { ResponseTime float64 `json:"response_time"` Throughput float64 `json:"throughput"` ErrorRate float64 `json:"error_rate"` ApdexTarget float64 `json:"apdex_target"` ApdexScore float64 `json:"apdex_score"` HostCount int `json:"host_count"` InstanceCount int `json:"instance_count"` ConcurrentInstanceCount int `json:"concurrent_instance_count"` }
ApplicationSummary represents performance information about a New Relic application.
type Deployment ¶
type Deployment struct { Links *DeploymentLinks `json:"links,omitempty"` ID int `json:"id,omitempty"` Revision string `json:"revision"` Changelog string `json:"changelog,omitempty"` Description string `json:"description,omitempty"` User string `json:"user,omitempty"` Timestamp string `json:"timestamp,omitempty"` }
Deployment represents information about a New Relic application deployment.
type DeploymentLinks ¶
type DeploymentLinks struct {
ApplicationID int `json:"application,omitempty"`
}
DeploymentLinks contain the application ID for the deployment.
type KeyTransaction ¶
type KeyTransaction struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` TransactionName string `json:"transaction_name,omitempty"` HealthStatus string `json:"health_status,omitempty"` LastReportedAt string `json:"last_reported_at,omitempty"` Reporting bool `json:"reporting"` Summary ApplicationSummary `json:"application_summary,omitempty"` EndUserSummary ApplicationEndUserSummary `json:"end_user_summary,omitempty"` Links KeyTransactionLinks `json:"links,omitempty"` }
KeyTransaction represents information about a New Relic key transaction.
type KeyTransactionLinks ¶
type KeyTransactionLinks struct {
Application int `json:"application,omitempty"`
}
KeyTransactionLinks represents associations for a key transaction.
type Label ¶
type Label struct { Key string `json:"key,omitempty"` Category string `json:"category,omitempty"` Name string `json:"name,omitempty"` Links LabelLinks `json:"links,omitempty"` }
Label represents a New Relic label.
type LabelLinks ¶
LabelLinks represents external references on the Label.
type ListApplicationsParams ¶
type ListApplicationsParams struct { Name string `url:"filter[name],omitempty"` Host string `url:"filter[host],omitempty"` IDs []int `url:"filter[ids],omitempty,comma"` Language string `url:"filter[language],omitempty"` }
ListApplicationsParams represents a set of filters to be used when querying New Relic applications.
type ListKeyTransactionsParams ¶
type ListKeyTransactionsParams struct { Name string `url:"filter[name],omitempty"` IDs []int `url:"filter[ids],omitempty,comma"` }
ListKeyTransactionsParams represents a set of filters to be used when querying New Relic key transactions.
type UpdateApplicationParams ¶
type UpdateApplicationParams struct { Name string Settings ApplicationSettings }
UpdateApplicationParams represents a set of parameters to be used when updating New Relic applications.