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.
Code generated by tutone: DO NOT EDIT
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 ¶
- Variables
- type Edge
- func (e *Edge) CreateTraceObserver(accountID int, name string, providerRegion EdgeProviderRegion) (*EdgeTraceObserver, error)
- func (e *Edge) CreateTraceObserverWithContext(ctx context.Context, accountID int, name string, ...) (*EdgeTraceObserver, error)
- func (e *Edge) DeleteTraceObserver(accountID int, id int) (*EdgeTraceObserver, error)
- func (e *Edge) DeleteTraceObserverWithContext(ctx context.Context, accountID int, id int) (*EdgeTraceObserver, error)
- func (e *Edge) ListTraceObservers(accountID int) ([]EdgeTraceObserver, error)
- func (e *Edge) ListTraceObserversWithContext(ctx context.Context, accountID int) ([]EdgeTraceObserver, error)
- type EdgeAccountStitchedFields
- type EdgeAgentEndpointDetail
- type EdgeCreateTraceObserverInput
- type EdgeCreateTraceObserverResponse
- type EdgeCreateTraceObserverResponseError
- type EdgeCreateTraceObserverResponseErrorType
- type EdgeCreateTraceObserverResponses
- type EdgeDeleteTraceObserverInput
- type EdgeDeleteTraceObserverResponse
- type EdgeDeleteTraceObserverResponseError
- type EdgeDeleteTraceObserverResponseErrorType
- type EdgeDeleteTraceObserverResponses
- type EdgeEndpoint
- type EdgeEndpointDetail
- type EdgeEndpointDetailInterface
- type EdgeEndpointStatus
- type EdgeEndpointType
- type EdgeHttpsEndpointDetail
- type EdgeProviderRegion
- type EdgeRandomTraceFilter
- type EdgeSpanAttributeKeyOperator
- type EdgeSpanAttributeRule
- type EdgeSpanAttributeValueOperator
- type EdgeSpanAttributesTraceFilter
- type EdgeTraceFilterAction
- type EdgeTraceFilters
- type EdgeTraceObserver
- type EdgeTraceObserverStatus
- type EdgeTracing
- type Float
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var EdgeCreateTraceObserverResponseErrorTypeTypes = struct { // A trace observer already exists for this account family and provider region. ALREADY_EXISTS EdgeCreateTraceObserverResponseErrorType // Trace observers aren’t available in provider region. NO_AVAILABILITY_IN_REGION EdgeCreateTraceObserverResponseErrorType }{ ALREADY_EXISTS: "ALREADY_EXISTS", NO_AVAILABILITY_IN_REGION: "NO_AVAILABILITY_IN_REGION", }
var EdgeDeleteTraceObserverResponseErrorTypeTypes = struct { // The trace observer has already been deleted. ALREADY_DELETED EdgeDeleteTraceObserverResponseErrorType // No trace observer was found with the id given. NOT_FOUND EdgeDeleteTraceObserverResponseErrorType }{ ALREADY_DELETED: "ALREADY_DELETED", NOT_FOUND: "NOT_FOUND", }
var EdgeEndpointStatusTypes = struct { // The endpoint has been created and is available for use. CREATED EdgeEndpointStatus // The endpoint has been deleted and is no longer available for use. DELETED EdgeEndpointStatus }{ CREATED: "CREATED", DELETED: "DELETED", }
var EdgeEndpointTypeTypes = struct { // PUBLIC: the endpoint is reachable on the internet. PUBLIC EdgeEndpointType }{ PUBLIC: "PUBLIC", }
var EdgeProviderRegionTypes = struct { // Provider: `AWS`, Region: `eu-west-1` AWS_EU_WEST_1 EdgeProviderRegion // Provider: `AWS`, Region: `us-east-1` AWS_US_EAST_1 EdgeProviderRegion // Provider: `AWS`, Region: `us-east-2` AWS_US_EAST_2 EdgeProviderRegion // Provider: `AWS`, Region: `us-west-2` AWS_US_WEST_2 EdgeProviderRegion }{ AWS_EU_WEST_1: "AWS_EU_WEST_1", AWS_US_EAST_1: "AWS_US_EAST_1", AWS_US_EAST_2: "AWS_US_EAST_2", AWS_US_WEST_2: "AWS_US_WEST_2", }
var EdgeSpanAttributeKeyOperatorTypes = struct { // Matches on an exact value EQUALS EdgeSpanAttributeKeyOperator // Matches on a value that starts-with and/or ends-with the provided value LIKE EdgeSpanAttributeKeyOperator }{ EQUALS: "EQUALS", LIKE: "LIKE", }
var EdgeSpanAttributeValueOperatorTypes = struct { // Matches on an exact value EQUALS EdgeSpanAttributeValueOperator // Matches on any value IS_NOT_NULL EdgeSpanAttributeValueOperator // Matches on a value that starts-with and/or ends-with the provided value LIKE EdgeSpanAttributeValueOperator }{ EQUALS: "EQUALS", IS_NOT_NULL: "IS_NOT_NULL", LIKE: "LIKE", }
var EdgeTraceFilterActionTypes = struct { // Discards traces that match the filter DISCARD EdgeTraceFilterAction // Keeps traces that match the filter KEEP EdgeTraceFilterAction }{ DISCARD: "DISCARD", KEEP: "KEEP", }
var EdgeTraceObserverStatusTypes = struct { // The trace observer has been created and is available for use. CREATED EdgeTraceObserverStatus // 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 (*Edge) CreateTraceObserver ¶
func (e *Edge) CreateTraceObserver(accountID int, name string, providerRegion EdgeProviderRegion) (*EdgeTraceObserver, error)
CreateTraceObserver creates a trace observer for an account.
func (*Edge) CreateTraceObserverWithContext ¶
func (e *Edge) CreateTraceObserverWithContext(ctx context.Context, accountID int, name string, providerRegion EdgeProviderRegion) (*EdgeTraceObserver, error)
CreateTraceObserverWithContext 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) DeleteTraceObserverWithContext ¶
func (e *Edge) DeleteTraceObserverWithContext(ctx context.Context, accountID int, id int) (*EdgeTraceObserver, error)
DeleteTraceObserverWithContext 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.
func (*Edge) ListTraceObserversWithContext ¶
func (e *Edge) ListTraceObserversWithContext(ctx context.Context, accountID int) ([]EdgeTraceObserver, error)
ListTraceObserversWithContext lists the trace observers for an account.
type EdgeAccountStitchedFields ¶
type EdgeAccountStitchedFields struct { // Provides access to Tracing data. Tracing EdgeTracing `json:"tracing,omitempty"` }
EdgeAccountStitchedFields -
type EdgeAgentEndpointDetail ¶
type EdgeAgentEndpointDetail struct { // 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 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.
func (*EdgeAgentEndpointDetail) ImplementsEdgeEndpointDetail ¶
func (x *EdgeAgentEndpointDetail) ImplementsEdgeEndpointDetail()
type EdgeCreateTraceObserverInput ¶
type EdgeCreateTraceObserverInput struct { // When set to `true` a trace observer will write trace metrics to the current account. Monitoring bool `json:"monitoring,omitempty"` // Name of the trace observer. Name string `json:"name"` // 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 that may occur when creating a `TraceObserver`. Defaults to `null` in case of success. Errors []EdgeCreateTraceObserverResponseError `json:"errors,omitempty"` // The trace observer defined in `CreateTraceObserverInput`. Defaults to `null` in case of failure. TraceObserver EdgeTraceObserver `json:"traceObserver,omitempty"` }
EdgeCreateTraceObserverResponse - Successfully created trace observers, or one or more error responses if there were issues.
type EdgeCreateTraceObserverResponseError ¶
type EdgeCreateTraceObserverResponseError struct { // Error message, with further detail to help resolve the issue. Message string `json:"message"` // 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 { // 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 { // 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 that may occur when deleting a `TraceObserver`. Defaults to `null` in case of success. Errors []EdgeDeleteTraceObserverResponseError `json:"errors,omitempty"` // The trace observer that was deleted. Defaults to `null` in case of failure. TraceObserver EdgeTraceObserver `json:"traceObserver,omitempty"` }
EdgeDeleteTraceObserverResponse - Successfully deleted trace observers, or one or more error responses if there were issues.
type EdgeDeleteTraceObserverResponseError ¶
type EdgeDeleteTraceObserverResponseError struct { // Error message, with further detail to help resolve the issue. Message string `json:"message"` // 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 { // 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 { // Connection information related to the agent configuration. Agent EdgeAgentEndpointDetail `json:"agent"` // Type of the endpoint. EndpointType EdgeEndpointType `json:"endpointType"` // Connection information related to the Infinite Tracing Trace API (HTTP 1.1) configuration. Https EdgeHttpsEndpointDetail `json:"https"` // 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 EdgeEndpointDetail ¶
type EdgeEndpointDetail struct { // Full host name that is used to connect to the endpoint. Host string `json:"host"` // Port that is used to connect to the endpoint. Port int `json:"port"` }
EdgeEndpointDetail - The information common to all endpoints.
func (*EdgeEndpointDetail) ImplementsEdgeEndpointDetail ¶
func (x *EdgeEndpointDetail) ImplementsEdgeEndpointDetail()
type EdgeEndpointDetailInterface ¶
type EdgeEndpointDetailInterface interface {
ImplementsEdgeEndpointDetail()
}
EdgeEndpointDetail - The information common to all endpoints.
func UnmarshalEdgeEndpointDetailInterface ¶
func UnmarshalEdgeEndpointDetailInterface(b []byte) (*EdgeEndpointDetailInterface, error)
UnmarshalEdgeEndpointDetailInterface unmarshals the interface into the correct type based on __typename provided by GraphQL
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 { // Full host name that is used to connect to the endpoint. Host string `json:"host"` // Port that is used to connect to the endpoint. Port int `json:"port"` // 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.
func (*EdgeHttpsEndpointDetail) ImplementsEdgeEndpointDetail ¶
func (x *EdgeHttpsEndpointDetail) ImplementsEdgeEndpointDetail()
type EdgeProviderRegion ¶
type EdgeProviderRegion string
EdgeProviderRegion - Provider and region where the trace observer is located. Currently, only AWS regions are supported.
type EdgeRandomTraceFilter ¶
type EdgeRandomTraceFilter struct { // The percent of traces to keep when selected at random. PercentKept float64 `json:"percentKept"` }
EdgeRandomTraceFilter - Contains all of the data that is used to sample traces based on random selection.
type EdgeSpanAttributeKeyOperator ¶
type EdgeSpanAttributeKeyOperator string
EdgeSpanAttributeKeyOperator - Span attribute key operator types
type EdgeSpanAttributeRule ¶
type EdgeSpanAttributeRule struct { // The action that this filter takes if it matches the provided attribute name and value Action EdgeTraceFilterAction `json:"action"` // Globally unique identifier of this trace filter. ID int `json:"id"` // Name of the attribute that this filter matches on Key string `json:"key"` // Type of match to apply to the attribute name (EQUALS, LIKE). KeyOperator EdgeSpanAttributeKeyOperator `json:"keyOperator"` // Value of the attribute that this filter matches on. Value string `json:"value,omitempty"` // Type of match to apply to the attribute value (EQUALS, LIKE, IS_NOT_NULL). ValueOperator EdgeSpanAttributeValueOperator `json:"valueOperator"` }
EdgeSpanAttributeRule - A `SpanAttributeRule` applies a filtering rule (keep or discard) to traces within a particular `TraceObserver`
type EdgeSpanAttributeValueOperator ¶
type EdgeSpanAttributeValueOperator string
EdgeSpanAttributeValueOperator - Span attribute value operator types
type EdgeSpanAttributesTraceFilter ¶
type EdgeSpanAttributesTraceFilter struct { // The list of rules that determine whether to keep or drop a trace based on a span attribute. SpanAttributeRules []EdgeSpanAttributeRule `json:"spanAttributeRules"` }
EdgeSpanAttributesTraceFilter - Contains all of the data that is used to sample traces based on their attributes.
type EdgeTraceFilterAction ¶
type EdgeTraceFilterAction string
EdgeTraceFilterAction - Type of action to perform when a `TraceFilter` match occurs
type EdgeTraceFilters ¶
type EdgeTraceFilters struct { // Random trace filter configuration applied to the trace observer. RandomTraceFilter EdgeRandomTraceFilter `json:"randomTraceFilter"` // Span attribute trace filter configuration applied to the trace observer. SpanAttributesTraceFilter EdgeSpanAttributesTraceFilter `json:"spanAttributesTraceFilter"` }
EdgeTraceFilters - A container for all trace filter rule types
type EdgeTraceObserver ¶
type EdgeTraceObserver struct { // List of endpoints associated with this trace observer. Currently, only one endpoint per trace observer is supported. Endpoints []EdgeEndpoint `json:"endpoints"` // Globally unique identifier of this trace observer. ID int `json:"id"` // Which account monitoring metrics are being written to for this trace observer (if specified) MonitoringAccountId int `json:"monitoringAccountId,omitempty"` // Human-readable name of this trace observer. Name string `json:"name"` // Provider-specific region of this endpoint (for example, `AWS_US_EAST_1`). Currently, only AWS regions are supported. ProviderRegion EdgeProviderRegion `json:"providerRegion"` // Status of the trace observer. Status EdgeTraceObserverStatus `json:"status"` // Trace filters applied to the trace observer. TraceFilters EdgeTraceFilters `json:"traceFilters"` }
EdgeTraceObserver - `TraceObserver` handles a group of tracing services for an account family.
type EdgeTraceObserverStatus ¶
type EdgeTraceObserverStatus string
EdgeTraceObserverStatus - Status of the trace observer.
type EdgeTracing ¶
type EdgeTracing struct { // Lists the existing trace observers for this account family. TraceObservers []EdgeTraceObserver `json:"traceObservers"` }
EdgeTracing - This field provides access to Tracing data.
type Float ¶
type Float string
Float - The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).