{"modulePath":"github.com/GoCodeAlone/workflow","version":"v0.87.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package telemetry\n\n## Types\n\n```go\ntype Attrs map[string]string\n```\n\n```go\ntype Bridge struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewBridge(sink TelemetrySink, config BridgeConfig) *Bridge\n```\n\n```go\nfunc (b *Bridge) Collect(ctx context.Context, app modular.Application) error\n```\n\n```go\ntype BridgeConfig struct {\n\tTimeout time.Duration\n}\n```\n\n```go\ntype ContextServiceInvoker interface {\n\tInvokeServiceContext(context.Context, string, map[string]any) (map[string]any, error)\n}\n```\n\n```go\ntype LogEmitter interface {\n\tDrainTelemetryLogs(context.Context) []LogRecord\n}\n```\n\n```go\ntype LogRecord struct {\n\tTimestamp time.Time\n\tLevel     string\n\tMessage   string\n\tModule    string\n\tAttrs     Attrs\n}\n```\n\n```go\ntype MetricEmitter interface {\n\tEmitMetrics(context.Context, MetricRecorder) error\n}\n```\n\n```go\ntype MetricKind string\n```\n\n```go\nconst (\n\tMetricCounter   MetricKind = \"counter\"\n\tMetricGauge     MetricKind = \"gauge\"\n\tMetricHistogram MetricKind = \"histogram\"\n)\n```\n\n```go\ntype MetricRecord struct {\n\tName      string\n\tKind      MetricKind\n\tValue     float64\n\tAttrs     Attrs\n\tTimestamp time.Time\n}\n```\n\n```go\ntype MetricRecorder interface {\n\tCounter(name string, value float64, attrs Attrs)\n\tGauge(name string, value float64, attrs Attrs)\n\tHistogram(name string, value float64, attrs Attrs)\n}\n```\n\n```go\ntype NoopSink struct{}\n```\n\n```go\nfunc (NoopSink) RecordLogs(context.Context, []LogRecord) error\n```\n\n```go\nfunc (NoopSink) RecordMetrics(context.Context, []MetricRecord) error\n```\n\n```go\nfunc (NoopSink) RecordSpanEvents(context.Context, []SpanEvent) error\n```\n\n```go\ntype ServiceInvokerSink struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewServiceInvokerSink(invoker ContextServiceInvoker) *ServiceInvokerSink\n```\n\n```go\nfunc (s *ServiceInvokerSink) RecordLogs(ctx context.Context, records []LogRecord) error\n```\n\n```go\nfunc (s *ServiceInvokerSink) RecordMetrics(ctx context.Context, records []MetricRecord) error\n```\n\n```go\nfunc (s *ServiceInvokerSink) RecordSpanEvents(ctx context.Context, records []SpanEvent) error\n```\n\n```go\ntype SnapshotRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewSnapshotRecorder() *SnapshotRecorder\n```\n\n```go\nfunc (r *SnapshotRecorder) Counter(name string, value float64, attrs Attrs)\n```\n\n```go\nfunc (r *SnapshotRecorder) Gauge(name string, value float64, attrs Attrs)\n```\n\n```go\nfunc (r *SnapshotRecorder) Histogram(name string, value float64, attrs Attrs)\n```\n\n```go\nfunc (r *SnapshotRecorder) Metrics() []MetricRecord\n```\n\n```go\ntype SpanEvent struct {\n\tName      string\n\tAttrs     Attrs\n\tTimestamp time.Time\n}\n```\n\n```go\ntype SpanRecorder interface {\n\tEvent(name string, attrs Attrs)\n\tAttribute(key, value string)\n}\n```\n\n```go\ntype TelemetrySink interface {\n\tRecordMetrics(context.Context, []MetricRecord) error\n\tRecordLogs(context.Context, []LogRecord) error\n\tRecordSpanEvents(context.Context, []SpanEvent) error\n}\n```\n\n```go\ntype TraceAnnotator interface {\n\tAnnotateSpan(context.Context, SpanRecorder)\n}\n```\n\n","path":"github.com/GoCodeAlone/workflow/telemetry","name":"telemetry","synopsis":"","isRedistributable":true}
