edge

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package edge provides a programmatic API for interacting with New Relic Edge with infinite tracing. It can be used to enable New Relic Edge and retrieve relevant config parameters.

Authentication

You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key:

https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys

Package edge provides a programmatic API for interacting with New Relic Edge.

Example (Trace_observer)
accountIDStr := os.Getenv("ACCOUNT_ID")
accountID, err := strconv.Atoi(accountIDStr)
if err != nil {
	log.Fatal("error parsing account ID")
}

// Initialize the client configuration.  A Personal API key is required to
// communicate with the backend API.
cfg := config.New()
cfg.PersonalAPIKey = os.Getenv("NEW_RELIC_API_KEY")

// Initialize the client.
client := New(cfg)

// Create a new trace observer.
traceObserver, err := client.CreateTraceObserver(accountID, "myObserver", EdgeProviderRegionTypes.AWS_US_EAST_1)
if err != nil {
	log.Fatal("error creating trace observer:", err)
}

// List the existing trace observers.
traceObservers, err := client.ListTraceObservers(accountID)
if err != nil {
	log.Fatal("error creating trace observer:", err)
}

log.Printf("trace observer count: %d", len(traceObservers))

// Delete an existing trace observer.
_, err = client.DeleteTraceObserver(accountID, traceObserver.ID)
if err != nil {
	log.Fatal("error deleting trace observer:", err)
}
Output:

Index

Examples

Constants

This section is empty.

Variables

View Source
var EdgeCreateTraceObserverResponseErrorTypeTypes = struct {
	/* ALREADY_EXISTS - A trace observer already exists for this account family and provider region. */
	ALREADY_EXISTS EdgeCreateTraceObserverResponseErrorType
	/* NO_AVAILABILITY_IN_REGION - Trace observers aren’t available in provider region. */
	NO_AVAILABILITY_IN_REGION EdgeCreateTraceObserverResponseErrorType
	/* UNAUTHORIZED_USER - You don’t have permission to make this trace observer call. */
	UNAUTHORIZED_USER EdgeCreateTraceObserverResponseErrorType
	/* UNEXPECTED_ERROR - We couldn’t process this request. */
	UNEXPECTED_ERROR EdgeCreateTraceObserverResponseErrorType
}{
	ALREADY_EXISTS:            "ALREADY_EXISTS",
	NO_AVAILABILITY_IN_REGION: "NO_AVAILABILITY_IN_REGION",
	UNAUTHORIZED_USER:         "UNAUTHORIZED_USER",
	UNEXPECTED_ERROR:          "UNEXPECTED_ERROR",
}
View Source
var EdgeDeleteTraceObserverResponseErrorTypeTypes = struct {
	/* ALREADY_DELETED - The trace observer has already been deleted. */
	ALREADY_DELETED EdgeDeleteTraceObserverResponseErrorType
	/* NOT_FOUND - No trace observer was found with the id given. */
	NOT_FOUND EdgeDeleteTraceObserverResponseErrorType
	/* UNAUTHORIZED_USER - You don’t have permission to make this trace observer call. */
	UNAUTHORIZED_USER EdgeDeleteTraceObserverResponseErrorType
	/* UNEXPECTED_ERROR - We couldn’t process this request. */
	UNEXPECTED_ERROR EdgeDeleteTraceObserverResponseErrorType
}{
	ALREADY_DELETED:   "ALREADY_DELETED",
	NOT_FOUND:         "NOT_FOUND",
	UNAUTHORIZED_USER: "UNAUTHORIZED_USER",
	UNEXPECTED_ERROR:  "UNEXPECTED_ERROR",
}
View Source
var EdgeEndpointStatusTypes = struct {
	/* CREATED - The endpoint has been created and is available for use. */
	CREATED EdgeEndpointStatus
	/* DELETED - The endpoint has been deleted and is no longer available for use. */
	DELETED EdgeEndpointStatus
}{
	CREATED: "CREATED",
	DELETED: "DELETED",
}
View Source
var EdgeEndpointTypeTypes = struct {
	/* PUBLIC - PUBLIC: the endpoint is reachable on the internet. */
	PUBLIC EdgeEndpointType
}{
	PUBLIC: "PUBLIC",
}
View Source
var EdgeProviderRegionTypes = struct {
	/* AWS_US_EAST_1 - Provider: `AWS`, Region: `us-east-1` */
	AWS_US_EAST_1 EdgeProviderRegion
	/* AWS_US_EAST_2 - Provider: `AWS`, Region: `us-east-2` */
	AWS_US_EAST_2 EdgeProviderRegion
}{
	AWS_US_EAST_1: "AWS_US_EAST_1",
	AWS_US_EAST_2: "AWS_US_EAST_2",
}
View Source
var EdgeTraceObserverResponseErrorTypeTypes = struct {
	/* UNAUTHORIZED_USER - You don’t have permission to make this trace observer call. */
	UNAUTHORIZED_USER EdgeTraceObserverResponseErrorType
	/* UNEXPECTED_ERROR - We couldn’t process this request. */
	UNEXPECTED_ERROR EdgeTraceObserverResponseErrorType
}{
	UNAUTHORIZED_USER: "UNAUTHORIZED_USER",
	UNEXPECTED_ERROR:  "UNEXPECTED_ERROR",
}
View Source
var EdgeTraceObserverStatusTypes = struct {
	/* CREATED - The trace observer has been created and is available for use. */
	CREATED EdgeTraceObserverStatus
	/* DELETED - The trace observer has been deleted and is no longer available for use. */
	DELETED EdgeTraceObserverStatus
}{
	CREATED: "CREATED",
	DELETED: "DELETED",
}

