Documentation
¶
Index ¶
- Variables
- func ClientCLI(ctx context.Context, parse ClientCLIParseFunc) (int, error)
- func Coalasce[T any](v ...*T) *T
- func MakeVM(ctx context.Context) (*jsonnet.VM, error)
- func Pointer[T any](v T) *T
- func RandomString(n int) string
- func ServerCLI(ctx context.Context, parse ServerCLIParseFunc) (int, error)
- type APIConfig
- type APIGRPCConfig
- type APIHTTPConfig
- type AccessKeyConfig
- type ClientApp
- type ClientCLIOptions
- type ClientCLIParseFunc
- type ClientLogsCommandOptions
- type ClientMetricsCommandOptions
- type ClientSignalOutputOptions
- type ClientTimeRangeOptions
- type ClientTracesCommandOptions
- type LoadOptions
- type OTLPConfig
- type OTLPGRPCConfig
- type OTLPHTTPConfig
- type Profile
- type S3SignalRepository
- func (r *S3SignalRepository) FetchLogsData(ctx context.Context, input *oteleportpb.FetchLogsDataRequest) (*oteleportpb.FetchLogsDataResponse, error)
- func (r *S3SignalRepository) FetchMetricsData(ctx context.Context, input *oteleportpb.FetchMetricsDataRequest) (*oteleportpb.FetchMetricsDataResponse, error)
- func (r *S3SignalRepository) FetchTracesData(ctx context.Context, input *oteleportpb.FetchTracesDataRequest) (*oteleportpb.FetchTracesDataResponse, error)
- func (r *S3SignalRepository) PushLogsData(ctx context.Context, data *logspb.LogsData) error
- func (r *S3SignalRepository) PushMetricsData(ctx context.Context, data *metricspb.MetricsData) error
- func (r *S3SignalRepository) PushTracesData(ctx context.Context, data *tracepb.TracesData) error
- type Server
- type ServerCLIOptions
- type ServerCLIParseFunc
- type ServerConfig
- type SignalRepository
- type StorageAWSConfig
- type StorageAWSCredentialsConfig
- type StorageConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var EnvNativeFunction = &jsonnet.NativeFunction{ Name: "env", Params: []ast.Identifier{"name", "default"}, Func: func(args []interface{}) (interface{}, error) { if len(args) != 2 { return nil, oops.Errorf("env: invalid arguments length expected 2 got %d", len(args)) } key, ok := args[0].(string) if !ok { return nil, oops.Errorf("env: invalid 1st arguments, expected string got %T", args[0]) } val := os.Getenv(key) if val == "" { return args[1], nil } return val, nil }, }
View Source
var JsonescapeNativeFunction = &jsonnet.NativeFunction{ Name: "json_escape", Params: []ast.Identifier{"str"}, Func: func(args []interface{}) (interface{}, error) { if len(args) != 1 { return nil, oops.Errorf("jsonescape: invalid arguments length expected 1 got %d", len(args)) } str, ok := args[0].(string) if !ok { return nil, oops.Errorf("jsonescape: invalid arguments, expected string got %T", args[0]) } bs, err := json.Marshal(str) if err != nil { return nil, oops.Wrapf(err, "jsonescape") } return string(bs), nil }, }
View Source
var MastEnvNativeFunction = &jsonnet.NativeFunction{ Name: "must_env", Params: []ast.Identifier{"name"}, Func: func(args []interface{}) (interface{}, error) { if len(args) != 1 { return nil, oops.Errorf("must_env: invalid arguments length expected 1 got %d", len(args)) } key, ok := args[0].(string) if !ok { return nil, oops.Errorf("must_env: invalid arguments, expected string got %T", args[0]) } val, ok := os.LookupEnv(key) if !ok { return nil, oops.Errorf("must_env: %s not set", key) } return val, nil }, }
View Source
var NativeFunctions = []*jsonnet.NativeFunction{ MastEnvNativeFunction, EnvNativeFunction, JsonescapeNativeFunction, }
View Source
var Version = "v0.2.3"
Functions ¶
func ClientCLI ¶ added in v0.2.0
func ClientCLI(ctx context.Context, parse ClientCLIParseFunc) (int, error)
func RandomString ¶
Types ¶
type APIConfig ¶
type APIConfig struct { Enable *bool `json:"enable,omitempty"` HTTP APIHTTPConfig `json:"http"` GRPC APIGRPCConfig `json:"grpc"` }
API configuration
type APIGRPCConfig ¶
type APIHTTPConfig ¶
type APIHTTPConfig struct { Enable *bool `json:"enable,omitempty"` Prefix string `json:"prefix"` Address string `json:"address"` Listener net.Listener `json:"-"` }
API HTTP configuration
func (*APIHTTPConfig) Validate ¶
func (c *APIHTTPConfig) Validate(parent *APIConfig) error
type AccessKeyConfig ¶
func (*AccessKeyConfig) UnmarshalJSON ¶
func (c *AccessKeyConfig) UnmarshalJSON(data []byte) error
type ClientApp ¶ added in v0.2.0
type ClientApp struct {
// contains filtered or unexported fields
}
func NewClientApp ¶ added in v0.2.0
func (*ClientApp) FetchLogsData ¶ added in v0.2.0
func (a *ClientApp) FetchLogsData(ctx context.Context, opts *ClientLogsCommandOptions) error
func (*ClientApp) FetchMetricsData ¶ added in v0.2.0
func (a *ClientApp) FetchMetricsData(ctx context.Context, opts *ClientMetricsCommandOptions) error
func (*ClientApp) FetchTracesData ¶ added in v0.2.0
func (a *ClientApp) FetchTracesData(ctx context.Context, opts *ClientTracesCommandOptions) error
type ClientCLIOptions ¶ added in v0.2.0
type ClientCLIOptions struct { LogLevel string `help:"log level (debug, info, warn, error)" default:"info" enum:"debug,info,warn,error" env:"OTELPORT_LOG_LEVEL"` Color *bool `help:"enable colored output" env:"OTELPORT_COLOR"` ProfilePath string `help:"oteleport client profile" default:"" env:"OTELPORT_PROFILE"` ExtStr map[string]string `help:"external string values for Jsonnet" env:"OTELEPORT_EXTSTR"` ExtCode map[string]string `help:"external code values for Jsonnet" env:"OTELEPORT_EXTCODE"` Endpoint string `help:"oteleport server endpoint" default:"http://localhost:8080" env:"OTELPORT_ENDPOINT"` AccessKey string `help:"oteleport server access key" env:"OTELPORT_ACCESS_KEY"` AccessKeyHeader string `help:"oteleport server access key header" default:"Oteleport-Access-Key" env:"OTELEPORT_ACCESS_KEY_HEADER"` ClientSignalOutputOptions Version struct{} `cmd:"version" help:"show version"` Traces ClientTracesCommandOptions `cmd:"traces" help:"traces subcommand"` Metrics ClientMetricsCommandOptions `cmd:"metrics" help:"metrics subcommand"` Logs ClientLogsCommandOptions `cmd:"logs" help:"logs subcommand"` }
func ParseClientCLI ¶ added in v0.2.0
func ParseClientCLI(args []string) (string, *ClientCLIOptions, func(), error)
type ClientCLIParseFunc ¶ added in v0.2.0
type ClientCLIParseFunc func([]string) (string, *ClientCLIOptions, func(), error)
type ClientLogsCommandOptions ¶ added in v0.2.0
type ClientLogsCommandOptions struct {
ClientTimeRangeOptions
}
type ClientMetricsCommandOptions ¶ added in v0.2.0
type ClientMetricsCommandOptions struct {
ClientTimeRangeOptions
}
type ClientSignalOutputOptions ¶ added in v0.2.0
type ClientSignalOutputOptions struct { OtelExporterOTLPEndpoint string `` /* 168-byte string literal not displayed */ OtelExporterOTLPTracesEndpoint string `` /* 153-byte string literal not displayed */ OtelExporterOTLPMetricsEndpoint string `` /* 156-byte string literal not displayed */ OtelExporterOTLPLogsEndpoint string `` /* 147-byte string literal not displayed */ OtelExporterOTLPProtocol string `` /* 153-byte string literal not displayed */ OtelExporterOTLPTracesProtocol string `` /* 174-byte string literal not displayed */ OtelExporterOTLPMetricsProtocol string `` /* 177-byte string literal not displayed */ OtelExporterOTLPLogsProtocol string `` /* 168-byte string literal not displayed */ OtelExporterOTLPHeaders map[string]string `help:"exporter headers" env:"OTEL_EXPORTER_OTLP_HEADERS" group:"OpenTelemetry Exporter Parameters" json:"otlp_headers"` OtelExporterOTLPTracesHeaders map[string]string `` /* 139-byte string literal not displayed */ OtelExporterOTLPMetricsHeaders map[string]string `` /* 142-byte string literal not displayed */ OtelExporterOTLPLogsHeaders map[string]string `` /* 133-byte string literal not displayed */ OtelExporterOTLPCompression string `` /* 162-byte string literal not displayed */ OtelExporterOTLPTracesCompression string `` /* 183-byte string literal not displayed */ OtelExporterOTLPMetricsCompression string `` /* 186-byte string literal not displayed */ OtelExporterOTLPLogsCompression string `` /* 177-byte string literal not displayed */ OtelExporterOTLPTimeout time.Duration `` /* 132-byte string literal not displayed */ OtelExporterOTLPTracesTimeout time.Duration `` /* 150-byte string literal not displayed */ OtelExporterOTLPMetricsTimeout time.Duration `` /* 153-byte string literal not displayed */ OtelExporterOTLPLogsTimeout time.Duration `` /* 144-byte string literal not displayed */ }
func (ClientSignalOutputOptions) OTLPClientOptions ¶ added in v0.2.0
func (o ClientSignalOutputOptions) OTLPClientOptions() []otlp.ClientOption
type ClientTimeRangeOptions ¶ added in v0.2.0
type ClientTimeRangeOptions struct { StartTime *time.Time `help:"return Otel Signals newer than this time. RFC3339 format" env:"OTELPORT_START_TIME" format:"2006-01-02T15:04:05Z"` EndTime *time.Time `help:"return Otel Signals older than this time. RFC3339 format" env:"OTELPORT_END_TIME" format:"2006-01-02T15:04:05Z"` Since string `help:"return Otel Signals newer than a relative duration. like 52, 2m, or 3h (default: 5m)" env:"OTELPORT_SINCE" default:"5m"` Until string `help:"return Otel Signals older than a relative duration. like 52, 2m, or 3h" env:"OTELPORT_UNTIL"` }
func (*ClientTimeRangeOptions) TimeRangeUnixNano ¶ added in v0.2.0
func (o *ClientTimeRangeOptions) TimeRangeUnixNano() (int64, int64)
type ClientTracesCommandOptions ¶ added in v0.2.0
type ClientTracesCommandOptions struct {
ClientTimeRangeOptions
}
type OTLPConfig ¶
type OTLPConfig struct { Enable *bool `json:"enable,omitempty"` GRPC OTLPGRPCConfig `json:"grpc"` HTTP OTLPHTTPConfig `json:"http"` }
OTLP gRPC and HTTP configuration
func (*OTLPConfig) Validate ¶
func (c *OTLPConfig) Validate() error
type OTLPGRPCConfig ¶
type OTLPGRPCConfig struct { Enable *bool `json:"enable,omitempty"` Address string `json:"address"` Listener net.Listener `json:"-"` }
gRPC configuration
func (*OTLPGRPCConfig) Validate ¶
func (c *OTLPGRPCConfig) Validate(parent *OTLPConfig) error
type OTLPHTTPConfig ¶
type OTLPHTTPConfig struct { Enable *bool `json:"enable,omitempty"` Prefix string `json:"prefix"` Address string `json:"address"` Listener net.Listener `json:"-"` }
HTTP configuration
func (*OTLPHTTPConfig) Validate ¶
func (c *OTLPHTTPConfig) Validate(parent *OTLPConfig) error
type Profile ¶ added in v0.2.0
type Profile struct { *client.Profile Output ClientSignalOutputOptions `json:"output"` }
type S3SignalRepository ¶
type S3SignalRepository struct {
// contains filtered or unexported fields
}
func (*S3SignalRepository) FetchLogsData ¶
func (r *S3SignalRepository) FetchLogsData(ctx context.Context, input *oteleportpb.FetchLogsDataRequest) (*oteleportpb.FetchLogsDataResponse, error)
func (*S3SignalRepository) FetchMetricsData ¶
func (r *S3SignalRepository) FetchMetricsData(ctx context.Context, input *oteleportpb.FetchMetricsDataRequest) (*oteleportpb.FetchMetricsDataResponse, error)
func (*S3SignalRepository) FetchTracesData ¶
func (r *S3SignalRepository) FetchTracesData(ctx context.Context, input *oteleportpb.FetchTracesDataRequest) (*oteleportpb.FetchTracesDataResponse, error)
func (*S3SignalRepository) PushLogsData ¶
func (*S3SignalRepository) PushMetricsData ¶
func (r *S3SignalRepository) PushMetricsData(ctx context.Context, data *metricspb.MetricsData) error
func (*S3SignalRepository) PushTracesData ¶
func (r *S3SignalRepository) PushTracesData(ctx context.Context, data *tracepb.TracesData) error
type Server ¶
type Server struct { TermHandler func() // contains filtered or unexported fields }
func NewServer ¶
func NewServer(cfg *ServerConfig) (*Server, error)
type ServerCLIOptions ¶
type ServerCLIOptions struct { ConfigPath string `name:"config" help:"config file path" default:"oteleport.jsonnet" env:"OTELPORT_CONFIG"` ExtStr map[string]string `help:"external string values for Jsonnet" env:"OTELEPORT_EXTSTR"` ExtCode map[string]string `help:"external code values for Jsonnet" env:"OTELEPORT_EXTCODE"` LogLevel string `help:"log level (debug, info, warn, error)" default:"info" enum:"debug,info,warn,error" env:"OTELPORT_LOG_LEVEL"` Color *bool `help:"enable colored output" env:"OTELPORT_COLOR" negatable:""` Serve struct{} `cmd:"" help:"start oteleport server" default:"1"` Version struct{} `cmd:"version" help:"show version"` }
func ParseServerCLI ¶
func ParseServerCLI(args []string) (string, *ServerCLIOptions, func(), error)
type ServerCLIParseFunc ¶
type ServerCLIParseFunc func([]string) (string, *ServerCLIOptions, func(), error)
type ServerConfig ¶
type ServerConfig struct { AccessKeyHeader string `json:"access_key_header"` AccessKeys []*AccessKeyConfig `json:"access_keys"` Storage StorageConfig `json:"storage"` OTLP OTLPConfig `json:"otlp"` API APIConfig `json:"api"` }
Overall Configuration structure
func DefaultServerConfig ¶
func DefaultServerConfig() *ServerConfig
func (*ServerConfig) EnableAuth ¶
func (c *ServerConfig) EnableAuth() bool
func (*ServerConfig) Load ¶
func (c *ServerConfig) Load(path string, opts *LoadOptions) error
func (*ServerConfig) Validate ¶
func (c *ServerConfig) Validate() error
Validate function to check the configuration for validity
type SignalRepository ¶
type SignalRepository interface { PushTracesData(ctx context.Context, data *tracepb.TracesData) error PushMetricsData(ctx context.Context, data *metricspb.MetricsData) error PushLogsData(ctx context.Context, data *logspb.LogsData) error FetchTracesData(ctx context.Context, input *oteleportpb.FetchTracesDataRequest) (*oteleportpb.FetchTracesDataResponse, error) FetchMetricsData(ctx context.Context, input *oteleportpb.FetchMetricsDataRequest) (*oteleportpb.FetchMetricsDataResponse, error) FetchLogsData(ctx context.Context, input *oteleportpb.FetchLogsDataRequest) (*oteleportpb.FetchLogsDataResponse, error) }
func NewSignalRepository ¶
func NewSignalRepository(cfg *StorageConfig) (SignalRepository, error)
type StorageAWSConfig ¶
type StorageAWSConfig struct { Region string `json:"region"` Endpoint string `json:"endpoint"` UseS3PathStyle bool `json:"use_s3_path_style"` Credentials *StorageAWSCredentialsConfig `json:"credentials"` // contains filtered or unexported fields }
func (*StorageAWSConfig) Validate ¶
func (c *StorageAWSConfig) Validate() error
type StorageConfig ¶
type StorageConfig struct { CursorEncryptionKey []byte `json:"cursor_encryption_key"` GZip *bool `json:"gzip,omitempty"` Flatten *bool `json:"flatten,omitempty"` Location string `json:"location"` AWS StorageAWSConfig `json:"aws,omitempty"` // contains filtered or unexported fields }
func (*StorageConfig) Validate ¶
func (c *StorageConfig) Validate(parent *ServerConfig) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.