newrelic

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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

func (a *APM) CollectMetrics(metrics []plugin.Metric) ([]plugin.Metric, error)

CollectMetrics fetches the requested APM metrics and returns them.

func (*APM) GetMetricTypes

func (a *APM) GetMetricTypes(_ plugin.Config) ([]plugin.Metric, error)

GetMetricTypes returns the available APM metric types.

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

func (n *Collector) CollectMetrics(metrics []plugin.Metric) ([]plugin.Metric, error)

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.

func (*Collector) GetMetricTypes

func (n *Collector) GetMetricTypes(cfg plugin.Config) ([]plugin.Metric, error)

GetMetricTypes returns all the metric types this collector 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

func (c *Custom) CollectMetrics(metrics []plugin.Metric) ([]plugin.Metric, error)

CollectMetrics fetches the requested metric data metrics and returns them.

func (*Custom) GetMetricTypes added in v0.0.5

func (c *Custom) GetMetricTypes(_ plugin.Config) ([]plugin.Metric, error)

GetMetricTypes returns the available metric types.

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 Metric added in v0.0.2

type Metric struct {
	Namespace plugin.Namespace
	Type      string
	Path      string
	Unit      string
}

Metric describes a single fetchable metric.

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.

func NewAPM

func NewAPM(apiKey string) Service

NewAPM creates and returns a new APM object with a configured APMClient.

func NewCustom added in v0.0.5

func NewCustom(apiKey string) Service

NewCustom creates and returns a new Custom object with a configured CustomClient.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL