-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorb.go
More file actions
78 lines (75 loc) · 2.89 KB
/
orb.go
File metadata and controls
78 lines (75 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Package orb provides OpenTelemetry instrumentation for RabbitMQ using amqp091-go.
//
// StarTower Orb enables automatic distributed tracing for RabbitMQ operations
// with minimal code changes. It provides wrappers around amqp091-go types
// that automatically create spans and propagate trace context via message headers.
//
// Basic usage:
//
// import orb "github.com/startower-observability/orb/instrumentation"
//
// // Connect with instrumentation
// conn, err := orb.Dial("amqp://localhost:5672/")
// if err != nil {
// log.Fatal(err)
// }
// defer conn.Close()
//
// // Create instrumented channel
// ch, err := conn.ChannelWithTracing()
// if err != nil {
// log.Fatal(err)
// }
// defer ch.Close()
//
// // Publish with tracing
// err = ch.PublishWithTracing(ctx, "exchange", "key", false, false, msg)
//
// // Consume with tracing
// handler := func(ctx context.Context, delivery amqp091.Delivery) error {
// // Process message with trace context
// return nil
// }
// err = ch.ConsumeWithTracing(ctx, "queue", "", false, false, false, false, nil, handler)
//
// The library follows OpenTelemetry semantic conventions and provides
// configurable tracers, propagators, and span attributes.
package orb
import (
"github.com/startower-observability/orb/instrumentation"
)
type (
Channel = instrumentation.Channel
Connection = instrumentation.Connection
Publisher = instrumentation.Publisher
Consumer = instrumentation.Consumer
Propagator = instrumentation.Propagator
MessageHandler = instrumentation.MessageHandler
ChannelConfig = instrumentation.ChannelConfig
ConnectionConfig = instrumentation.ConnectionConfig
PublisherConfig = instrumentation.PublisherConfig
ConsumerConfig = instrumentation.ConsumerConfig
)
var (
Dial = instrumentation.Dial
DialWithConfig = instrumentation.DialWithConfig
DialConfig = instrumentation.DialConfig
DialConfigWithConfig = instrumentation.DialConfigWithConfig
NewChannel = instrumentation.NewChannel
NewDefaultChannel = instrumentation.NewDefaultChannel
NewConnection = instrumentation.NewConnection
NewDefaultConnection = instrumentation.NewDefaultConnection
NewPublisher = instrumentation.NewPublisher
NewDefaultPublisher = instrumentation.NewDefaultPublisher
NewConsumer = instrumentation.NewConsumer
NewDefaultConsumer = instrumentation.NewDefaultConsumer
NewPropagator = instrumentation.NewPropagator
Publish = instrumentation.Publish
PublishWithConfirm = instrumentation.PublishWithConfirm
ConsumeWithHandler = instrumentation.ConsumeWithHandler
ProcessDelivery = instrumentation.ProcessDelivery
WrapDelivery = instrumentation.WrapDelivery
InjectToPublishing = instrumentation.InjectToPublishing
ExtractFromDelivery = instrumentation.ExtractFromDelivery
DefaultPropagator = instrumentation.DefaultPropagator
)