Documentation ¶
Index ¶
- Constants
- Variables
- func BackendFactory(bf proxy.BackendFactory) proxy.BackendFactory
- func GetAggregatedPathForBackendMetrics(cfg *config.Backend) func(r *http.Request) string
- func GetAggregatedPathForMetrics(cfg *config.EndpointConfig) func(r *http.Request) string
- func HTTPRequestExecutor(clientFactory transport.HTTPClientFactory) transport.HTTPRequestExecutor
- func HTTPRequestExecutorFromConfig(clientFactory transport.HTTPClientFactory, cfg *config.Backend) transport.HTTPRequestExecutor
- func IsBackendEnabled() bool
- func IsPipeEnabled() bool
- func IsRouterEnabled() bool
- func Middleware(name string) proxy.Middleware
- func NewHTTPClient(ctx context.Context) *http.Client
- func ProxyFactory(pf proxy.Factory) proxy.FactoryFunc
- func Register(ctx context.Context, srvCfg config.ServiceConfig, vs ...*view.View) error
- func RegisterExporterFactories(ef ExporterFactory)
- func RequestAttrs(r *http.Request) []trace.Attribute
- func ResponseAttrs(resp *http.Response) []trace.Attribute
- func SpanNameFromURL(req *http.Request) string
- func TraceStatus(httpStatusCode int, statusLine string) trace.Status
- type Config
- type DataDogConfig
- type EnabledLayers
- type EndpointExtraConfig
- type ExporterFactory
- type Exporters
- type InfluxDBConfig
- type JaegerConfig
- type OcagentConfig
- type PrometheusConfig
- type StackdriverConfig
- type Transport
- type XrayConfig
- type ZipkinConfig
Constants ¶
View Source
const ( ContextKey = "opencensus-request-span" Namespace = "github.com/starvn/sonic/telemetry/opencensus" )
Variables ¶
View Source
var ( DefaultViews = []*view.View{ ochttp.ClientSentBytesDistribution, ochttp.ClientReceivedBytesDistribution, ochttp.ClientRoundtripLatencyDistribution, ochttp.ClientCompletedCount, ochttp.ServerRequestCountView, ochttp.ServerRequestBytesView, ochttp.ServerResponseBytesView, ochttp.ServerLatencyView, ochttp.ServerRequestCountByMethod, ochttp.ServerResponseCountByStatusCode, } ErrNoConfig = errors.New("no extra config defined for the opencensus package") )
Functions ¶
func BackendFactory ¶
func BackendFactory(bf proxy.BackendFactory) proxy.BackendFactory
func GetAggregatedPathForMetrics ¶
func GetAggregatedPathForMetrics(cfg *config.EndpointConfig) func(r *http.Request) string
func HTTPRequestExecutor ¶
func HTTPRequestExecutor(clientFactory transport.HTTPClientFactory) transport.HTTPRequestExecutor
func HTTPRequestExecutorFromConfig ¶
func HTTPRequestExecutorFromConfig(clientFactory transport.HTTPClientFactory, cfg *config.Backend) transport.HTTPRequestExecutor
func IsBackendEnabled ¶
func IsBackendEnabled() bool
func IsPipeEnabled ¶
func IsPipeEnabled() bool
func IsRouterEnabled ¶
func IsRouterEnabled() bool
func Middleware ¶
func Middleware(name string) proxy.Middleware
func ProxyFactory ¶
func ProxyFactory(pf proxy.Factory) proxy.FactoryFunc
func RegisterExporterFactories ¶
func RegisterExporterFactories(ef ExporterFactory)
func SpanNameFromURL ¶
Types ¶
type Config ¶
type Config struct { SampleRate int `json:"sample_rate"` ReportingPeriod int `json:"reporting_period"` EnabledLayers *EnabledLayers `json:"enabled_layers"` Exporters Exporters `json:"exporters"` }
type DataDogConfig ¶
type DataDogConfig struct { Namespace string `json:"namespace"` Service string `json:"service"` TraceAddr string `json:"trace_address"` StatsAddr string `json:"stats_address"` Tags []string `json:"tags"` GlobalTags map[string]interface{} `json:"global_tags"` DisableCountPerBuckets bool `json:"disable_count_per_buckets"` }
type EnabledLayers ¶
type EndpointExtraConfig ¶
type EndpointExtraConfig struct {
PathAggregation string `json:"path_aggregation"`
}
type Exporters ¶
type Exporters struct { InfluxDB *InfluxDBConfig `json:"influxdb"` Zipkin *ZipkinConfig `json:"zipkin"` Jaeger *JaegerConfig `json:"jaeger"` Prometheus *PrometheusConfig `json:"prometheus"` Logger *struct{} `json:"logger"` Xray *XrayConfig `json:"xray"` Stackdriver *StackdriverConfig `json:"stackdriver"` Ocagent *OcagentConfig `json:"ocagent"` DataDog *DataDogConfig `json:"datadog"` ExtraConfig config.ExtraConfig `json:"extra_config"` }
type InfluxDBConfig ¶
type JaegerConfig ¶
type OcagentConfig ¶
type PrometheusConfig ¶
type StackdriverConfig ¶
type Transport ¶
type Transport struct { Base http.RoundTripper Propagation propagation.HTTPFormat StartOptions trace.StartOptions GetStartOptions func(*http.Request) trace.StartOptions FormatSpanName func(*http.Request) string NewClientTrace func(*http.Request, *trace.Span) *httptrace.ClientTrace // contains filtered or unexported fields }
func (*Transport) CancelRequest ¶
type XrayConfig ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.