Documentation
¶
Index ¶
- Constants
- Variables
- func BrokerFilterName(args BrokerFilterNameArgs) string
- func BrokerIngressName(args BrokerIngressNameArgs) string
- func BrokerMessagingDestination(b types.NamespacedName) string
- func BrokerMessagingDestinationAttribute(b types.NamespacedName) trace.Attribute
- func MessagingMessageIDAttribute(ID string) trace.Attribute
- func MessagingProtocolAttribute(protocol string) trace.Attribute
- func PopulateSpan(span *trace.Span) binding.TransformerFunc
- func SetupDynamicPublishing(logger *zap.SugaredLogger, configMapWatcher *configmap.InformedWatcher, ...) error
- func SetupStaticPublishing(logger *zap.SugaredLogger, serviceName string, cfg *tracingconfig.Config) error
- func TriggerMessagingDestination(t types.NamespacedName) string
- func TriggerMessagingDestinationAttribute(t types.NamespacedName) trace.Attribute
- type BrokerFilterNameArgs
- type BrokerIngressNameArgs
Constants ¶
const ( MessagingSystemAttributeName = "messaging.system" MessagingDestinationAttributeName = "messaging.destination" MessagingProtocolAttributeName = "messaging.protocol" MessagingMessageIDAttributeName = "messaging.message_id" )
Variables ¶
var ( MessagingSystemAttribute trace.Attribute = trace.StringAttribute(MessagingSystemAttributeName, "knative") MessagingProtocolHTTP trace.Attribute = MessagingProtocolAttribute("HTTP") )
var ( // OnePercentSampling is a configuration that samples 1% of the requests. // TODO(#1712): Remove this and pull "static" configuration from the // environment instead. OnePercentSampling = &tracingconfig.Config{ Backend: tracingconfig.Zipkin, Debug: false, SampleRate: 0.01, ZipkinEndpoint: "http://zipkin.istio-system.svc.cluster.local:9411/api/v2/spans", } // AlwaysSample is a configuration that samples 100% of the requests and sends them to Zipkin. // It is expected to be used only for testing purposes (e.g. in e2e tests). // TODO(#1712): Remove this and pull "static" configuration from the environment instead. AlwaysSample = &tracingconfig.Config{ Backend: tracingconfig.Zipkin, Debug: true, SampleRate: 1.0, ZipkinEndpoint: "http://zipkin.istio-system.svc.cluster.local:9411/api/v2/spans", } )
Functions ¶
func BrokerFilterName ¶ added in v0.7.0
func BrokerFilterName(args BrokerFilterNameArgs) string
BrokerFilterName creates the service name for Broker Filters to use when writing traces.
func BrokerIngressName ¶ added in v0.7.0
func BrokerIngressName(args BrokerIngressNameArgs) string
BrokerIngressName creates the service name for Broker Ingresses to use when writing Zipkin traces.
func BrokerMessagingDestination ¶ added in v0.15.0
func BrokerMessagingDestination(b types.NamespacedName) string
func BrokerMessagingDestinationAttribute ¶ added in v0.15.0
func BrokerMessagingDestinationAttribute(b types.NamespacedName) trace.Attribute
func MessagingMessageIDAttribute ¶ added in v0.15.0
func MessagingProtocolAttribute ¶ added in v0.15.0
func PopulateSpan ¶ added in v0.14.0
func PopulateSpan(span *trace.Span) binding.TransformerFunc
func SetupDynamicPublishing ¶ added in v0.9.0
func SetupDynamicPublishing(logger *zap.SugaredLogger, configMapWatcher *configmap.InformedWatcher, serviceName, tracingConfigName string) error
SetupDynamicPublishing sets up trace publishing for the process, by watching a ConfigMap for the configuration. Note that other pieces still need to generate the traces, this just ensures that if generated, they are collected appropriately. This is normally done by using tracing.HTTPSpanMiddleware as a middleware HTTP handler. The configuration will be dynamically updated when the ConfigMap is updated.
func SetupStaticPublishing ¶ added in v0.9.0
func SetupStaticPublishing(logger *zap.SugaredLogger, serviceName string, cfg *tracingconfig.Config) error
SetupStaticPublishing sets up trace publishing for the process. Note that other pieces still need to generate the traces, this just ensures that if generated, they are collected appropriately. This is normally done by using tracing.HTTPSpanMiddleware as a middleware HTTP handler. The configuration will not be dynamically updated.
func TriggerMessagingDestination ¶ added in v0.15.0
func TriggerMessagingDestination(t types.NamespacedName) string
func TriggerMessagingDestinationAttribute ¶ added in v0.15.0
func TriggerMessagingDestinationAttribute(t types.NamespacedName) trace.Attribute
Types ¶
type BrokerFilterNameArgs ¶ added in v0.7.0
BrokerFilterNameArgs are the arguments needed to generate the BrokerFilterName.
type BrokerIngressNameArgs ¶ added in v0.7.0
BrokerIngressNameArgs are the arguments needed to generate the BrokerIngressName.