jaegerreceiver

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 39 Imported by: 0

README

Jaeger Receiver

This receiver supports Jaeger formatted traces.

It supports the Jaeger Collector and Agent protocols:

  • gRPC
  • Thrift HTTP
  • Thrift TChannel
  • Thrift Compact
  • Thrift Binary

By default, the Jaeger receiver will not serve any protocol. A protocol must be named for the jaeger receiver to start. The following demonstrates how to start the Jaeger receiver with only gRPC enabled on the default port.

receivers:
  jaeger:
    protocols:
      grpc:

It is possible to configure the protocols on different ports, refer to config.yaml for detailed config examples. The full list of settings exposed for this receiver are documented here.

Communicating over TLS

The Jaeger receiver supports communication using Transport Layer Security (TLS), but only using the gRPC protocol. It can be configured by specifying a tls_credentials object in the gRPC receiver configuration.

receivers:
  jaeger:
    protocols:
      grpc:
        tls_credentials:
          key_file: /key.pem # path to private key
          cert_file: /cert.pem # path to certificate
        endpoint: "0.0.0.0:9876"

Remote Sampling

The Jaeger receiver also supports fetching sampling configuration from a remote collector. It works by proxying client requests for remote sampling configuration to the configured collector.

    +------------+                   +-----------+              +---------------+
    |            |       get         |           |    proxy     |               |
    |   client   +---  sampling ---->+   agent   +------------->+   collector   |
    |            |     strategy      |           |              |               |
    +------------+                   +-----------+              +---------------+

Remote sample proxying can be enabled by specifying the following lines in the jaeger receiver config:

receivers:
  jaeger:
    protocols:
      grpc:
    remote_sampling:
      fetch_endpoint: "jaeger-collector:1234"

Remote sampling can also be directly served by the collector by providing a sampling json file:

receivers:
  jaeger:
    protocols:
      grpc:
    remote_sampling:
      strategy_file: "/etc/strategy.json"

Note: gRPC must be enabled for this to work as Jaeger serves its remote sampling strategies over gRPC.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	instanceName string,
	config *Configuration,
	nextConsumer consumer.TraceConsumer,
	params component.ReceiverCreateParams,
) (component.TraceReceiver, error)

New creates a TraceReceiver that receives traffic as a Jaeger collector, and also as a Jaeger agent.

Types

type Config

type Config struct {
	TypeVal        configmodels.Type         `mapstructure:"-"`
	NameVal        string                    `mapstructure:"-"`
	Protocols      map[string]*SecureSetting `mapstructure:"protocols"`
	RemoteSampling *RemoteSamplingConfig     `mapstructure:"remote_sampling"`
}

Config defines configuration for Jaeger receiver.

func (*Config) Name

func (rs *Config) Name() string

Name gets the receiver name.

func (*Config) SetName

func (rs *Config) SetName(name string)

SetName sets the receiver name.

func (*Config) SetType

func (rs *Config) SetType(typeStr configmodels.Type)

SetType sets the receiver type.

func (*Config) Type

func (rs *Config) Type() configmodels.Type

Type sets the receiver type.

type Configuration

type Configuration struct {
	CollectorThriftPort  int
	CollectorHTTPPort    int
	CollectorGRPCPort    int
	CollectorGRPCOptions []grpc.ServerOption

	AgentCompactThriftPort       int
	AgentBinaryThriftPort        int
	AgentHTTPPort                int
	RemoteSamplingClientSettings configgrpc.GRPCClientSettings
	RemoteSamplingStrategyFile   string
}

Configuration defines the behavior and the ports that the Jaeger receiver will use.

type Factory

type Factory struct {
}

Factory is the factory for Jaeger receiver.

func (*Factory) CreateDefaultConfig

func (f *Factory) CreateDefaultConfig() configmodels.Receiver

CreateDefaultConfig creates the default configuration for Jaeger receiver.

func (*Factory) CreateMetricsReceiver

CreateMetricsReceiver creates a metrics receiver based on provided config.

func (*Factory) CreateTraceReceiver

func (f *Factory) CreateTraceReceiver(
	ctx context.Context,
	params component.ReceiverCreateParams,
	cfg configmodels.Receiver,
	nextConsumer consumer.TraceConsumer,
) (component.TraceReceiver, error)

CreateTraceReceiver creates a trace receiver based on provided config.

func (*Factory) CustomUnmarshaler

func (f *Factory) CustomUnmarshaler() component.CustomUnmarshaler

CustomUnmarshaler is used to add defaults for named but empty protocols

func (*Factory) Type

func (f *Factory) Type() configmodels.Type

Type gets the type of the Receiver config created by this factory.

type RemoteSamplingConfig

type RemoteSamplingConfig struct {
	HostEndpoint                  string `mapstructure:"host_endpoint"`
	StrategyFile                  string `mapstructure:"strategy_file"`
	configgrpc.GRPCClientSettings `mapstructure:",squash"`
}

RemoteSamplingConfig defines config key for remote sampling fetch endpoint

type SecureSetting

type SecureSetting struct {
	configmodels.ReceiverSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct
	// Configures the receiver to use TLS.
	// The default value is nil, which will cause the receiver to not use TLS.
	TLSCredentials *configtls.TLSSetting `mapstructure:"tls_credentials, omitempty"`
}

Jump to

Keyboard shortcuts

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