Documentation ¶
Index ¶
- Constants
- func ConfigureOpenTelemetry(opts ...Option) error
- func ForceFlush(ctx context.Context) error
- func ReportError(ctx context.Context, err error, opts ...trace.EventOption)
- func ReportPanic(ctx context.Context)
- func Shutdown(ctx context.Context) error
- func TracerProvider() *sdktrace.TracerProvider
- type DSN
- type Metric
- type MetricsOption
- type Option
- func WithDSN(dsn string) Option
- func WithDeploymentEnvironment(env string) Option
- func WithResource(resource *resource.Resource) Option
- func WithResourceAttributes(attrs ...attribute.KeyValue) Option
- func WithResourceDetectors(detectors ...resource.Detector) Option
- func WithServiceName(serviceName string) Option
- func WithServiceVersion(serviceVersion string) Option
- func WithTLSConfig(tlsConf *tls.Config) Option
- type TracingOption
- func WithBatchSpanProcessorOption(opts ...sdktrace.BatchSpanProcessorOption) TracingOption
- func WithPrettyPrintSpanExporter() TracingOption
- func WithPropagator(propagator propagation.TextMapPropagator) TracingOption
- func WithTextMapPropagator(propagator propagation.TextMapPropagator) TracingOption
- func WithTraceSampler(sampler sdktrace.Sampler) TracingOption
- func WithTracerProvider(provider *sdktrace.TracerProvider) TracingOption
- func WithTracingDisabled() TracingOption
- func WithTracingEnabled(on bool) TracingOption
Constants ¶
const ( MetricNodeMsgIn Metric = "tiny_node_msg_in" MetricNodeMsgOut = "tiny_node_msg_out" MetricEdgeMsgIn = "tiny_edge_msg_in" MetricEdgeMsgOut = "tiny_edge_msg_out" MetricEdgeIsActive = "tiny_edge_is_active" )
Variables ¶
This section is empty.
Functions ¶
func ConfigureOpenTelemetry ¶ added in v0.1.63
ConfigureOpenTelemetry configures OpenTelemetry. You can use OTLP_DISABLED env var to completely skip open telemetry configuration.
func ForceFlush ¶ added in v0.1.63
func ReportError ¶ added in v0.1.63
func ReportError(ctx context.Context, err error, opts ...trace.EventOption)
func ReportPanic ¶ added in v0.1.63
func TracerProvider ¶ added in v0.1.63
func TracerProvider() *sdktrace.TracerProvider
Types ¶
type DSN ¶ added in v0.1.63
type DSN struct { Scheme string Host string GRPCPort string Token string // contains filtered or unexported fields }
func (*DSN) OTLPEndpoint ¶ added in v0.1.63
type MetricsOption ¶ added in v0.1.63
type MetricsOption interface { Option // contains filtered or unexported methods }
func WithMetricOption ¶ added in v0.1.63
func WithMetricOption(options ...metric.Option) MetricsOption
func WithMetricsDisabled ¶ added in v0.1.63
func WithMetricsDisabled() MetricsOption
WithMetricsDisabled disables metrics.
func WithMetricsEnabled ¶ added in v0.1.63
func WithMetricsEnabled(on bool) MetricsOption
WithMetricsEnabled can be used to enable/disable metrics.
type Option ¶ added in v0.1.63
type Option interface {
// contains filtered or unexported methods
}
func WithDSN ¶ added in v0.1.63
WithDSN configures a data source name that is used to connect `https://<token>@api.tinysystems.io`.
The default is to use OTLP_DSN environment variable.
func WithDeploymentEnvironment ¶ added in v0.1.63
WithDeploymentEnvironment configures `deployment.environment` resource attribute, for example, `production`.
func WithResource ¶ added in v0.1.63
WithResource configures a resource that describes an entity that produces telemetry, for example, such attributes as host.name and service.name. All produced spans and metrics will have these attributes.
WithResource overrides and replaces any other resource attributes.
func WithResourceAttributes ¶ added in v0.1.63
WithResourceAttributes configures resource attributes that describe an entity that produces telemetry, for example, such attributes as host.name, service.name, etc.
The default is to use `OTEL_RESOURCE_ATTRIBUTES` env var, for example, `OTEL_RESOURCE_ATTRIBUTES=service.name=myservice,service.version=1.0.0`.
func WithResourceDetectors ¶ added in v0.1.63
WithResourceDetectors adds detectors to be evaluated for the configured resource.
func WithServiceName ¶ added in v0.1.63
WithServiceName configures `service.name` resource attribute.
func WithServiceVersion ¶ added in v0.1.63
WithServiceVersion configures `service.version` resource attribute, for example, `1.0.0`.
func WithTLSConfig ¶ added in v0.1.63
type TracingOption ¶ added in v0.1.63
type TracingOption interface { Option // contains filtered or unexported methods }
func WithBatchSpanProcessorOption ¶ added in v0.1.63
func WithBatchSpanProcessorOption(opts ...sdktrace.BatchSpanProcessorOption) TracingOption
WithBatchSpanProcessorOption specifies options used to created BatchSpanProcessor.
func WithPrettyPrintSpanExporter ¶ added in v0.1.63
func WithPrettyPrintSpanExporter() TracingOption
WithPrettyPrintSpanExporter adds a span exproter that prints spans to stdout. It is useful for debugging or demonstration purposes.
func WithPropagator ¶ added in v0.1.63
func WithPropagator(propagator propagation.TextMapPropagator) TracingOption
WithPropagator sets the global TextMapPropagator used by OpenTelemetry. The default is propagation.TraceContext and propagation.Baggage.
func WithTextMapPropagator ¶ added in v0.1.63
func WithTextMapPropagator(propagator propagation.TextMapPropagator) TracingOption
WithTextMapPropagator is an alias for WithPropagator.
func WithTraceSampler ¶ added in v0.1.63
func WithTraceSampler(sampler sdktrace.Sampler) TracingOption
WithTraceSampler configures a span sampler.
func WithTracerProvider ¶ added in v0.1.63
func WithTracerProvider(provider *sdktrace.TracerProvider) TracingOption
WithTracerProvider overwrites the default tracer provider.
When this option is used, you might need to call otel.SetTracerProvider to register the provider as the global trace provider.
func WithTracingDisabled ¶ added in v0.1.63
func WithTracingDisabled() TracingOption
WithTracingDisabled disables tracing.
func WithTracingEnabled ¶ added in v0.1.63
func WithTracingEnabled(on bool) TracingOption
WithTracingEnabled can be used to enable/disable tracing.