Documentation
¶
Index ¶
- func NewNoopTracer(name string) trace.Tracer
- type BytesMapAttributes
- type Exporter
- func NewDatadogExporterUseAgent(host, port string) Exporter
- func NewDatadogExporterUseEndpointUrl(address string) Exporter
- func NewExporterStandardGrpcWithCustomURL(fullUrl string) Exporter
- func NewExporterStandardWithCustomHost(host string) Exporter
- func NewExporterStandardWithCustomPath(path string) Exporter
- func NewExporterStandardWithCustomURL(fullUrl string) Exporter
- func NewZipkinExporter(url, logName string) Exporter
- type ExporterProvider
- type Manager
- type Metric
- type MetricActions
- type MetricOption
- type MetricProvider
- type MetricPushAction
- type MetricResponseCode
- type MetricsManager
- type SpanProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNoopTracer ¶
Types ¶
type BytesMapAttributes ¶
func UseBytesMapAttributes ¶
func UseBytesMapAttributes(prefix string, bytesMap []byte, excludeKeys map[string]int8) BytesMapAttributes
type Exporter ¶
type Exporter interface {
traceSdk.SpanExporter
Init() error
SpanProcessorType() SpanProcessor
}
func NewZipkinExporter ¶
type ExporterProvider ¶
type ExporterProvider string
const ( ExporterStandard ExporterProvider = "standard" ExporterZipkin ExporterProvider = "zipkin" ExporterDatadog ExporterProvider = "datadog" )
func (ExporterProvider) String ¶
func (t ExporterProvider) String() string
type Manager ¶
type Manager interface {
Init() error
MustInit() Manager
Enabled() bool
Tracer() trace.Tracer
// NewTracer returns a Tracer with the given name and options. If a Tracer for
// the given name and options does not exist it is created, otherwise the
// existing Tracer is returned.
//
// If name is empty, DefaultTracerName is used instead.
//
// This method is safe to be called concurrently.
NewTracer(name string, opts ...trace.TracerOption) trace.Tracer
// ForceFlush immediately exports all spans that have not yet been exported for
// all the registered span processors.
ForceFlush(ctx context.Context) error
// Shutdown shuts down the span processors in the order they were registered.
Shutdown(ctx context.Context) error
}
type Metric ¶
type Metric interface {
MetricActions
IncrSuccess(metricName string)
IncrFail(metricName string, err error)
DecrSuccess(metricName string)
DecrFail(metricName string, err error)
IncrHTTP(method, metricName string, httpStatusCode int)
DecrHTTP(method, metricName string, httpStatusCode int)
Incr(metricName string, tags []string)
Decr(metricName string, tags []string)
Key() string
Name() string
MustInit() Metric
}
Metric Interface. All methods SHOULD be safe for concurrent use.
func NewDatadogMetrics ¶
func NewDatadogMetrics(key, name string, log logger.Manager, opts ...MetricOption[*metricDataDog]) Metric
type MetricActions ¶
type MetricOption ¶
type MetricOption[T any] func(T)
func MetricDatadogWithAgentAddress ¶
func MetricDatadogWithAgentAddress(address string) MetricOption[*metricDataDog]
func MetricDatadogWithEnv ¶
func MetricDatadogWithEnv(env string) MetricOption[*metricDataDog]
func MetricDatadogWithSampleRate ¶
func MetricDatadogWithSampleRate(sampleRate float64) MetricOption[*metricDataDog]
type MetricProvider ¶
type MetricProvider string
const ( MetricDatadog MetricProvider = "datadog" MetricOTLP MetricProvider = "otlp" )
func (MetricProvider) String ¶
func (t MetricProvider) String() string
type MetricPushAction ¶
type MetricPushAction interface {
Push(tags ...string)
}
func NewMetricActionNoop ¶
func NewMetricActionNoop(log logger.Manager) MetricPushAction
type MetricResponseCode ¶
type MetricResponseCode string
const ( MetricResponseCodeBase MetricResponseCode = "response_code" MetricResponseCodeSuccess MetricResponseCode = MetricResponseCodeBase + ":200" MetricResponseCodeFail MetricResponseCode = MetricResponseCodeBase + ":500" )
func (MetricResponseCode) String ¶
func (v MetricResponseCode) String() string
type MetricsManager ¶
type MetricsManager interface {
StartBy(provider, name string) MetricPushAction
Start(name string) MetricPushAction
StartDefault(name string) MetricPushAction
Enabled() bool
MetricActions
MustInit() MetricsManager
}
func NewMetricNoop ¶
func NewMetricNoop() MetricsManager
func NewMetricsManager ¶
func NewMetricsManager(log logger.Manager, serviceName string, metrics ...Metric) MetricsManager
type SpanProcessor ¶
type SpanProcessor string
const ( SpanProcessorBatch SpanProcessor = "batch" SpanProcessorSimple SpanProcessor = "simple" SpanProcessorSimpleCustom SpanProcessor = "simple_custom" )
Click to show internal directories.
Click to hide internal directories.