Documentation ¶
Overview ¶
Package kotel adds opentelemetry instrumentation to a KrakenD instance (or some other [Lura](https://github.com/luraproject/lura) based softawre)
In the KrakenD project, we can differentiate 3 main stages in the process of handling a request:
- the "router" stage: the part where the router plugins are run, and is the part from receiving the request, up to the point where the request enters the Lura's pipeline.
- the "proxy" stage: is for the processing endpoint part, up to the point
- the "backend" stage: is the part for each one of the backends that will be used for a given endpoint.
Index ¶
- func Register(ctx context.Context, l logging.Logger, srvCfg lconfig.ServiceConfig) (func(), error)
- func RegisterGlobalInstance(ctx context.Context, l logging.Logger, me map[string]exporter.MetricReader, ...) (func(), error)
- func RegisterWithConfig(ctx context.Context, l logging.Logger, cfg *config.ConfigData) (func(), error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register uses the ServiceConfig to instantiate the configured exporters. It also sets the global exporter instances, the global propagation method, and the global KrakenD otel state, so it can be used from anywhere.
func RegisterGlobalInstance ¶
func RegisterGlobalInstance(ctx context.Context, l logging.Logger, me map[string]exporter.MetricReader, te map[string]exporter.SpanExporter, metricReportingPeriod int, traceSampleRate float64, serviceName string, serviceVersion string, ) (func(), error)
RegisterGlobalInstance creates the instance that will be used to report metrics and traces
func RegisterWithConfig ¶
func RegisterWithConfig(ctx context.Context, l logging.Logger, cfg *config.ConfigData) (func(), error)
RegisterWithConfig instantiates the configured exporters from an already parsed config: sets the global exporter instances, the global propagation method, and the global KrakenD otel state, so it can be used from anywhere.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package config defines the configuration to be used to setup the metrics and traces for each stage of a KrakenD instances as well as the level of detail we want for each stage.
|
Package config defines the configuration to be used to setup the metrics and traces for each stage of a KrakenD instances as well as the level of detail we want for each stage. |
example
|
|
server
Srv creates a few basic routes to test the configured instrumentation.
|
Srv creates a few basic routes to test the configured instrumentation. |
Package exporter defines the interfaces required to implement in order to add additional exporters.
|
Package exporter defines the interfaces required to implement in order to add additional exporters. |
otelcollector
Package otelcollector implements the Open Telemetry exporter.
|
Package otelcollector implements the Open Telemetry exporter. |
prometheus
Package prometheus implements a Prometheus metrics exporter.
|
Package prometheus implements a Prometheus metrics exporter. |
client
Package client provides the instrumentation for an http client.
|
Package client provides the instrumentation for an http client. |
Package otelio implements the instrumentation around the io.Reader and io.Writer.
|
Package otelio implements the instrumentation around the io.Reader and io.Writer. |
router
|
|
Package state provides the functionality to "pack" into a single structure a set of configured instances (exporters, meters, tracers...)
|
Package state provides the functionality to "pack" into a single structure a set of configured instances (exporters, meters, tracers...) |