Repository navigation
Releases
Releases · wendall-robinson/flowmaster
AddAttributes() now works after Start()
Updated trace.AddAttribute() to allow adding new attributes after .Start() has been called. This is a backwards compatible change and prior implementations will still work as is.
Added `ExtractGRPCContext` as a stand alone Public Method
Primary Change
- Removed
trace.ExtractGRPCContextas a receiver method ofTrace- this extractor returns a context.Context and cannot be a chaninable (fluid) method of the
Tracestruct
- this extractor returns a context.Context and cannot be a chaninable (fluid) method of the
- Added
ExtractGRPCContextas a standalone Public Method- when extracting gRPC trace data using
ExtractGRPCContext, extract it into a new context before passing it to a new trace
- when extracting gRPC trace data using
Message Queue Trace Propagation Support
Primary Change
Add message queue propagation
- added trace propagation and trace context extraction support for NATS
- added trace propagation and trace context extraction support for Kafka
- added trace propagation and trace context extraction support for RabbitMQ
Example
Add a trace context into a NATS header
package main
import (
"context"
"fmt"
"github.com/nats-io/nats.go"
"github.com/wendall-robinson/flowmaster/traceflow"
)
func main() {
ctx := context.Background()
// Create a new span for the nats publish event itself (not the propagation)
span := traceflow.New(ctx, "nats").Producer()
header := nats.Header{}
// will inject the NATS header into the current trace context
traceflow.PropagateNats(trace.GetContext(), nats.Header{})
// Publish the Request
< NATS IMPLEMENTATION >
}Extract trace context from a NATS header
package main
import (
"context"
"fmt"
"github.com/nats-io/nats.go"
"github.com/wendall-robinson/flowmaster/traceflow"
)
func main() {
// incoming NATS message
< NATS INBOUND MESSAGE HANDLING IMPLEMENTATION >
// Extract the trace context from the incoming message and forwarding it
newCtx := traceflow.ExtractNats(ctx, nats.Header)
// Create a new span for the nats subscribe event
span := traceflow.New(newCtx, "nats").Consumer()
defer span.Start("nats-event").End()
}Golang and Dependancie Updates
Primary Changes
Updated to Go v1.24.0
- updated dependencies
- updated
otel-config.yamlin basic example to remove deprecated logger configuration - updated linters to remove deprecated linters
- fixed minor linting issues in traceflow/config.go
Initial Release of TraceFlow
TraceFlow is a Go package that provides a simple, fluent interface for integrating OpenTelemetry distributed tracing into your Go applications. It abstracts away much of the complexity and boilerplate involved in creating and managing traces, allowing developers to focus on their application logic while still benefiting from powerful distributed tracing features.