smartagentreceiver

package
v0.61.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: Apache-2.0 Imports: 40 Imported by: 0

README

SignalFx Smart Agent Receiver

Note: The SignalFx Smart Agent receiver is only supported on x86_64/amd64 platforms.

The Smart Agent Receiver allows you to utilize existing SignalFx Smart Agent monitors as OpenTelemetry Collector metric receivers. It assumes that you have a properly configured environment with a functional Smart Agent release bundle on your system, which is already provided for x86_64/amd64 Splunk Distribution of OpenTelemetry Collector installation paths.

Beta: All Smart Agent monitors are supported at this time. Configuration and behavior may change without notice.

Configuration

Each smartagent receiver configuration acts as a drop-in replacement for each supported Smart Agent Monitor configuration with some exceptions:

  1. Any Agent global or collectd desired configuration should be performed via the Smart Agent Extension.
  2. In lieu of discoveryRule support, the Collector's receivercreator and associated Observer extensions should be used.
  3. The signalfx-forwarder monitor should be made part of both metrics and traces pipelines utilizing the signalfx and sapm exporters, respectively.
  4. All metric content replacement and transformation rules should utilize existing Collector processors.
  5. Monitors with dimension property and tag update functionality allow an associated dimensionClients field that references the name of the SignalFx exporter you are using in your pipeline. These monitors include ecs-metadata, heroku-metadata, kubernetes-cluster, openshift-cluster, postgresql, and sql. If you do not specify any exporters via this field, the receiver will attempt to use the associated pipeline. If the next element of the pipeline isn't compatible with the dimension update behavior, and if you configured a single SignalFx exporter for your deployment, the exporter will be selected. If no dimension update behavior is desired, you can specify the empty array [] to disable.
  6. Monitors with event-sending functionality should also be made members of a logs pipeline that utilizes a SignalFx exporter that will make the event submission requests. It's recommended, and in the case of the Processlist monitor required, to use a Resource Detection processor to ensure that host identity and other useful information is made available as event dimensions. Receiver entries that should be added to logs pipelines include kubernetes-events, nagios, processlist, and potentially any telegraf/* monitors like telegraf/exec. The signalfx exporter is required for sending events to SignalFx, the splunk_hec exporter does not support sending events. An example of this is provided below.

Example:

receivers:
  smartagent/signalfx-forwarder:
    type: signalfx-forwarder
  smartagent/postgresql:
    type: postgresql
    host: mypostgresinstance
    port: 5432
    dimensionClients:
      - signalfx  # references the SignalFx Exporter configured below
  smartagent/processlist:
    type: processlist
  smartagent/kafka:
    type: collectd/kafka
    host: mykafkabroker
    port: 7099
    clusterName: mykafkacluster
    intervalSeconds: 5

processors:
  resourcedetection:
    detectors:
      - system

exporters:
  signalfx:
    access_token: "${SIGNALFX_ACCESS_TOKEN}"
    realm: us1
  sapm:
    access_token: "${SIGNALFX_ACCESS_TOKEN}"
    endpoint: https://ingest.us1.signalfx.com/v2/trace

service:
  pipelines:
    metrics:
      receivers:
        - smartagent/postgresql
        - smartagent/kafka
        - smartagent/signalfx-forwarder
      processors:
        - resourcedetection
      exporters:
        - signalfx
    logs:
      receivers:
        - smartagent/processlist
      processors:
        - resourcedetection
      exporters:
        - signalfx
    traces:
      receivers:
        - smartagent/signalfx-forwarder
      processors:
        - resourcedetection
      exporters:
        - sapm

For a more detailed description of migrating your Smart Agent monitor usage to the Splunk Distribution of OpenTelemetry Collector please see the migration guide.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultConfig

func CreateDefaultConfig() config.Receiver

func GetSettableStructFieldValue added in v0.20.0

func GetSettableStructFieldValue(strukt any, fieldName string, fieldType reflect.Type) (*reflect.Value, error)

