validation

package
v0.84.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigurationsDirname = "/etc/newrelic-infra/integrations.d/"
View Source
const IntegrationsDirname = "/var/db/newrelic-infra/newrelic-integrations/bin/"

Variables

This section is empty.

Functions

func ValidateIntegration added in v0.73.0

func ValidateIntegration(integrationName string) (string, error)

Validate an integration using its <integrationName>-config.yml by iterating over the defined integrations and running the integration command with its defined environment variables. <integrationName>-config.yml is determined to be valid if every defined integration exits without error (exits with exit code 0). The <integrationName>-config.yml is located in the default configuration directory, which may vary by GOOS.

Types

type AgentSuccessResponse added in v0.32.0

type AgentSuccessResponse struct {
	GUID string `json:"guid"`
}

AgentSuccessResponse represents the response object returned from infra agent `/v1/status/entity` endpoint.

Docs: https://github.com/newrelic/infrastructure-agent/blob/master/docs/status_api.md#report-entity

type AgentValidator added in v0.32.0

type AgentValidator struct {
	MaxAttempts          int
	IntervalMilliSeconds int
	Count                int
	// contains filtered or unexported fields
}

AgentValidator attempts to validate that the infra agent was successfully installed and is sending data to New Relic.

func NewAgentValidator added in v0.32.0

func NewAgentValidator() *AgentValidator

NewAgentValidator returns a new instance of AgentValidator.

func (*AgentValidator) Validate added in v0.32.0

func (v *AgentValidator) Validate(ctx context.Context, url string) (string, error)

Validate attempts to validate if the infra agent installation is successful. If it is successful, Validate returns the installed entity's GUID.

type MockAgentValidator added in v0.43.0

type MockAgentValidator struct {
	Error error
}

func (*MockAgentValidator) Validate added in v0.43.0

func (m *MockAgentValidator) Validate(ctx context.Context, url string) (string, error)

type MockNRDBClient

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

func NewMockNRDBClient

func NewMockNRDBClient() *MockNRDBClient

func (*MockNRDBClient) Attempts

func (c *MockNRDBClient) Attempts() int

func (*MockNRDBClient) QueryWithContext

func (c *MockNRDBClient) QueryWithContext(ctx context.Context, accountID int, nrql nrdb.NRQL) (*nrdb.NRDBResultContainer, error)

func (*MockNRDBClient) ReturnResultsAfterNAttempts

func (c *MockNRDBClient) ReturnResultsAfterNAttempts(before []nrdb.NRDBResult, after []nrdb.NRDBResult, attempts int)

func (*MockNRDBClient) ThrowError

func (c *MockNRDBClient) ThrowError(message string)

type MockRecipeValidator

type MockRecipeValidator struct {
	Error error
}

func NewMockRecipeValidator

func NewMockRecipeValidator() *MockRecipeValidator

func (*MockRecipeValidator) ValidateRecipe added in v0.26.0

type PollingRecipeValidator

type PollingRecipeValidator struct {
	utilsValidation.PollingNRQLValidator
}

PollingRecipeValidator is an implementation of the RecipeValidator interface that polls NRDB to assert data is being reported for the given recipe.

func NewPollingRecipeValidator

func NewPollingRecipeValidator(c utils.NRDBClient) *PollingRecipeValidator

NewPollingRecipeValidator returns a new instance of PollingRecipeValidator.

func (*PollingRecipeValidator) ValidateRecipe added in v0.26.0

ValidateRecipe polls NRDB to assert data is being reported for the given recipe.

Jump to

Keyboard shortcuts

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