Functions

This section is empty.

Types

type Edge

type Edge struct {
	// contains filtered or unexported fields
}

Edge is used to communicate with the New Relic Edge product.

func New

func New(config config.Config) Edge

New returns a new client for interacting with New Relic Edge.

func (*Edge) CreateTraceObserver

func (e *Edge) CreateTraceObserver(accountID int, name string, providerRegion EdgeProviderRegion) (*EdgeTraceObserver, error)

CreateTraceObserver creates a trace observer for an account.

func (*Edge) DeleteTraceObserver

func (e *Edge) DeleteTraceObserver(accountID int, id int) (*EdgeTraceObserver, error)

DeleteTraceObserver deletes a trace observer for an account.

func (*Edge) ListTraceObservers

func (e *Edge) ListTraceObservers(accountID int) ([]EdgeTraceObserver, error)

ListTraceObservers lists the trace observers for an account.

type EdgeAccountStitchedFields

type EdgeAccountStitchedFields struct {
	/* Tracing - Provides access to Tracing data. */
	Tracing EdgeTracing `json:"tracing"`
}

EdgeAccountStitchedFields -

type EdgeAgentEndpointDetail

type EdgeAgentEndpointDetail struct {
	/* Host - Full host name that is used to connect to the endpoint. This is the part that will be placed into an agent config named `infinite_tracing.trace_observer.host`. */
	Host string `json:"host"`
	/* Port - Port that is used to connect to the endpoint. This is the part that will be placed into an agent config named `infinite_tracing.trace_observer.port`. */
	Port int `json:"port"`
}

EdgeAgentEndpointDetail - All the details necessary to configure an agent to connect to an endoint.

type EdgeCreateTraceObserverInput

type EdgeCreateTraceObserverInput struct {
	/* Name - Name of the trace observer. */
	Name string `json:"name"`
	/* ProviderRegion - Provider and region where the trace observer must run. Currently, only AWS regions are supported. */
	ProviderRegion EdgeProviderRegion `json:"providerRegion"`
}

EdgeCreateTraceObserverInput - Data required to create a trace observer.

type EdgeCreateTraceObserverResponse

