Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var APMMetrics = []Metric{ { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("health"), plugin.NewNamespaceElement("status"), }, Type: "application", Path: "HealthStatus", Unit: "string", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("reporting"), }, Type: "application", Path: "Reporting", Unit: "bool", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("application"), plugin.NewNamespaceElement("response_time"), }, Type: "application", Path: "ApplicationSummary/ResponseTime", Unit: "float", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("application"), plugin.NewNamespaceElement("throughput"), }, Type: "application", Path: "ApplicationSummary/Throughput", Unit: "float", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("application"), plugin.NewNamespaceElement("error_rate"), }, Type: "application", Path: "ApplicationSummary/ErrorRate", Unit: "float", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("application"), plugin.NewNamespaceElement("apdex_target"), }, Type: "application", Path: "ApplicationSummary/ApdexTarget", Unit: "float", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("application"), plugin.NewNamespaceElement("apdex_score"), }, Type: "application", Path: "ApplicationSummary/ApdexScore", Unit: "float", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("application"), plugin.NewNamespaceElement("host_count"), }, Type: "application", Path: "ApplicationSummary/HostCount", Unit: "int", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("application"), plugin.NewNamespaceElement("instance_count"), }, Type: "application", Path: "ApplicationSummary/InstanceCount", Unit: "int", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("user"), plugin.NewNamespaceElement("response_time"), }, Type: "application", Path: "EndUserSummary/ResponseTime", Unit: "float", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("user"), plugin.NewNamespaceElement("throughput"), }, Type: "application", Path: "EndUserSummary/Throughput", Unit: "float", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("user"), plugin.NewNamespaceElement("apdex_target"), }, Type: "application", Path: "EndUserSummary/ApdexTarget", Unit: "float", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "Application id", Value: "*", }, plugin.NewNamespaceElement("show"), plugin.NewNamespaceElement("summary"), plugin.NewNamespaceElement("user"), plugin.NewNamespaceElement("apdex_score"), }, Type: "application", Path: "EndUserSummary/ApdexScore", Unit: "float", }, }
APMMetrics is a list containing the available APM metrics and their properties.
var CustomMetrics = []Metric{ { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("application"), plugin.NamespaceElement{ Name: "app_id", Description: "The application id", Value: "*", }, plugin.NamespaceElement{ Name: "minutes", Description: "Number of minutes to construct a relative timeframe from (now - minutes).", Value: "*", }, plugin.NamespaceElement{ Name: "metric_name", Description: "Metric name", Value: "*", }, plugin.NamespaceElement{ Name: "value_name", Description: "Value name", Value: "*", }, plugin.NewNamespaceElement("value"), }, Type: "application", Unit: "float", }, { Namespace: plugin.Namespace{ plugin.NewNamespaceElement("component"), plugin.NamespaceElement{ Name: "component_id", Description: "The component id", Value: "*", }, plugin.NamespaceElement{ Name: "minutes", Description: "Number of minutes to construct a relative timeframe from (now - minutes).", Value: "*", }, plugin.NamespaceElement{ Name: "metric_name", Description: "Metric name", Value: "*", }, plugin.NamespaceElement{ Name: "value_name", Description: "Value name", Value: "*", }, plugin.NewNamespaceElement("value"), }, Type: "component", Unit: "float", }, }
CustomMetrics defines the available metric data metrics.
Functions ¶
This section is empty.
Types ¶
type APM ¶
type APM struct {
APMClient APMClient
}
APM represents the APM service part of New Relic.
func (*APM) CollectMetrics ¶
CollectMetrics fetches the requested APM metrics and returns them.
type APMClient ¶
type APMClient interface {
GetApplication(int) (*nr.Application, error)
}
APMClient is the interface every AMP client needs to implement.
type APMClientImpl ¶
type APMClientImpl struct {
APIKey string
}
APMClientImpl is a real implementation of an APMClient.
func (*APMClientImpl) GetApplication ¶
func (a *APMClientImpl) GetApplication(appID int) (*nr.Application, error)
GetApplication fetches application information from New Relic (APM).
type Collector ¶
type Collector struct{}
Collector takes care of fetching data from New Relic.
func (*Collector) CollectMetrics ¶
CollectMetrics fetches all the requested metrics and returns them.
func (*Collector) GetConfigPolicy ¶
func (n *Collector) GetConfigPolicy() (plugin.ConfigPolicy, error)
GetConfigPolicy defines the configuration variables this plugin supports.
type Custom ¶ added in v0.0.5
type Custom struct {
CustomClient CustomClient
}
Custom represents the custom metric data metrics available from New Relic.
func (*Custom) CollectMetrics ¶ added in v0.0.5
CollectMetrics fetches the requested metric data metrics and returns them.
type CustomClient ¶ added in v0.0.5
type CustomClient interface { GetApplicationMetricData(int, []string, *nr.MetricDataOptions) (*nr.MetricDataResponse, error) GetComponentMetricData(int, []string, *nr.MetricDataOptions) (*nr.MetricDataResponse, error) }
CustomClient defines the custom metrics (all metric data metrics) client.
type CustomClientImpl ¶ added in v0.0.5
type CustomClientImpl struct {
APIKey string
}
CustomClientImpl is a real implementation of an CustomClient.
func (*CustomClientImpl) GetApplicationMetricData ¶ added in v0.0.5
func (cc *CustomClientImpl) GetApplicationMetricData(appID int, names []string, options *nr.MetricDataOptions) (*nr.MetricDataResponse, error)
GetApplicationMetricData fetches application specific metric data.
func (*CustomClientImpl) GetComponentMetricData ¶ added in v0.0.5
func (cc *CustomClientImpl) GetComponentMetricData(componentID int, names []string, options *nr.MetricDataOptions) (*nr.MetricDataResponse, error)
GetComponentMetricData fetches component specific metric data.
type Service ¶
type Service interface { GetMetricTypes(plugin.Config) ([]plugin.Metric, error) CollectMetrics([]plugin.Metric) ([]plugin.Metric, error) }
Service is the interface every New Relic service component must implement.