Documentation ¶
Index ¶
- Constants
- Variables
- func AddGlobalGRPCDialOption(opt grpc.DialOption)
- func AddGlobalGRPCServerOption(opt grpc.ServerOption)
- func GetEndpointTLS(service string) (*grpc.ClientConn, error)
- func GrpcServerOptions(unaryInterceptor grpc.UnaryServerInterceptor, ...) []grpc.ServerOption
- func GrpcStart(server **grpc.Server, name, bind string, register func(srv *grpc.Server)) error
- func InitTelemetry(conf *Config, svcName, imName string) (func(), error)
- func MatchesRegex(s string) bool
- func MatchesVarRegex(s string) bool
- func SanitizeAsField(as string) string
- func Trace(ctx context.Context, msg string)
- func TraceHTTPRequest(ctx context.Context, r *http.Request) (cleanup func())
- func TransplantTelemetryContextInformation(a, b context.Context) context.Context
- type Config
- type GenericTelemetryCarrier
Constants ¶
View Source
const ( DBConn = "DIREKTIV_DB" DirektivDebug = "DIREKTIV_DEBUG" DirektivServiceNamespace = "DIREKTIV_SERVICE_NAMESPACE" DirektivNamespace = "DIREKTIV_NAMESPACE" DirektivFlowEndpoint = "DIREKTIV_FLOW_ENDPOINT" DirektivFunctionsEndpoint = "DIREKTIV_FUNCTIONS_ENDPOINT" DirektivIngressEndpoint = "DIREKTIV_INTERNAL_ENDPOINT" DirektivLogJSON = "DIREKTIV_LOG_JSON" DirektivOpentelemetry = "DIREKTIV_OTLP" )
Environtment variable keys
View Source
const RegexPattern = `^(([a-z][a-z0-9_\-]*[a-z0-9])|([a-z]))$`
View Source
const VarRegexPattern = `^(([a-zA-Z][a-zA-Z0-9_\-]*[a-zA-Z0-9])|([a-zA-Z]))$`
Variables ¶
View Source
var TelemetryMiddleware = func(h http.Handler) http.Handler {
return h
}
Functions ¶
func AddGlobalGRPCDialOption ¶
func AddGlobalGRPCDialOption(opt grpc.DialOption)
func AddGlobalGRPCServerOption ¶
func AddGlobalGRPCServerOption(opt grpc.ServerOption)
func GetEndpointTLS ¶
func GetEndpointTLS(service string) (*grpc.ClientConn, error)
GetEndpointTLS creates a grpc client
func GrpcServerOptions ¶ added in v0.5.0
func GrpcServerOptions(unaryInterceptor grpc.UnaryServerInterceptor, streamInterceptor grpc.StreamServerInterceptor) []grpc.ServerOption
func InitTelemetry ¶ added in v0.5.0
func MatchesRegex ¶
MatchesRegex responds true if the provided string matches the RegexPattern constant defined in this package.
func MatchesVarRegex ¶
func SanitizeAsField ¶ added in v0.5.5
SanitizeAsField removes initial slash if one exists and returns the new value
func TraceHTTPRequest ¶ added in v0.5.0
Types ¶
type Config ¶ added in v0.5.0
type Config struct { FunctionsService string `yaml:"functions-service"` FlowService string `yaml:"flow-service"` PrometheusBackend string `yaml:"prometheus-backend"` OpenTelemetryBackend string `yaml:"opentelemetry-backend"` Eventing bool `yaml:"eventing"` }
Config contain direktiv configuration
func ReadConfig ¶ added in v0.5.0
ReadConfig reads direktiv config file
func (*Config) GetTelemetryBackendAddr ¶ added in v0.5.0
type GenericTelemetryCarrier ¶ added in v0.5.0
func (*GenericTelemetryCarrier) Get ¶ added in v0.5.0
func (c *GenericTelemetryCarrier) Get(key string) string
func (*GenericTelemetryCarrier) Keys ¶ added in v0.5.0
func (c *GenericTelemetryCarrier) Keys() []string
func (*GenericTelemetryCarrier) Set ¶ added in v0.5.0
func (c *GenericTelemetryCarrier) Set(key, val string)
Click to show internal directories.
Click to hide internal directories.