Documentation ¶
Index ¶
Constants ¶
const ( // SpanTypeSQL is span as SQL span SpanTypeSQL int = 101 // SpanTypeRedis is span as Redis call span SpanTypeRedis int = 102 // SpanTypeHTTPCall is span as HTTP call span SpanTypeHTTPCall int = 103 // SpanTypeNSQPublish is a span as Message Broker NSQ Publish SpanTypeNSQPublish int = 104 // SpanTypeElasticsearch is span as Elasticsarch call span SpanTypeElasticsearch int = 105 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Appname string IsEnableJaeger bool IsEnableNewRelic bool NewRelic NewRelicConfig }
Config config
type NewRelicConfig ¶
NewRelicConfig is a newrelic's config
type Options ¶
Options is options for span
func WithSQLSpan ¶
WithSQLSpan returns Options for SQL
func WithSQLSpanPQInfo ¶
WithSQLSpanPQInfo return an Option for tracer.StartExternalSpanFromContext but with Database connection information
func WithSQLSpanWithName ¶
func WithSQLSpanWithName(dbName, dbHost, dbPort, query string, param map[string]interface{}) Options
WithSQLSpanWithName returns Options for SQL but with the database name & host
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span bg at funcs
func StartExternalSpanFromContext ¶
func StartExternalSpanFromContext(ctx context.Context, name string, opt Options) (Span, context.Context)
StartExternalSpanFromContext to start an external span. newrelic: span can be customized, either sql, redis, or http call span
func StartSpanFromContext ¶
StartSpanFromContext create and start newrelic span from context
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction bg transaction - at http handlers
func StartTransaction ¶
func StartTransaction(name string) (t Transaction, ctx context.Context)
StartTransaction will create new nr transaction
func StartTransactionFromContext ¶
StartTransactionFromContext to create a new nr transaction using existing context
func (*Transaction) Finish ¶
func (s *Transaction) Finish(err ...*error)
Finish finishing a span / transaction