type EdgeCreateTraceObserverResponse struct {
	/* Errors - Errors that may occur when creating a `TraceObserver`. Defaults to `null` in case of success. */
	Errors []EdgeCreateTraceObserverResponseError `json:"errors"`
	/* TraceObserver - The trace observer defined in `CreateTraceObserverInput`. Defaults to `null` in case of failure. */
	TraceObserver EdgeTraceObserver `json:"traceObserver"`
}

EdgeCreateTraceObserverResponse - Successfully created trace observers, or one or more error responses if there were issues.

type EdgeCreateTraceObserverResponseError

type EdgeCreateTraceObserverResponseError struct {
	/* Message - Error message, with further detail to help resolve the issue. */
	Message string `json:"message"`
	/* Type - Error that may occur while attempting to create a trace observer. */
	Type EdgeCreateTraceObserverResponseErrorType `json:"type"`
}

EdgeCreateTraceObserverResponseError - Description of errors that may occur while attempting to create a trace observer.

type EdgeCreateTraceObserverResponseErrorType

type EdgeCreateTraceObserverResponseErrorType string

EdgeCreateTraceObserverResponseErrorType - Known error codes and messages for `CreateTraceObserverResponseError`.

type EdgeCreateTraceObserverResponses

type EdgeCreateTraceObserverResponses struct {
	/* Responses - Array of trace observer creation responses, one for each `CreateTraceObserverInput`. */
	Responses []EdgeCreateTraceObserverResponse `json:"responses"`
}

EdgeCreateTraceObserverResponses - Array of responses, one for each trace observer creation request.

type EdgeDeleteTraceObserverInput

type EdgeDeleteTraceObserverInput struct {
	/* ID - Globally unique identifier of the trace observer being deleted. */
	ID int `json:"id"`
}

EdgeDeleteTraceObserverInput - Data required to delete a trace observer.

type EdgeDeleteTraceObserverResponse

type EdgeDeleteTraceObserverResponse struct {
	/* Errors - Errors that may occur when deleting a `TraceObserver`. Defaults to `null` in case of success. */
	Errors []EdgeDeleteTraceObserverResponseError `json:"errors"`
	/* TraceObserver - The trace observer that was deleted. Defaults to `null` in case of failure. */
	TraceObserver EdgeTraceObserver `json:"traceObserver"`
}

EdgeDeleteTraceObserverResponse - Successfully deleted trace observers, or one or more error responses if there were issues.

type EdgeDeleteTraceObserverResponseError

type EdgeDeleteTraceObserverResponseError struct {
	/* Message - Error message, with further detail to help resolve the issue. */
	Message string `json:"message"`
	/* Type - Error that may occur while attempting to delete a trace observer. */
	Type EdgeDeleteTraceObserverResponseErrorType `json:"type"`
}

EdgeDeleteTraceObserverResponseError - Description of errors that may occur while attempting to delete a trace observer.

type EdgeDeleteTraceObserverResponseErrorType

type EdgeDeleteTraceObserverResponseErrorType string

EdgeDeleteTraceObserverResponseErrorType - Known error codes and messages for `DeleteTraceObserverResponseError`.

type EdgeDeleteTraceObserverResponses

type EdgeDeleteTraceObserverResponses struct {
	/* Responses - Array of trace observer deletion responses, one for each `DeleteTraceObserverInput`. */
	Responses []EdgeDeleteTraceObserverResponse `json:"responses"`
}

EdgeDeleteTraceObserverResponses - Array of responses, one for each trace observer deletion request.

type EdgeEndpoint

type EdgeEndpoint struct {
	/* Agent - Connection information related to the agent configuration. */
	Agent EdgeAgentEndpointDetail `json:"agent"`
	/* EndpointType - Type of the endpoint. */
	EndpointType EdgeEndpointType `json:"endpointType"`
	/* Https - Connection information related to the Infinite Tracing Trace API (HTTP 1.1) configuration. */
	Https EdgeHttpsEndpointDetail `json:"https"`
	/* Status - Status of the endpoint. */
	Status EdgeEndpointStatus `json:"status"`
}

