Documentation ¶
Index ¶
- Constants
- type Client
- type CollectRule
- type CollectRulesSummary
- type CollectRulesSummaryWrap
- type CollectRulesWrap
- type CollectorInput
- type CommonInstanceConfig
- type ConfigFormat
- type Duration
- type HealthStatus
- type Initializer
- type LogCollectFormat
- type LogPayload
- type Logger
- type LogsPayload
- type PluginDescriber
- type PortCollectFormat
- type ProcCollectFormat
- type QueryInput
- type ScriptCollectFormat
- type SettingInput
- type StatsdCaptureTriggerInput
- type StatsdReplayInput
Constants ¶
const ( // log RoutePathLogs = "/api/v1/logs/input" // collect rule RoutePathGetCollectRules = "/v1/n9e/collect-rules-belong-to-ident" RoutePathGetCollectRulesSummary = "/v1/n9e/collect-rules-summary" N9eV1SeriesEndpoint = "/v1/n9e/series" // "series_v1" N9eSeriesEndpoint = "/v1/n9e/series" // "series_v2" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { ApiCall(method, uri string, param, body, output interface{}, opts ...cmdcli.RequestOption) error GetClient(name string) *rest.RESTClient }
type CollectRule ¶
type CollectRule struct { ID int64 `json:"id"` // option rule.ID Name string `json:"name"` // option Config.instances[$] ruleID Type string `json:"type"` // required Config.Name checkName Data string `json:"data"` // required Config.Instances[$] Interval int `json:"-"` // -> Config.Instances[$].MinCollectionInterval Tags string `json:"-"` // -> Config.Instances[$].Tags a:b,b:c CreatedAt int64 `json:"-"` // deprecated UpdatedAt int64 `json:"-"` // deprecated Creator string `json:"-"` // deprecated Updater string `json:"-"` // deprecated }
type CollectRulesSummary ¶
type CollectRulesSummaryWrap ¶
type CollectRulesSummaryWrap struct { Data CollectRulesSummary `json:"dat"` Err string `json:"err"` }
type CollectRulesWrap ¶
type CollectRulesWrap struct { Data []CollectRule `json:"dat"` Err string `json:"err"` }
type CollectorInput ¶
type CollectorInput struct { // HostHeader contains the hostname of the payload HostHeader string `param:"header" name:"X-Dd-Hostname"` // ContainerCountHeader contains the container count in the payload ContainerCountHeader int `param:"header" name:"X-Dd-ContainerCount"` // ProcessVersionHeader holds the process agent version sending the payload ProcessVersionHeader string `param:"header" name:"X-Dd-Processagentversion"` // ClusterIDHeader contains the orchestrator cluster ID of this agent ClusterIDHeader string `param:"header" name:"X-Dd-Orchestrator-ClusterID"` // TimestampHeader contains the timestamp that the check data was created TimestampHeader int64 `param:"header" name:"X-DD-Agent-Timestamp"` }
type CommonInstanceConfig ¶
type CommonInstanceConfig struct { MinCollectionInterval int `json:"min_collection_interval"` // This changes the collection interval of the check - default: 15 EmptyDefaultHostname bool `json:"empty_default_hostname"` // This forces the check to send metrics with no hostname. This is useful for cluster-level checks. Tags []string `json:"tags"` // A list of tags to attach to every metric and service check emitted by this instance, <key_1>:<value_1> Service string `json:"service"` // Attach the tag `service:<SERVICE>` to every metric, event, and service check emitted by this integration. Name string `json:"name"` // Namespace string `json:"namespace"` // }
CommonInstanceConfig holds the reserved fields for the yaml instance data
type ConfigFormat ¶
type ConfigFormat struct { ADIdentifiers []string `json:"ad_identifiers"` ClusterCheck bool `json:"cluster_check"` InitConfig interface{} `json:"init_config"` MetricConfig interface{} `json:"jmx_metrics"` LogsConfig interface{} `json:"logs"` Instances []interface{} `json:"instances"` IgnoreAutodiscoveryTags bool `json:"ignore_autodiscovery_tags"` // Use to ignore tags coming from autodiscovery }
from pkg/autodiscovery/providers/file.go: configFormat format of collectRule.Data
func ParseConfigFormatJson ¶
func ParseConfigFormatJson(data []byte) (*ConfigFormat, error)
func ParseConfigFormatYaml ¶
func ParseConfigFormatYaml(data []byte) (*ConfigFormat, error)
Converts YAML to JSON then uses JSON to unmarshal into ConfigFormat
type Duration ¶
type Duration struct {
time.Duration `protobuf:"varint,1,opt,name=duration,casttype=time.Duration"`
}
Duration is a wrapper around time.Duration which supports correct marshaling to YAML and JSON. In particular, it marshals into strings, which can be used as map keys in json.
func (Duration) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface.
type HealthStatus ¶
Status represents the current status of registered components it is built and returned by GetStatus()
type Initializer ¶
type Initializer interface { // Init performs one time setup of the plugin and returns an error if the // configuration is invalid. Init() error }
Initializer is an interface that all plugin types: Inputs, Outputs, Processors, and Aggregators can optionally implement to initialize the plugin.
type LogCollectFormat ¶
type LogCollectFormat struct { Instances []struct { CommonInstanceConfig MetricName string `json:"metric_name"` // FilePath string `json:"file_path"` // Pattern string `json:"pattern"` // TagsPattern map[string]string `json:"tags_pattern"` // Func string `json:"func"` // count(c), histogram(h) } `json:"instances"` }
type LogPayload ¶
type LogPayload struct { Message string `json:"message"` Status string `json:"status"` Timestamp int64 `json:"timestamp"` Hostname string `json:"hostname"` Service string `json:"service"` Source string `json:"source"` Tags string `json:"tags"` Ident string `json:"ident"` Alias string `json:"alias"` }
datadog-agent/pkg/logs/processor/json.go
type Logger ¶
type Logger interface { // Errorf logs an error message, patterned after log.Printf. Errorf(format string, args ...interface{}) // Error logs an error message, patterned after log.Print. Error(args ...interface{}) // Debugf logs a debug message, patterned after log.Printf. Debugf(format string, args ...interface{}) // Debug logs a debug message, patterned after log.Print. Debug(args ...interface{}) // Warnf logs a warning message, patterned after log.Printf. Warnf(format string, args ...interface{}) // Warn logs a warning message, patterned after log.Print. Warn(args ...interface{}) // Infof logs an information message, patterned after log.Printf. Infof(format string, args ...interface{}) // Info logs an information message, patterned after log.Print. Info(args ...interface{}) }
Logger defines an plugin-related interface for logging.
type LogsPayload ¶
type LogsPayload []LogPayload
type PluginDescriber ¶
type PluginDescriber interface { // Description returns a one-sentence description on the Processor Description() string }
PluginDescriber contains the functions all plugins must implement to describe themselves to Telegraf. Note that all plugins may define a logger that is not part of the interface, but will receive an injected logger if it's set. eg: Log telegraf.Logger `toml:"-"`
type PortCollectFormat ¶
type PortCollectFormat struct { InitConfig struct { Timeout int `json:"timeout"` } `json:"init_config"` Instances []struct { CommonInstanceConfig Protocol string `json:"protocol" description:"udp or tcp"` Port int `json:"port"` } `json:"instances"` }
type ProcCollectFormat ¶
type ProcCollectFormat struct { Instances []struct { CommonInstanceConfig Target string `json:"target"` CollectMethod string `json:"collect_method" description:"name or cmdline"` Name string `json:"name"` // no used Comment string `json:"comment"` // no used } `json:"instances"` }
type QueryInput ¶
type QueryInput struct {
Query string `param:"query"`
}
type ScriptCollectFormat ¶
type ScriptCollectFormat struct { InitConfig struct { Root string `json:"root"` Env string `json:"env"` Timeout int `json:"timeout"` } `json:"init_config"` Instances []struct { CommonInstanceConfig FilePath string `json:"file_path"` Root string `json:"root"` Params string `json:"params"` Env string `json:"env"` Stdin string `json:"stdin"` Timeout int `json:"timeout"` } `json:"instances"` }
type SettingInput ¶
type StatsdCaptureTriggerInput ¶
type StatsdCaptureTriggerInput struct { Duration int `json:"duration" flag:"duration,d" default:"60" description:"capture duration (second)"` Compressed bool `json:"compressed" flag:"compressed,z" default:"true" description:"Should capture be zstd compressed."` }
func (*StatsdCaptureTriggerInput) Validate ¶
func (p *StatsdCaptureTriggerInput) Validate() error