GetSettableStructFieldValue finds the first occurrence of a valid, settable field value from a potentially embedded struct with a fieldName of desired type. Based on https://github.com/signalfx/signalfx-agent/blob/731c2a0b5ff5ac324130453b02dd9cb7c912c0d5/pkg/utils/reflection.go#L36

func NewFactory

func NewFactory() component.ReceiverFactory

func SetStructFieldIfZeroValue added in v0.20.0

func SetStructFieldIfZeroValue(strukt any, fieldName string, value any) (bool, error)

SetStructFieldIfZeroValue same as SetStructField() but only if first occurrence of the field is of zero value.

func SetStructFieldWithExplicitType added in v0.20.0

func SetStructFieldWithExplicitType(strukt any, fieldName string, value any, fieldTypes ...reflect.Type) (bool, error)

SetStructFieldWithExplicitType sets the first occurrence of a (potentially embedded) struct field w/ name fieldName and first occurring fieldType to desired value, if available. Returns true if successfully set, false otherwise. Error contains if field undetected or if issues occur with reflect usage.

Types

type Config

type Config struct {
	config.ReceiverSettings `mapstructure:",squash"`
	// Generally an observer/receivercreator-set value via Endpoint.Target.
	// Will expand to MonitorCustomConfig Host and Port values if unset.
	Endpoint         string   `mapstructure:"endpoint"`
	DimensionClients []string `mapstructure:"dimensionClients"`
	// contains filtered or unexported fields
}

func (*Config) Unmarshal added in v0.24.3

func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error

Unmarshal dynamically creates the desired Smart Agent monitor config from the provided receiver config content.

type Output

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

Output is an implementation of a Smart Agent FilteringOutput that receives datapoints, events, and dimension updates from a configured monitor. It will forward all datapoints to the nextMetricsConsumer, all dimension updates to the nextDimensionClients as determined by the associated items in Config.MetadataClients, and all events to the nextLogsConsumer.

func NewOutput

func NewOutput(
	config Config, filtering *monitorFiltering, nextMetricsConsumer consumer.Metrics,
	nextLogsConsumer consumer.Logs, nextTracesConsumer consumer.Traces, host component.Host,
	params component.ReceiverCreateSettings,
) *Output

func (*Output) AddDatapointExclusionFilter

func (output *Output) AddDatapointExclusionFilter(filter dpfilters.DatapointFilter)

func (*Output) AddDefaultSpanTag

func (output *Output) AddDefaultSpanTag(key, value string)

func (*Output) AddExtraDimension

func (output *Output) AddExtraDimension(key, value string)

func (*Output) AddExtraSpanTag

func (output *Output) AddExtraSpanTag(key, value string)

func (*Output) Copy

func (output *Output) Copy() types.Output

Copy clones the Output to provide to child monitors with their own extraDimensions.

func (*Output) EnabledMetrics

func (output *Output) EnabledMetrics() []string

func (*Output) HasAnyExtraMetrics

func (output *Output) HasAnyExtraMetrics() bool

func (*Output) HasEnabledMetricInGroup

func (output *Output) HasEnabledMetricInGroup(group string) bool

func (*Output) RemoveDefaultSpanTag

func (output *Output) RemoveDefaultSpanTag(key string)

func (*Output) RemoveExtraDimension

func (output *Output) RemoveExtraDimension(key string)

func (*Output) RemoveExtraSpanTag

func (output *Output) RemoveExtraSpanTag(key string)

func (*Output) SendDatapoints

func (output *Output) SendDatapoints(datapoints ...*datapoint.Datapoint)

func (*Output) SendDimensionUpdate

func (output *Output) SendDimensionUpdate(dimension *types.Dimension)

func (*Output) SendEvent

func (output *Output) SendEvent(event *event.Event)

func (*Output) SendSpans

func (output *Output) SendSpans(spans ...*trace.Span)

type Receiver

type Receiver struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewReceiver

func NewReceiver(params component.ReceiverCreateSettings, config Config) *Receiver

func (*Receiver) Shutdown

func (r *Receiver) Shutdown(context.Context) error

func (*Receiver) Start

func (r *Receiver) Start(_ context.Context, host component.Host) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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