Documentation ¶
Index ¶
- func BuildSpanProcessor(ctx context.Context, cfg Config) (trace.SpanProcessor, error)
- type Config
- type MetricsRecorder
- func (r MetricsRecorder) HTTPAttributes(svcName, url, method, code string) []attribute.KeyValue
- func (r MetricsRecorder) HTTPRequestDuration(ctx context.Context, duration time.Duration, attrs []attribute.KeyValue)
- func (r MetricsRecorder) HTTPResponseSize(ctx context.Context, sizeBytes int64, attrs []attribute.KeyValue)
- func (r MetricsRecorder) Impressions(ctx context.Context, key, variant string)
- func (r MetricsRecorder) InFlightRequestEnd(ctx context.Context, attrs []attribute.KeyValue)
- func (r MetricsRecorder) InFlightRequestStart(ctx context.Context, attrs []attribute.KeyValue)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSpanProcessor ¶
BuildSpanProcessor builds a span processor based on provided configurations todo - consider fallback mechanism(ex:- to console) if collector is unset
Types ¶
type MetricsRecorder ¶
type MetricsRecorder struct {
// contains filtered or unexported fields
}
func BuildMetricsRecorder ¶
func BuildMetricsRecorder(svcName string, config Config) (*MetricsRecorder, error)
BuildMetricsRecorder is a helper to build telemetry.MetricsRecorder based on configurations
func NewOTelRecorder ¶
func NewOTelRecorder(exporter metric.Reader, resource *resource.Resource, serviceName string) *MetricsRecorder
NewOTelRecorder creates a MetricsRecorder based on the provided metric.Reader. Note that, metric.NewMeterProvider is created here but not registered globally as this is the only place we derive a metric.Meter. Consider global provider registration if we need more meters
func (MetricsRecorder) HTTPAttributes ¶
func (r MetricsRecorder) HTTPAttributes(svcName, url, method, code string) []attribute.KeyValue
func (MetricsRecorder) HTTPRequestDuration ¶
func (MetricsRecorder) HTTPResponseSize ¶
func (MetricsRecorder) Impressions ¶
func (r MetricsRecorder) Impressions(ctx context.Context, key, variant string)
func (MetricsRecorder) InFlightRequestEnd ¶
func (r MetricsRecorder) InFlightRequestEnd(ctx context.Context, attrs []attribute.KeyValue)
func (MetricsRecorder) InFlightRequestStart ¶
func (r MetricsRecorder) InFlightRequestStart(ctx context.Context, attrs []attribute.KeyValue)
Click to show internal directories.
Click to hide internal directories.