agent

package
v0.91.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package agent defines Agent object definitions.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	APIVersion manifest.Version `json:"apiVersion"`
	Kind       manifest.Kind    `json:"kind"`
	Metadata   Metadata         `json:"metadata"`
	Spec       Spec             `json:"spec"`
	Status     *Status          `json:"status,omitempty"`

	Organization   string `json:"organization,omitempty"`
	ManifestSource string `json:"manifestSrc,omitempty"`
	OktaClientID   string `json:"oktaClientID,omitempty"`
}

Agent struct which mapped one to one with kind: Agent yaml definition

Example
package main

import (
	"context"
	"log"

	"github.com/nobl9/nobl9-go/internal/examples"
	"github.com/nobl9/nobl9-go/manifest"
	"github.com/nobl9/nobl9-go/manifest/v1alpha/agent"
)

func main() {
	// Create the object:
	myAgent := agent.New(
		agent.Metadata{
			Name:        "my-agent",
			DisplayName: "My Agent",
			Project:     "default",
		},
		agent.Spec{
			Description: "Example Agent",
			Prometheus: &agent.PrometheusConfig{
				URL: "https://prometheus-service.monitoring:8080",
			},
		},
	)
	// Verify the object:
	if err := myAgent.Validate(); err != nil {
		log.Fatalf("agent validation failed, err: %v", err)
	}
	// Apply the object:
	client := examples.GetOfflineEchoClient()
	if err := client.Objects().V1().Apply(context.Background(), []manifest.Object{myAgent}); err != nil {
		log.Fatalf("failed to apply agent, err: %v", err)
	}
}
Output:

apiVersion: n9/v1alpha
kind: Agent
metadata:
  name: my-agent
  displayName: My Agent
  project: default
spec:
  description: Example Agent
  prometheus:
    url: https://prometheus-service.monitoring:8080

func New

func New(metadata Metadata, spec Spec) Agent

New creates new Agent instance.

func (Agent) GetKind

func (a Agent) GetKind() manifest.Kind

func (Agent) GetManifestSource

func (a Agent) GetManifestSource() string

func (Agent) GetName

func (a Agent) GetName() string

func (Agent) GetOrganization

func (a Agent) GetOrganization() string

func (Agent) GetProject

func (a Agent) GetProject() string

func (Agent) GetValidator added in v0.82.0

func (a Agent) GetValidator() govy.Validator[Agent]

func (Agent) GetVersion

func (a Agent) GetVersion() manifest.Version

func (Agent) SetManifestSource

func (a Agent) SetManifestSource(src string) manifest.Object

func (Agent) SetOrganization

func (a Agent) SetOrganization(org string) manifest.Object

func (Agent) SetProject

func (a Agent) SetProject(project string) manifest.Object

func (Agent) Validate

func (a Agent) Validate() error

type AmazonPrometheusConfig

type AmazonPrometheusConfig struct {
	URL    string `json:"url"`
	Region string `json:"region"`
}

AmazonPrometheusConfig represents content of Amazon Managed Service Configuration typical for Agent Object.

type AppDynamicsConfig

type AppDynamicsConfig struct {
	URL string `json:"url"`
}

AppDynamicsConfig represents content of AppDynamics Configuration typical for Agent Object.

type AzureMonitorConfig

type AzureMonitorConfig struct {
	TenantID string `json:"tenantId"`
}

AzureMonitorConfig represents content of AzureMonitor Configuration typical for Agent Object.

type AzurePrometheusConfig added in v0.83.0

type AzurePrometheusConfig struct {
	URL      string `json:"url"`
	TenantID string `json:"tenantId"`
}

AzurePrometheusConfig represents content of Azure Monitor managed service for Prometheus typical for Agent Object.

type BigQueryConfig

type BigQueryConfig struct{}

BigQueryConfig represents content of BigQuery configuration.

type CloudWatchConfig

type CloudWatchConfig struct{}

CloudWatchConfig represents content of CloudWatch Configuration typical for Agent Object.

type DatadogConfig

type DatadogConfig struct {
	Site string `json:"site"`
}

DatadogConfig represents content of Datadog Configuration typical for Agent Object.

type DynatraceConfig

type DynatraceConfig struct {
	URL string `json:"url"`
}

DynatraceConfig represents content of Dynatrace Configuration typical for Agent Object.

type ElasticsearchConfig

type ElasticsearchConfig struct {
	URL string `json:"url"`
}

ElasticsearchConfig represents content of Elasticsearch Configuration typical for Agent Object.

type GCMConfig

type GCMConfig struct{}

GCMConfig represents content of GCM configuration.

type GenericConfig

type GenericConfig struct{}

GenericConfig represents content of Generic Configuration typical for Agent Object.

type GrafanaLokiConfig

type GrafanaLokiConfig struct {
	URL string `json:"url"`
}

GrafanaLokiConfig represents content of GrafanaLoki Configuration typical for Agent Object.

type GraphiteConfig

type GraphiteConfig struct {
	URL string `json:"url"`
}

GraphiteConfig represents content of Graphite Configuration typical for Agent Object.

type HoneycombConfig

type HoneycombConfig struct{}

HoneycombConfig represents content of Honeycomb Configuration typical for Agent Object.

type InfluxDBConfig

type InfluxDBConfig struct {
	URL string `json:"url"`
}

InfluxDBConfig represents content of InfluxDB configuration typical fo Agent Object

type InstanaConfig

type InstanaConfig struct {
	URL string `json:"url"`
}

InstanaConfig represents content of Instana configuration typical for Agent Object

type LightstepConfig

type LightstepConfig struct {
	Organization string `json:"organization"`
	Project      string `json:"project"`
	URL          string `json:"url"`
}

