Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a tracing client exported to the k6 script.
func (*Client) ExportMetrics ¶
func (c *Client) ExportMetrics()
ExportMetrics converts otel collector metrics to k6 metrics
func (*Client) Push ¶
func (c *Client) Push(te []TraceEntry) *goja.Object
Push pushes a trace entry to the collector. Note - depending on the collector config this may just push to a queue and not actually send the data.
type ClientTracing ¶
type ClientTracing struct {
// contains filtered or unexported fields
}
ClientTracing is the k6 module for tracing.
func (*ClientTracing) Exports ¶
func (r *ClientTracing) Exports() modules.Exports
func (*ClientTracing) GenerateRandomTraceID ¶
func (c *ClientTracing) GenerateRandomTraceID() string
GenerateRandomTraceID generates a random trace ID encoded as a hex string.
func (*ClientTracing) NewClient ¶
func (c *ClientTracing) NewClient(g goja.ConstructorCall) *goja.Object
NewClient creates a new tracing client from the given config.
type Config ¶
type Config struct { // OTLP exporter type. Exporter exporterName // OTLP exporter endpoint. Endpoint string // Insecure allows insecure connection to the collector. Insecure bool // InsecureSkipVerify allows TLS without a valid certificate. InsecureSkipVerify bool // Headers to be added to the request. Headers map[string]configopaque.String // LogLevel sets the log level of the exporter. Loglevel string }
Config holds the configuration for the tracing client.
type SpansEntry ¶
type SpansEntry struct { Count int `json:"count"` Size int `json:"size"` RandomName bool `json:"random_name"` FixedAttrs map[string]interface{} `json:"fixed_attrs"` }
SpansEntry holds the config to generate spans.
type TraceEntry ¶
type TraceEntry struct { ID string `json:"id"` // StartTime is an optional start time for the trace. StartTime time.Time `json:"start_time"` RandomServiceName bool `json:"random_service_name"` Spans SpansEntry `json:"spans"` }
TraceEntry holds the config to generate a trace.
Click to show internal directories.
Click to hide internal directories.