Documentation ¶
Overview ¶
Package exporter contains basic exporters for xtel like stdout and otlp.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var WithTracesExporterInsecure = &insecure{}
WithTracesExporterInsecure permits connecting to the trace endpoint without a certificate.
Functions ¶
func NewOTLP ¶
func NewOTLP(opts ...Option) xtel.TraceExporterFunc
NewOTLP returns a new exporter and starts it. It configs the new exporter with the given Options.
Example ¶
package main import ( "fmt" "github.com/gojekfarm/xtools/xtel" "github.com/gojekfarm/xtools/xtel/exporter" ) func main() { _, err := xtel.NewProvider("eg-service", exporter.NewOTLP(exporter.WithTracesExporterInsecure)) if err != nil { fmt.Printf("failed exporting traces to exporter: %s\n", err) } }
Output:
func NewPrometheus ¶
func NewPrometheus(opts PrometheusOptions) xtel.MetricReaderFunc
NewPrometheus returns a new prometheus metric.Reader. It configs the new exporter with the given PrometheusOptions.
Example ¶
package main import ( "fmt" "github.com/gojekfarm/xtools/xtel" "github.com/gojekfarm/xtools/xtel/exporter" ) func main() { _, err := xtel.NewProvider("eg-service", exporter.NewPrometheus(exporter.PrometheusOptions{})) if err != nil { fmt.Printf("failed exporting metrics to prometheus: %s\n", err) } }
Output:
func NewSTDOut ¶
func NewSTDOut(opts STDOutOptions) xtel.TraceExporterFunc
NewSTDOut exports and writes exported tracing telemetry information in JSON for the given STDOutOptions.
Example ¶
package main import ( "fmt" "github.com/gojekfarm/xtools/xtel" "github.com/gojekfarm/xtools/xtel/exporter" ) func main() { _, err := xtel.NewProvider("eg-service", exporter.NewSTDOut(exporter.STDOutOptions{PrettyPrint: true})) if err != nil { fmt.Printf("failed printing traces to terminal: %s\n", err) } }
Output:
Types ¶
type Mode ¶
type Mode int
Mode is the used to control the export configuration of the otlptrace package exporters.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option defines the implementation of the configurations.
func WithTracesExporterEndpoint ¶
WithTracesExporterEndpoint configures the endpoint for sending traces via OTLP.
type PrometheusOptions ¶
type PrometheusOptions struct {
Registerer pc.Registerer
}
PrometheusOptions handles the configuration of Prometheus exporter.
type STDOutOptions ¶
type STDOutOptions struct {
PrettyPrint bool
}
STDOutOptions handles the configuration of STDOUT output. It handles the PrettyPrint parameter of the application.