LightstepConfig represents content of Lightstep Configuration typical for Agent Object.

type LogicMonitorConfig added in v0.82.0

type LogicMonitorConfig struct {
	Account string `json:"account"`
}

type Metadata

type Metadata struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName,omitempty"`
	Project     string `json:"project,omitempty"`
}

type NewRelicConfig

type NewRelicConfig struct {
	AccountID int `json:"accountId"`
}

NewRelicConfig represents content of NewRelic Configuration typical for Agent Object.

type OpenTSDBConfig

type OpenTSDBConfig struct {
	URL string `json:"url"`
}

OpenTSDBConfig represents content of OpenTSDBConfig Configuration typical for Agent Object.

type PingdomConfig

type PingdomConfig struct{}

PingdomConfig represents content of Pingdom Configuration typical for Agent Object.

type PrometheusConfig

type PrometheusConfig struct {
	URL string `json:"url"`
}

PrometheusConfig represents content of Prometheus Configuration typical for Agent Object.

type RedshiftConfig

type RedshiftConfig struct{}

RedshiftConfig represents content of Redshift configuration typical for Agent Object

type Spec

type Spec struct {
	Description             string                           `json:"description,omitempty"`
	ReleaseChannel          v1alpha.ReleaseChannel           `json:"releaseChannel,omitempty"`
	Prometheus              *PrometheusConfig                `json:"prometheus,omitempty"`
	Datadog                 *DatadogConfig                   `json:"datadog,omitempty"`
	NewRelic                *NewRelicConfig                  `json:"newRelic,omitempty"`
	AppDynamics             *AppDynamicsConfig               `json:"appDynamics,omitempty"`
	Splunk                  *SplunkConfig                    `json:"splunk,omitempty"`
	Lightstep               *LightstepConfig                 `json:"lightstep,omitempty"`
	SplunkObservability     *SplunkObservabilityConfig       `json:"splunkObservability,omitempty"`
	Dynatrace               *DynatraceConfig                 `json:"dynatrace,omitempty"`
	Elasticsearch           *ElasticsearchConfig             `json:"elasticsearch,omitempty"`
	ThousandEyes            *ThousandEyesConfig              `json:"thousandEyes,omitempty"`
	Graphite                *GraphiteConfig                  `json:"graphite,omitempty"`
	BigQuery                *BigQueryConfig                  `json:"bigQuery,omitempty"`
	OpenTSDB                *OpenTSDBConfig                  `json:"opentsdb,omitempty"`
	GrafanaLoki             *GrafanaLokiConfig               `json:"grafanaLoki,omitempty"`
	CloudWatch              *CloudWatchConfig                `json:"cloudWatch,omitempty"`
	Pingdom                 *PingdomConfig                   `json:"pingdom,omitempty"`
	AmazonPrometheus        *AmazonPrometheusConfig          `json:"amazonPrometheus,omitempty"`
	Redshift                *RedshiftConfig                  `json:"redshift,omitempty"`
	SumoLogic               *SumoLogicConfig                 `json:"sumoLogic,omitempty"`
	Instana                 *InstanaConfig                   `json:"instana,omitempty"`
	InfluxDB                *InfluxDBConfig                  `json:"influxdb,omitempty"`
	AzureMonitor            *AzureMonitorConfig              `json:"azureMonitor,omitempty"`
	GCM                     *GCMConfig                       `json:"gcm,omitempty"`
	Generic                 *GenericConfig                   `json:"generic,omitempty"`
	Honeycomb               *HoneycombConfig                 `json:"honeycomb,omitempty"`
	LogicMonitor            *LogicMonitorConfig              `json:"logicMonitor,omitempty"`
	AzurePrometheus         *AzurePrometheusConfig           `json:"azurePrometheus,omitempty"`
	HistoricalDataRetrieval *v1alpha.HistoricalDataRetrieval `json:"historicalDataRetrieval,omitempty"`
	QueryDelay              *v1alpha.QueryDelay              `json:"queryDelay,omitempty"`
	// Interval, Timeout and Jitter are readonly and cannot be set via API
	Interval *v1alpha.Interval `json:"interval,omitempty"`
	Timeout  *v1alpha.Timeout  `json:"timeout,omitempty"`
	Jitter   *v1alpha.Jitter   `json:"jitter,omitempty"`
}

Spec represents content of Spec typical for Agent Object

func (Spec) GetType

func (s Spec) GetType() (v1alpha.DataSourceType, error)

type SplunkConfig

type SplunkConfig struct {
	URL string `json:"url"`
}

SplunkConfig represents content of Splunk Configuration typical for Agent Object.

type SplunkObservabilityConfig

type SplunkObservabilityConfig struct {
	Realm string `json:"realm"`
}

SplunkObservabilityConfig represents content of SplunkObservability Configuration typical for Agent Object.

type Status

type Status struct {
	AgentType                string `json:"agentType"`
	AgentVersion             string `json:"agentVersion,omitempty"`
	LastConnection           string `json:"lastConnection,omitempty"`
	NewestStableAgentVersion string `json:"newestStableAgentVersion,omitempty"`
	NewestBetaAgentVersion   string `json:"newestBetaAgentVersion,omitempty"`
}

Status holds dynamic content which is not part of the static Agent definition.

type SumoLogicConfig

type SumoLogicConfig struct {
	URL string `json:"url"`
}

SumoLogicConfig represents content of Sumo Logic configuration typical for Agent Object.

type ThousandEyesConfig

type ThousandEyesConfig struct{}

ThousandEyesConfig represents content of ThousandEyes Configuration typical for Agent Object.

Jump to

Keyboard shortcuts

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