EdgeEndpoint - An `Endpoint` describes access to an endpoint pointing to a trace observer. Currently, only one endpoint per trace observer is supported.

type EdgeEndpointStatus

type EdgeEndpointStatus string

EdgeEndpointStatus - Status of the endpoint.

type EdgeEndpointType

type EdgeEndpointType string

EdgeEndpointType - Type of connection established with the trace observer. Currently, only `PUBLIC` is supported.

type EdgeHttpsEndpointDetail

type EdgeHttpsEndpointDetail struct {
	/* Host - Full host name that is used to connect to the endpoint. */
	Host string `json:"host"`
	/* Port - Port that is used to connect to the endpoint. */
	Port int `json:"port"`
	/* Url - Full URL used to send data to the endpoint. For instance, if you were using the
	[Java Telemetry SDK](https://docs.newrelic.com/docs/data-ingest-apis/get-data-new-relic/new-relic-sdks/telemetry-sdks-send-custom-telemetry-data-new-relic)
	this is the data you would use to create a `URI` to pass to the [`uriOverride`](https://github.com/newrelic/newrelic-telemetry-sdk-java/blob/85e526cf6fbba0640f20d2d7a3ab0dab89f958b3/telemetry_core/src/main/java/com/newrelic/telemetry/AbstractSenderBuilder.java#L37-L48)
	method. */
	Url string `json:"url"`
}

EdgeHttpsEndpointDetail - All the details necessary to configure an integration to connect to the Infinite Tracing Trace API (HTTP 1.1) endpoint.

type EdgeProviderRegion

type EdgeProviderRegion string

EdgeProviderRegion - Provider and region where the trace observer is located. Currently, only AWS regions are supported.

type EdgeTraceObserver

type EdgeTraceObserver struct {
	/* Endpoints - List of endpoints associated with this trace observer. Currently, only one endpoint per trace observer is supported. */
	Endpoints []EdgeEndpoint `json:"endpoints"`
	/* ID - Globally unique identifier of this trace observer. */
	ID int `json:"id"`
	/* Name - Human-readable name of this trace observer. */
	Name string `json:"name"`
	/* ProviderRegion - Provider-specific region of this endpoint (for example, `AWS_US_EAST_1`). Currently, only AWS regions are supported. */
	ProviderRegion EdgeProviderRegion `json:"providerRegion"`
	/* Status - Status of the trace observer. */
	Status EdgeTraceObserverStatus `json:"status"`
}

EdgeTraceObserver - `TraceObserver` handles a group of tracing services for an account family.

type EdgeTraceObserverResponse

type EdgeTraceObserverResponse struct {
	/* Errors - All trace observer's response errors, if any. */
	Errors []EdgeTraceObserverResponseError `json:"errors"`
	/* TraceObservers - All trace observers found, if any. */
	TraceObservers []EdgeTraceObserver `json:"traceObservers"`
}

EdgeTraceObserverResponse - Array of trace observers, or a list of errors for why they couldn't be retrieved.

type EdgeTraceObserverResponseError

type EdgeTraceObserverResponseError struct {
	/* Message - Error message, with further detail to help resolve the issue. */
	Message string `json:"message"`
	/* Type - Error that may occur while attempting to retrieve a trace observer. */
	Type EdgeTraceObserverResponseErrorType `json:"type"`
}

EdgeTraceObserverResponseError - Description of errors that may occur while attempting to retrieve a trace observer.

type EdgeTraceObserverResponseErrorType

type EdgeTraceObserverResponseErrorType string

EdgeTraceObserverResponseErrorType - Known error codes and messages for `TraceObserverResponseError`.

type EdgeTraceObserverStatus

type EdgeTraceObserverStatus string

EdgeTraceObserverStatus - Status of the trace observer.

type EdgeTracing

type EdgeTracing struct {
	/* TraceObservers - Lists the existing trace observers for this account family. */
	TraceObservers EdgeTraceObserverResponse `json:"traceObservers"`
}

EdgeTracing - This field provides access to Tracing data.

Jump to

Keyboard shortcuts

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