Documentation ¶
Index ¶
- Constants
- func BuildConnectOptions(cfg Config) ([]connect.HandlerOption, error)
- func BuildTraceProvider(ctx context.Context, logger *logger.Logger, svc string, svcVersion string, ...) error
- func ExceptionType(val string) attribute.KeyValue
- func FeatureFlagReason(val string) attribute.KeyValue
- func RegisterErrorHandling(log *logger.Logger)
- func SemConvFeatureFlagAttributes(ffKey string, ffVariant string) []attribute.KeyValue
- type Config
- type IMetricsRecorder
- 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, reason, variant, key string)
- func (r MetricsRecorder) InFlightRequestEnd(ctx context.Context, attrs []attribute.KeyValue)
- func (r MetricsRecorder) InFlightRequestStart(ctx context.Context, attrs []attribute.KeyValue)
- func (r MetricsRecorder) Reasons(ctx context.Context, key string, reason string, err error)
- func (r MetricsRecorder) RecordEvaluation(ctx context.Context, err error, reason, variant, key string)
- type NoopMetricsRecorder
- func (NoopMetricsRecorder) HTTPAttributes(_, _, _, _ string) []attribute.KeyValue
- func (NoopMetricsRecorder) HTTPRequestDuration(_ context.Context, _ time.Duration, _ []attribute.KeyValue)
- func (NoopMetricsRecorder) HTTPResponseSize(_ context.Context, _ int64, _ []attribute.KeyValue)
- func (NoopMetricsRecorder) Impressions(_ context.Context, _, _, _ string)
- func (NoopMetricsRecorder) InFlightRequestEnd(_ context.Context, _ []attribute.KeyValue)
- func (NoopMetricsRecorder) InFlightRequestStart(_ context.Context, _ []attribute.KeyValue)
- func (NoopMetricsRecorder) RecordEvaluation(_ context.Context, _ error, _, _, _ string)
Constants ¶
const ( ProviderName = "flagd" FeatureFlagReasonKey = attribute.Key("feature_flag.reason") ExceptionTypeKey = attribute.Key("ExceptionTypeKeyName") )
Variables ¶
This section is empty.
Functions ¶
func BuildConnectOptions ¶ added in v0.5.3
func BuildConnectOptions(cfg Config) ([]connect.HandlerOption, error)
BuildConnectOptions is a helper to build connect options based on telemetry configurations
func BuildTraceProvider ¶ added in v0.5.2
func BuildTraceProvider(ctx context.Context, logger *logger.Logger, svc string, svcVersion string, cfg Config) error
BuildTraceProvider build and register the trace provider and propagator for the caller runtime. This method attempt to register a global TracerProvider backed by batch SpanProcessor.Config. CollectorTarget can be used to provide the grpc collector target. Providing empty target results in skipping provider & propagator registration. This results in tracers having NoopTracerProvider and propagator having No-Op TextMapPropagator performing no action
func ExceptionType ¶ added in v0.5.2
func FeatureFlagReason ¶ added in v0.5.2
func RegisterErrorHandling ¶ added in v0.6.1
func SemConvFeatureFlagAttributes ¶ added in v0.5.2
SemConvFeatureFlagAttributes is helper to derive semantic convention adhering feature flag attributes refer - https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/feature-flags/
Types ¶
type Config ¶
Config of the telemetry runtime. These are expected to be mapped to start-up arguments
type IMetricsRecorder ¶ added in v0.9.3
type IMetricsRecorder interface { HTTPAttributes(svcName, url, method, code string) []attribute.KeyValue HTTPRequestDuration(ctx context.Context, duration time.Duration, attrs []attribute.KeyValue) HTTPResponseSize(ctx context.Context, sizeBytes int64, attrs []attribute.KeyValue) InFlightRequestStart(ctx context.Context, attrs []attribute.KeyValue) InFlightRequestEnd(ctx context.Context, attrs []attribute.KeyValue) RecordEvaluation(ctx context.Context, err error, reason, variant, key string) Impressions(ctx context.Context, reason, variant, key string) }
func BuildMetricsRecorder ¶
func BuildMetricsRecorder( ctx context.Context, svcName string, svcVersion string, config Config, ) (IMetricsRecorder, error)
BuildMetricsRecorder is a helper to build telemetry.MetricsRecorder based on configurations
type MetricsRecorder ¶
type MetricsRecorder struct {
// contains filtered or unexported fields
}
func NewOTelRecorder ¶
func NewOTelRecorder(exporter msdk.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, reason, variant, key 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)
func (MetricsRecorder) RecordEvaluation ¶ added in v0.5.2
func (r MetricsRecorder) RecordEvaluation(ctx context.Context, err error, reason, variant, key string)
type NoopMetricsRecorder ¶ added in v0.9.3
type NoopMetricsRecorder struct{}
func (NoopMetricsRecorder) HTTPAttributes ¶ added in v0.9.3
func (NoopMetricsRecorder) HTTPAttributes(_, _, _, _ string) []attribute.KeyValue
func (NoopMetricsRecorder) HTTPRequestDuration ¶ added in v0.9.3
func (NoopMetricsRecorder) HTTPResponseSize ¶ added in v0.9.3
func (NoopMetricsRecorder) Impressions ¶ added in v0.9.3
func (NoopMetricsRecorder) Impressions(_ context.Context, _, _, _ string)
func (NoopMetricsRecorder) InFlightRequestEnd ¶ added in v0.9.3
func (NoopMetricsRecorder) InFlightRequestEnd(_ context.Context, _ []attribute.KeyValue)
func (NoopMetricsRecorder) InFlightRequestStart ¶ added in v0.9.3
func (NoopMetricsRecorder) InFlightRequestStart(_ context.Context, _ []attribute.KeyValue)
func (NoopMetricsRecorder) RecordEvaluation ¶ added in v0.9.3
func (NoopMetricsRecorder) RecordEvaluation(_ context.Context, _ error, _, _, _ string)