build(deps): bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
Bumps [go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.60.0 to 0.61.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.60.0...zpages/v0.61.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency-version: 0.61.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
@@ -88,7 +88,7 @@ require (
|
|||||||
github.com/xhit/go-simple-mail/v2 v2.16.0
|
github.com/xhit/go-simple-mail/v2 v2.16.0
|
||||||
go-micro.dev/v4 v4.11.0
|
go-micro.dev/v4 v4.11.0
|
||||||
go.etcd.io/bbolt v1.4.0
|
go.etcd.io/bbolt v1.4.0
|
||||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0
|
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0
|
||||||
go.opentelemetry.io/contrib/zpages v0.61.0
|
go.opentelemetry.io/contrib/zpages v0.61.0
|
||||||
go.opentelemetry.io/otel v1.36.0
|
go.opentelemetry.io/otel v1.36.0
|
||||||
|
|||||||
@@ -1166,8 +1166,8 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
|
|||||||
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
||||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 h1:x7wzEgXfnzJcHDwStJT+mxOz4etr2EcexjqhBvmoakw=
|
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ=
|
||||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0/go.mod h1:rg+RlpR5dKwaS95IyyZqj5Wd4E13lk/msnTS0Xl9lJM=
|
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0/go.mod h1:snMWehoOh2wsEwnvvwtDyFCxVeDAODenXHtn5vzrKjo=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q=
|
||||||
go.opentelemetry.io/contrib/zpages v0.61.0 h1:tYvUj377Dn3k1wf1le/f8YWSNQ8k0byS3jK8PiIXu9Y=
|
go.opentelemetry.io/contrib/zpages v0.61.0 h1:tYvUj377Dn3k1wf1le/f8YWSNQ8k0byS3jK8PiIXu9Y=
|
||||||
|
|||||||
Generated
Vendored
+3
-99
@@ -9,18 +9,12 @@ import (
|
|||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
"go.opentelemetry.io/otel/metric"
|
"go.opentelemetry.io/otel/metric"
|
||||||
"go.opentelemetry.io/otel/metric/noop"
|
|
||||||
"go.opentelemetry.io/otel/propagation"
|
"go.opentelemetry.io/otel/propagation"
|
||||||
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
|
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
// ScopeName is the instrumentation scope name.
|
||||||
// ScopeName is the instrumentation scope name.
|
const ScopeName = "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
|
||||||
ScopeName = "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
|
|
||||||
// GRPCStatusCodeKey is convention for numeric status code of a gRPC request.
|
|
||||||
GRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
|
|
||||||
)
|
|
||||||
|
|
||||||
// InterceptorFilter is a predicate used to determine whether a given request in
|
// InterceptorFilter is a predicate used to determine whether a given request in
|
||||||
// interceptor info should be instrumented. A InterceptorFilter must return true if
|
// interceptor info should be instrumented. A InterceptorFilter must return true if
|
||||||
@@ -47,15 +41,6 @@ type config struct {
|
|||||||
|
|
||||||
ReceivedEvent bool
|
ReceivedEvent bool
|
||||||
SentEvent bool
|
SentEvent bool
|
||||||
|
|
||||||
tracer trace.Tracer
|
|
||||||
meter metric.Meter
|
|
||||||
|
|
||||||
rpcDuration metric.Float64Histogram
|
|
||||||
rpcInBytes metric.Int64Histogram
|
|
||||||
rpcOutBytes metric.Int64Histogram
|
|
||||||
rpcInMessages metric.Int64Histogram
|
|
||||||
rpcOutMessages metric.Int64Histogram
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Option applies an option value for a config.
|
// Option applies an option value for a config.
|
||||||
@@ -64,7 +49,7 @@ type Option interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// newConfig returns a config configured with all the passed Options.
|
// newConfig returns a config configured with all the passed Options.
|
||||||
func newConfig(opts []Option, role string) *config {
|
func newConfig(opts []Option) *config {
|
||||||
c := &config{
|
c := &config{
|
||||||
Propagators: otel.GetTextMapPropagator(),
|
Propagators: otel.GetTextMapPropagator(),
|
||||||
TracerProvider: otel.GetTracerProvider(),
|
TracerProvider: otel.GetTracerProvider(),
|
||||||
@@ -73,87 +58,6 @@ func newConfig(opts []Option, role string) *config {
|
|||||||
for _, o := range opts {
|
for _, o := range opts {
|
||||||
o.apply(c)
|
o.apply(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
c.tracer = c.TracerProvider.Tracer(
|
|
||||||
ScopeName,
|
|
||||||
trace.WithInstrumentationVersion(SemVersion()),
|
|
||||||
)
|
|
||||||
|
|
||||||
c.meter = c.MeterProvider.Meter(
|
|
||||||
ScopeName,
|
|
||||||
metric.WithInstrumentationVersion(Version()),
|
|
||||||
metric.WithSchemaURL(semconv.SchemaURL),
|
|
||||||
)
|
|
||||||
|
|
||||||
var err error
|
|
||||||
c.rpcDuration, err = c.meter.Float64Histogram("rpc."+role+".duration",
|
|
||||||
metric.WithDescription("Measures the duration of inbound RPC."),
|
|
||||||
metric.WithUnit("ms"))
|
|
||||||
if err != nil {
|
|
||||||
otel.Handle(err)
|
|
||||||
if c.rpcDuration == nil {
|
|
||||||
c.rpcDuration = noop.Float64Histogram{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rpcRequestSize, err := c.meter.Int64Histogram("rpc."+role+".request.size",
|
|
||||||
metric.WithDescription("Measures size of RPC request messages (uncompressed)."),
|
|
||||||
metric.WithUnit("By"))
|
|
||||||
if err != nil {
|
|
||||||
otel.Handle(err)
|
|
||||||
if rpcRequestSize == nil {
|
|
||||||
rpcRequestSize = noop.Int64Histogram{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rpcResponseSize, err := c.meter.Int64Histogram("rpc."+role+".response.size",
|
|
||||||
metric.WithDescription("Measures size of RPC response messages (uncompressed)."),
|
|
||||||
metric.WithUnit("By"))
|
|
||||||
if err != nil {
|
|
||||||
otel.Handle(err)
|
|
||||||
if rpcResponseSize == nil {
|
|
||||||
rpcResponseSize = noop.Int64Histogram{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rpcRequestsPerRPC, err := c.meter.Int64Histogram("rpc."+role+".requests_per_rpc",
|
|
||||||
metric.WithDescription("Measures the number of messages received per RPC. Should be 1 for all non-streaming RPCs."),
|
|
||||||
metric.WithUnit("{count}"))
|
|
||||||
if err != nil {
|
|
||||||
otel.Handle(err)
|
|
||||||
if rpcRequestsPerRPC == nil {
|
|
||||||
rpcRequestsPerRPC = noop.Int64Histogram{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rpcResponsesPerRPC, err := c.meter.Int64Histogram("rpc."+role+".responses_per_rpc",
|
|
||||||
metric.WithDescription("Measures the number of messages received per RPC. Should be 1 for all non-streaming RPCs."),
|
|
||||||
metric.WithUnit("{count}"))
|
|
||||||
if err != nil {
|
|
||||||
otel.Handle(err)
|
|
||||||
if rpcResponsesPerRPC == nil {
|
|
||||||
rpcResponsesPerRPC = noop.Int64Histogram{}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch role {
|
|
||||||
case "client":
|
|
||||||
c.rpcInBytes = rpcResponseSize
|
|
||||||
c.rpcInMessages = rpcResponsesPerRPC
|
|
||||||
c.rpcOutBytes = rpcRequestSize
|
|
||||||
c.rpcOutMessages = rpcRequestsPerRPC
|
|
||||||
case "server":
|
|
||||||
c.rpcInBytes = rpcRequestSize
|
|
||||||
c.rpcInMessages = rpcRequestsPerRPC
|
|
||||||
c.rpcOutBytes = rpcResponseSize
|
|
||||||
c.rpcOutMessages = rpcResponsesPerRPC
|
|
||||||
default:
|
|
||||||
c.rpcInBytes = noop.Int64Histogram{}
|
|
||||||
c.rpcInMessages = noop.Int64Histogram{}
|
|
||||||
c.rpcOutBytes = noop.Int64Histogram{}
|
|
||||||
c.rpcOutMessages = noop.Int64Histogram{}
|
|
||||||
}
|
|
||||||
|
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Generated
Vendored
+25
-184
@@ -11,7 +11,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
grpc_codes "google.golang.org/grpc/codes"
|
grpc_codes "google.golang.org/grpc/codes"
|
||||||
@@ -23,8 +22,7 @@ import (
|
|||||||
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
|
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
"go.opentelemetry.io/otel/codes"
|
"go.opentelemetry.io/otel/codes"
|
||||||
"go.opentelemetry.io/otel/metric"
|
semconv "go.opentelemetry.io/otel/semconv/v1.30.0"
|
||||||
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
|
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -39,82 +37,15 @@ func (m messageType) Event(ctx context.Context, id int, _ interface{}) {
|
|||||||
}
|
}
|
||||||
span.AddEvent("message", trace.WithAttributes(
|
span.AddEvent("message", trace.WithAttributes(
|
||||||
attribute.KeyValue(m),
|
attribute.KeyValue(m),
|
||||||
RPCMessageIDKey.Int(id),
|
semconv.RPCMessageIDKey.Int(id),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
messageSent = messageType(RPCMessageTypeSent)
|
messageSent = messageType(semconv.RPCMessageTypeSent)
|
||||||
messageReceived = messageType(RPCMessageTypeReceived)
|
messageReceived = messageType(semconv.RPCMessageTypeReceived)
|
||||||
)
|
)
|
||||||
|
|
||||||
// UnaryClientInterceptor returns a grpc.UnaryClientInterceptor suitable
|
|
||||||
// for use in a grpc.NewClient call.
|
|
||||||
//
|
|
||||||
// Deprecated: Use [NewClientHandler] instead.
|
|
||||||
func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor {
|
|
||||||
cfg := newConfig(opts, "client")
|
|
||||||
tracer := cfg.TracerProvider.Tracer(
|
|
||||||
ScopeName,
|
|
||||||
trace.WithInstrumentationVersion(Version()),
|
|
||||||
)
|
|
||||||
|
|
||||||
return func(
|
|
||||||
ctx context.Context,
|
|
||||||
method string,
|
|
||||||
req, reply interface{},
|
|
||||||
cc *grpc.ClientConn,
|
|
||||||
invoker grpc.UnaryInvoker,
|
|
||||||
callOpts ...grpc.CallOption,
|
|
||||||
) error {
|
|
||||||
i := &InterceptorInfo{
|
|
||||||
Method: method,
|
|
||||||
Type: UnaryClient,
|
|
||||||
}
|
|
||||||
if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) {
|
|
||||||
return invoker(ctx, method, req, reply, cc, callOpts...)
|
|
||||||
}
|
|
||||||
|
|
||||||
name, attr, _ := telemetryAttributes(method, cc.Target())
|
|
||||||
|
|
||||||
startOpts := append([]trace.SpanStartOption{
|
|
||||||
trace.WithSpanKind(trace.SpanKindClient),
|
|
||||||
trace.WithAttributes(attr...),
|
|
||||||
},
|
|
||||||
cfg.SpanStartOptions...,
|
|
||||||
)
|
|
||||||
|
|
||||||
ctx, span := tracer.Start(
|
|
||||||
ctx,
|
|
||||||
name,
|
|
||||||
startOpts...,
|
|
||||||
)
|
|
||||||
defer span.End()
|
|
||||||
|
|
||||||
ctx = inject(ctx, cfg.Propagators)
|
|
||||||
|
|
||||||
if cfg.SentEvent {
|
|
||||||
messageSent.Event(ctx, 1, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
err := invoker(ctx, method, req, reply, cc, callOpts...)
|
|
||||||
|
|
||||||
if cfg.ReceivedEvent {
|
|
||||||
messageReceived.Event(ctx, 1, reply)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
s, _ := status.FromError(err)
|
|
||||||
span.SetStatus(codes.Error, s.Message())
|
|
||||||
span.SetAttributes(statusCodeAttr(s.Code()))
|
|
||||||
} else {
|
|
||||||
span.SetAttributes(statusCodeAttr(grpc_codes.OK))
|
|
||||||
}
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// clientStream wraps around the embedded grpc.ClientStream, and intercepts the RecvMsg and
|
// clientStream wraps around the embedded grpc.ClientStream, and intercepts the RecvMsg and
|
||||||
// SendMsg method call.
|
// SendMsg method call.
|
||||||
type clientStream struct {
|
type clientStream struct {
|
||||||
@@ -213,7 +144,7 @@ func (w *clientStream) endSpan(err error) {
|
|||||||
//
|
//
|
||||||
// Deprecated: Use [NewClientHandler] instead.
|
// Deprecated: Use [NewClientHandler] instead.
|
||||||
func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
|
func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
|
||||||
cfg := newConfig(opts, "client")
|
cfg := newConfig(opts)
|
||||||
tracer := cfg.TracerProvider.Tracer(
|
tracer := cfg.TracerProvider.Tracer(
|
||||||
ScopeName,
|
ScopeName,
|
||||||
trace.WithInstrumentationVersion(Version()),
|
trace.WithInstrumentationVersion(Version()),
|
||||||
@@ -235,7 +166,7 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
|
|||||||
return streamer(ctx, desc, cc, method, callOpts...)
|
return streamer(ctx, desc, cc, method, callOpts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
name, attr, _ := telemetryAttributes(method, cc.Target())
|
name, attr := telemetryAttributes(method, cc.Target())
|
||||||
|
|
||||||
startOpts := append([]trace.SpanStartOption{
|
startOpts := append([]trace.SpanStartOption{
|
||||||
trace.WithSpanKind(trace.SpanKindClient),
|
trace.WithSpanKind(trace.SpanKindClient),
|
||||||
@@ -265,81 +196,6 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnaryServerInterceptor returns a grpc.UnaryServerInterceptor suitable
|
|
||||||
// for use in a grpc.NewServer call.
|
|
||||||
//
|
|
||||||
// Deprecated: Use [NewServerHandler] instead.
|
|
||||||
func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor {
|
|
||||||
cfg := newConfig(opts, "server")
|
|
||||||
tracer := cfg.TracerProvider.Tracer(
|
|
||||||
ScopeName,
|
|
||||||
trace.WithInstrumentationVersion(Version()),
|
|
||||||
)
|
|
||||||
|
|
||||||
return func(
|
|
||||||
ctx context.Context,
|
|
||||||
req interface{},
|
|
||||||
info *grpc.UnaryServerInfo,
|
|
||||||
handler grpc.UnaryHandler,
|
|
||||||
) (interface{}, error) {
|
|
||||||
i := &InterceptorInfo{
|
|
||||||
UnaryServerInfo: info,
|
|
||||||
Type: UnaryServer,
|
|
||||||
}
|
|
||||||
if cfg.InterceptorFilter != nil && !cfg.InterceptorFilter(i) {
|
|
||||||
return handler(ctx, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx = extract(ctx, cfg.Propagators)
|
|
||||||
name, attr, metricAttrs := telemetryAttributes(info.FullMethod, peerFromCtx(ctx))
|
|
||||||
|
|
||||||
startOpts := append([]trace.SpanStartOption{
|
|
||||||
trace.WithSpanKind(trace.SpanKindServer),
|
|
||||||
trace.WithAttributes(attr...),
|
|
||||||
},
|
|
||||||
cfg.SpanStartOptions...,
|
|
||||||
)
|
|
||||||
|
|
||||||
ctx, span := tracer.Start(
|
|
||||||
trace.ContextWithRemoteSpanContext(ctx, trace.SpanContextFromContext(ctx)),
|
|
||||||
name,
|
|
||||||
startOpts...,
|
|
||||||
)
|
|
||||||
defer span.End()
|
|
||||||
|
|
||||||
if cfg.ReceivedEvent {
|
|
||||||
messageReceived.Event(ctx, 1, req)
|
|
||||||
}
|
|
||||||
|
|
||||||
before := time.Now()
|
|
||||||
|
|
||||||
resp, err := handler(ctx, req)
|
|
||||||
|
|
||||||
s, _ := status.FromError(err)
|
|
||||||
if err != nil {
|
|
||||||
statusCode, msg := serverStatus(s)
|
|
||||||
span.SetStatus(statusCode, msg)
|
|
||||||
if cfg.SentEvent {
|
|
||||||
messageSent.Event(ctx, 1, s.Proto())
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if cfg.SentEvent {
|
|
||||||
messageSent.Event(ctx, 1, resp)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
grpcStatusCodeAttr := statusCodeAttr(s.Code())
|
|
||||||
span.SetAttributes(grpcStatusCodeAttr)
|
|
||||||
|
|
||||||
// Use floating point division here for higher precision (instead of Millisecond method).
|
|
||||||
elapsedTime := float64(time.Since(before)) / float64(time.Millisecond)
|
|
||||||
|
|
||||||
metricAttrs = append(metricAttrs, grpcStatusCodeAttr)
|
|
||||||
cfg.rpcDuration.Record(ctx, elapsedTime, metric.WithAttributeSet(attribute.NewSet(metricAttrs...)))
|
|
||||||
|
|
||||||
return resp, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// serverStream wraps around the embedded grpc.ServerStream, and intercepts the RecvMsg and
|
// serverStream wraps around the embedded grpc.ServerStream, and intercepts the RecvMsg and
|
||||||
// SendMsg method call.
|
// SendMsg method call.
|
||||||
type serverStream struct {
|
type serverStream struct {
|
||||||
@@ -395,7 +251,7 @@ func wrapServerStream(ctx context.Context, ss grpc.ServerStream, cfg *config) *s
|
|||||||
//
|
//
|
||||||
// Deprecated: Use [NewServerHandler] instead.
|
// Deprecated: Use [NewServerHandler] instead.
|
||||||
func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor {
|
func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor {
|
||||||
cfg := newConfig(opts, "server")
|
cfg := newConfig(opts)
|
||||||
tracer := cfg.TracerProvider.Tracer(
|
tracer := cfg.TracerProvider.Tracer(
|
||||||
ScopeName,
|
ScopeName,
|
||||||
trace.WithInstrumentationVersion(Version()),
|
trace.WithInstrumentationVersion(Version()),
|
||||||
@@ -417,7 +273,7 @@ func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctx = extract(ctx, cfg.Propagators)
|
ctx = extract(ctx, cfg.Propagators)
|
||||||
name, attr, _ := telemetryAttributes(info.FullMethod, peerFromCtx(ctx))
|
name, attr := telemetryAttributes(info.FullMethod, peerFromCtx(ctx))
|
||||||
|
|
||||||
startOpts := append([]trace.SpanStartOption{
|
startOpts := append([]trace.SpanStartOption{
|
||||||
trace.WithSpanKind(trace.SpanKindServer),
|
trace.WithSpanKind(trace.SpanKindServer),
|
||||||
@@ -449,47 +305,32 @@ func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor {
|
|||||||
|
|
||||||
// telemetryAttributes returns a span name and span and metric attributes from
|
// telemetryAttributes returns a span name and span and metric attributes from
|
||||||
// the gRPC method and peer address.
|
// the gRPC method and peer address.
|
||||||
func telemetryAttributes(fullMethod, peerAddress string) (string, []attribute.KeyValue, []attribute.KeyValue) {
|
func telemetryAttributes(fullMethod, sererAddr string) (string, []attribute.KeyValue) {
|
||||||
name, methodAttrs := internal.ParseFullMethod(fullMethod)
|
name, methodAttrs := internal.ParseFullMethod(fullMethod)
|
||||||
peerAttrs := peerAttr(peerAddress)
|
srvAttrs := serverAddrAttrs(sererAddr)
|
||||||
|
|
||||||
attrs := make([]attribute.KeyValue, 0, 1+len(methodAttrs)+len(peerAttrs))
|
attrs := make([]attribute.KeyValue, 0, 1+len(methodAttrs)+len(srvAttrs))
|
||||||
attrs = append(attrs, RPCSystemGRPC)
|
attrs = append(attrs, semconv.RPCSystemGRPC)
|
||||||
attrs = append(attrs, methodAttrs...)
|
attrs = append(attrs, methodAttrs...)
|
||||||
metricAttrs := attrs[:1+len(methodAttrs)]
|
attrs = append(attrs, srvAttrs...)
|
||||||
attrs = append(attrs, peerAttrs...)
|
return name, attrs
|
||||||
return name, attrs, metricAttrs
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// peerAttr returns attributes about the peer address.
|
// serverAddrAttrs returns the server address attributes for the hostport.
|
||||||
func peerAttr(addr string) []attribute.KeyValue {
|
func serverAddrAttrs(hostport string) []attribute.KeyValue {
|
||||||
host, p, err := net.SplitHostPort(addr)
|
h, pStr, err := net.SplitHostPort(hostport)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
// The server.address attribute is required.
|
||||||
|
return []attribute.KeyValue{semconv.ServerAddress(hostport)}
|
||||||
}
|
}
|
||||||
|
p, err := strconv.Atoi(pStr)
|
||||||
if host == "" {
|
|
||||||
host = "127.0.0.1"
|
|
||||||
}
|
|
||||||
port, err := strconv.Atoi(p)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return []attribute.KeyValue{semconv.ServerAddress(h)}
|
||||||
}
|
}
|
||||||
|
return []attribute.KeyValue{
|
||||||
var attr []attribute.KeyValue
|
semconv.ServerAddress(h),
|
||||||
if ip := net.ParseIP(host); ip != nil {
|
semconv.ServerPort(p),
|
||||||
attr = []attribute.KeyValue{
|
|
||||||
semconv.NetSockPeerAddr(host),
|
|
||||||
semconv.NetSockPeerPort(port),
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
attr = []attribute.KeyValue{
|
|
||||||
semconv.NetPeerName(host),
|
|
||||||
semconv.NetPeerPort(port),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return attr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// peerFromCtx returns a peer address from a context, if one exists.
|
// peerFromCtx returns a peer address from a context, if one exists.
|
||||||
@@ -503,7 +344,7 @@ func peerFromCtx(ctx context.Context) string {
|
|||||||
|
|
||||||
// statusCodeAttr returns status code attribute based on given gRPC code.
|
// statusCodeAttr returns status code attribute based on given gRPC code.
|
||||||
func statusCodeAttr(c grpc_codes.Code) attribute.KeyValue {
|
func statusCodeAttr(c grpc_codes.Code) attribute.KeyValue {
|
||||||
return GRPCStatusCodeKey.Int64(int64(c))
|
return semconv.RPCGRPCStatusCodeKey.Int64(int64(c))
|
||||||
}
|
}
|
||||||
|
|
||||||
// serverStatus returns a span status code and message for a given gRPC
|
// serverStatus returns a span status code and message for a given gRPC
|
||||||
|
|||||||
vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
Generated
Vendored
+2
-1
@@ -1,13 +1,14 @@
|
|||||||
// Copyright The OpenTelemetry Authors
|
// Copyright The OpenTelemetry Authors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
// Package internal provides internal functionality for the otelgrpc package.
|
||||||
package internal // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
|
package internal // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
|
semconv "go.opentelemetry.io/otel/semconv/v1.30.0"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ParseFullMethod returns a span name following the OpenTelemetry semantic
|
// ParseFullMethod returns a span name following the OpenTelemetry semantic
|
||||||
|
|||||||
Generated
Vendored
+2
-2
@@ -45,7 +45,7 @@ func (s *metadataSupplier) Keys() []string {
|
|||||||
// requests.
|
// requests.
|
||||||
// Deprecated: Unnecessary public func.
|
// Deprecated: Unnecessary public func.
|
||||||
func Inject(ctx context.Context, md *metadata.MD, opts ...Option) {
|
func Inject(ctx context.Context, md *metadata.MD, opts ...Option) {
|
||||||
c := newConfig(opts, "")
|
c := newConfig(opts)
|
||||||
c.Propagators.Inject(ctx, &metadataSupplier{
|
c.Propagators.Inject(ctx, &metadataSupplier{
|
||||||
metadata: md,
|
metadata: md,
|
||||||
})
|
})
|
||||||
@@ -67,7 +67,7 @@ func inject(ctx context.Context, propagators propagation.TextMapPropagator) cont
|
|||||||
// This function is meant to be used on incoming requests.
|
// This function is meant to be used on incoming requests.
|
||||||
// Deprecated: Unnecessary public func.
|
// Deprecated: Unnecessary public func.
|
||||||
func Extract(ctx context.Context, md *metadata.MD, opts ...Option) (baggage.Baggage, trace.SpanContext) {
|
func Extract(ctx context.Context, md *metadata.MD, opts ...Option) (baggage.Baggage, trace.SpanContext) {
|
||||||
c := newConfig(opts, "")
|
c := newConfig(opts)
|
||||||
ctx = c.Propagators.Extract(ctx, &metadataSupplier{
|
ctx = c.Propagators.Extract(ctx, &metadataSupplier{
|
||||||
metadata: md,
|
metadata: md,
|
||||||
})
|
})
|
||||||
|
|||||||
Generated
Vendored
-41
@@ -1,41 +0,0 @@
|
|||||||
// Copyright The OpenTelemetry Authors
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go.opentelemetry.io/otel/attribute"
|
|
||||||
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Semantic conventions for attribute keys for gRPC.
|
|
||||||
const (
|
|
||||||
// Name of message transmitted or received.
|
|
||||||
RPCNameKey = attribute.Key("name")
|
|
||||||
|
|
||||||
// Type of message transmitted or received.
|
|
||||||
RPCMessageTypeKey = attribute.Key("message.type")
|
|
||||||
|
|
||||||
// Identifier of message transmitted or received.
|
|
||||||
RPCMessageIDKey = attribute.Key("message.id")
|
|
||||||
|
|
||||||
// The compressed size of the message transmitted or received in bytes.
|
|
||||||
RPCMessageCompressedSizeKey = attribute.Key("message.compressed_size")
|
|
||||||
|
|
||||||
// The uncompressed size of the message transmitted or received in
|
|
||||||
// bytes.
|
|
||||||
RPCMessageUncompressedSizeKey = attribute.Key("message.uncompressed_size")
|
|
||||||
)
|
|
||||||
|
|
||||||
// Semantic conventions for common RPC attributes.
|
|
||||||
var (
|
|
||||||
// Semantic convention for gRPC as the remoting system.
|
|
||||||
RPCSystemGRPC = semconv.RPCSystemGRPC
|
|
||||||
|
|
||||||
// Semantic convention for a message named message.
|
|
||||||
RPCNameMessage = RPCNameKey.String("message")
|
|
||||||
|
|
||||||
// Semantic conventions for RPC message types.
|
|
||||||
RPCMessageTypeSent = RPCMessageTypeKey.String("SENT")
|
|
||||||
RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED")
|
|
||||||
)
|
|
||||||
Generated
Vendored
+230
-58
@@ -13,10 +13,12 @@ import (
|
|||||||
"google.golang.org/grpc/stats"
|
"google.golang.org/grpc/stats"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
|
"go.opentelemetry.io/otel"
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
"go.opentelemetry.io/otel/codes"
|
"go.opentelemetry.io/otel/codes"
|
||||||
"go.opentelemetry.io/otel/metric"
|
"go.opentelemetry.io/otel/metric"
|
||||||
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
|
"go.opentelemetry.io/otel/metric/noop"
|
||||||
|
semconv "go.opentelemetry.io/otel/semconv/v1.30.0"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
|
|
||||||
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
|
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal"
|
||||||
@@ -33,12 +35,91 @@ type gRPCContext struct {
|
|||||||
|
|
||||||
type serverHandler struct {
|
type serverHandler struct {
|
||||||
*config
|
*config
|
||||||
|
|
||||||
|
tracer trace.Tracer
|
||||||
|
|
||||||
|
duration metric.Float64Histogram
|
||||||
|
inSize metric.Int64Histogram
|
||||||
|
outSize metric.Int64Histogram
|
||||||
|
inMsg metric.Int64Histogram
|
||||||
|
outMsg metric.Int64Histogram
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewServerHandler creates a stats.Handler for a gRPC server.
|
// NewServerHandler creates a stats.Handler for a gRPC server.
|
||||||
func NewServerHandler(opts ...Option) stats.Handler {
|
func NewServerHandler(opts ...Option) stats.Handler {
|
||||||
h := &serverHandler{
|
c := newConfig(opts)
|
||||||
config: newConfig(opts, "server"),
|
h := &serverHandler{config: c}
|
||||||
|
|
||||||
|
h.tracer = c.TracerProvider.Tracer(
|
||||||
|
ScopeName,
|
||||||
|
trace.WithInstrumentationVersion(Version()),
|
||||||
|
)
|
||||||
|
|
||||||
|
meter := c.MeterProvider.Meter(
|
||||||
|
ScopeName,
|
||||||
|
metric.WithInstrumentationVersion(Version()),
|
||||||
|
metric.WithSchemaURL(semconv.SchemaURL),
|
||||||
|
)
|
||||||
|
|
||||||
|
var err error
|
||||||
|
h.duration, err = meter.Float64Histogram(
|
||||||
|
semconv.RPCServerDurationName,
|
||||||
|
metric.WithDescription(semconv.RPCServerDurationDescription),
|
||||||
|
metric.WithUnit(semconv.RPCServerDurationUnit),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
otel.Handle(err)
|
||||||
|
if h.duration == nil {
|
||||||
|
h.duration = noop.Float64Histogram{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h.inSize, err = meter.Int64Histogram(
|
||||||
|
semconv.RPCServerRequestSizeName,
|
||||||
|
metric.WithDescription(semconv.RPCServerRequestSizeDescription),
|
||||||
|
metric.WithUnit(semconv.RPCServerRequestSizeUnit),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
otel.Handle(err)
|
||||||
|
if h.inSize == nil {
|
||||||
|
h.inSize = noop.Int64Histogram{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h.outSize, err = meter.Int64Histogram(
|
||||||
|
semconv.RPCServerResponseSizeName,
|
||||||
|
metric.WithDescription(semconv.RPCServerResponseSizeDescription),
|
||||||
|
metric.WithUnit(semconv.RPCServerResponseSizeUnit),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
otel.Handle(err)
|
||||||
|
if h.outSize == nil {
|
||||||
|
h.outSize = noop.Int64Histogram{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h.inMsg, err = meter.Int64Histogram(
|
||||||
|
semconv.RPCServerRequestsPerRPCName,
|
||||||
|
metric.WithDescription(semconv.RPCServerRequestsPerRPCDescription),
|
||||||
|
metric.WithUnit(semconv.RPCServerRequestsPerRPCUnit),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
otel.Handle(err)
|
||||||
|
if h.inMsg == nil {
|
||||||
|
h.inMsg = noop.Int64Histogram{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h.outMsg, err = meter.Int64Histogram(
|
||||||
|
semconv.RPCServerResponsesPerRPCName,
|
||||||
|
metric.WithDescription(semconv.RPCServerResponsesPerRPCDescription),
|
||||||
|
metric.WithUnit(semconv.RPCServerResponsesPerRPCUnit),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
otel.Handle(err)
|
||||||
|
if h.outMsg == nil {
|
||||||
|
h.outMsg = noop.Int64Histogram{}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return h
|
return h
|
||||||
@@ -55,14 +136,14 @@ func (h *serverHandler) HandleConn(ctx context.Context, info stats.ConnStats) {
|
|||||||
|
|
||||||
// TagRPC can attach some information to the given context.
|
// TagRPC can attach some information to the given context.
|
||||||
func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {
|
func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {
|
||||||
ctx = extract(ctx, h.config.Propagators)
|
ctx = extract(ctx, h.Propagators)
|
||||||
|
|
||||||
name, attrs := internal.ParseFullMethod(info.FullMethodName)
|
name, attrs := internal.ParseFullMethod(info.FullMethodName)
|
||||||
attrs = append(attrs, RPCSystemGRPC)
|
attrs = append(attrs, semconv.RPCSystemGRPC)
|
||||||
|
|
||||||
record := true
|
record := true
|
||||||
if h.config.Filter != nil {
|
if h.Filter != nil {
|
||||||
record = h.config.Filter(info)
|
record = h.Filter(info)
|
||||||
}
|
}
|
||||||
|
|
||||||
if record {
|
if record {
|
||||||
@@ -70,12 +151,12 @@ func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont
|
|||||||
trace.ContextWithRemoteSpanContext(ctx, trace.SpanContextFromContext(ctx)),
|
trace.ContextWithRemoteSpanContext(ctx, trace.SpanContextFromContext(ctx)),
|
||||||
name,
|
name,
|
||||||
trace.WithSpanKind(trace.SpanKindServer),
|
trace.WithSpanKind(trace.SpanKindServer),
|
||||||
trace.WithAttributes(append(attrs, h.config.SpanAttributes...)...),
|
trace.WithAttributes(append(attrs, h.SpanAttributes...)...),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
gctx := gRPCContext{
|
gctx := gRPCContext{
|
||||||
metricAttrs: append(attrs, h.config.MetricAttributes...),
|
metricAttrs: append(attrs, h.MetricAttributes...),
|
||||||
record: record,
|
record: record,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,18 +165,96 @@ func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont
|
|||||||
|
|
||||||
// HandleRPC processes the RPC stats.
|
// HandleRPC processes the RPC stats.
|
||||||
func (h *serverHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
|
func (h *serverHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
|
||||||
isServer := true
|
h.handleRPC(ctx, rs, h.duration, h.inSize, h.outSize, h.inMsg, h.outMsg, serverStatus)
|
||||||
h.handleRPC(ctx, rs, isServer)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type clientHandler struct {
|
type clientHandler struct {
|
||||||
*config
|
*config
|
||||||
|
|
||||||
|
tracer trace.Tracer
|
||||||
|
|
||||||
|
duration metric.Float64Histogram
|
||||||
|
inSize metric.Int64Histogram
|
||||||
|
outSize metric.Int64Histogram
|
||||||
|
inMsg metric.Int64Histogram
|
||||||
|
outMsg metric.Int64Histogram
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewClientHandler creates a stats.Handler for a gRPC client.
|
// NewClientHandler creates a stats.Handler for a gRPC client.
|
||||||
func NewClientHandler(opts ...Option) stats.Handler {
|
func NewClientHandler(opts ...Option) stats.Handler {
|
||||||
h := &clientHandler{
|
c := newConfig(opts)
|
||||||
config: newConfig(opts, "client"),
|
h := &clientHandler{config: c}
|
||||||
|
|
||||||
|
h.tracer = c.TracerProvider.Tracer(
|
||||||
|
ScopeName,
|
||||||
|
trace.WithInstrumentationVersion(Version()),
|
||||||
|
)
|
||||||
|
|
||||||
|
meter := c.MeterProvider.Meter(
|
||||||
|
ScopeName,
|
||||||
|
metric.WithInstrumentationVersion(Version()),
|
||||||
|
metric.WithSchemaURL(semconv.SchemaURL),
|
||||||
|
)
|
||||||
|
|
||||||
|
var err error
|
||||||
|
h.duration, err = meter.Float64Histogram(
|
||||||
|
semconv.RPCClientDurationName,
|
||||||
|
metric.WithDescription(semconv.RPCClientDurationDescription),
|
||||||
|
metric.WithUnit(semconv.RPCClientDurationUnit),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
otel.Handle(err)
|
||||||
|
if h.duration == nil {
|
||||||
|
h.duration = noop.Float64Histogram{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h.outSize, err = meter.Int64Histogram(
|
||||||
|
semconv.RPCClientRequestSizeName,
|
||||||
|
metric.WithDescription(semconv.RPCClientRequestSizeDescription),
|
||||||
|
metric.WithUnit(semconv.RPCClientRequestSizeUnit),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
otel.Handle(err)
|
||||||
|
if h.outSize == nil {
|
||||||
|
h.outSize = noop.Int64Histogram{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h.inSize, err = meter.Int64Histogram(
|
||||||
|
semconv.RPCClientResponseSizeName,
|
||||||
|
metric.WithDescription(semconv.RPCClientResponseSizeDescription),
|
||||||
|
metric.WithUnit(semconv.RPCClientResponseSizeUnit),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
otel.Handle(err)
|
||||||
|
if h.inSize == nil {
|
||||||
|
h.inSize = noop.Int64Histogram{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h.outMsg, err = meter.Int64Histogram(
|
||||||
|
semconv.RPCClientRequestsPerRPCName,
|
||||||
|
metric.WithDescription(semconv.RPCClientRequestsPerRPCDescription),
|
||||||
|
metric.WithUnit(semconv.RPCClientRequestsPerRPCUnit),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
otel.Handle(err)
|
||||||
|
if h.outMsg == nil {
|
||||||
|
h.outMsg = noop.Int64Histogram{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h.inMsg, err = meter.Int64Histogram(
|
||||||
|
semconv.RPCClientResponsesPerRPCName,
|
||||||
|
metric.WithDescription(semconv.RPCClientResponsesPerRPCDescription),
|
||||||
|
metric.WithUnit(semconv.RPCClientResponsesPerRPCUnit),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
otel.Handle(err)
|
||||||
|
if h.inMsg == nil {
|
||||||
|
h.inMsg = noop.Int64Histogram{}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return h
|
return h
|
||||||
@@ -104,11 +263,11 @@ func NewClientHandler(opts ...Option) stats.Handler {
|
|||||||
// TagRPC can attach some information to the given context.
|
// TagRPC can attach some information to the given context.
|
||||||
func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {
|
func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {
|
||||||
name, attrs := internal.ParseFullMethod(info.FullMethodName)
|
name, attrs := internal.ParseFullMethod(info.FullMethodName)
|
||||||
attrs = append(attrs, RPCSystemGRPC)
|
attrs = append(attrs, semconv.RPCSystemGRPC)
|
||||||
|
|
||||||
record := true
|
record := true
|
||||||
if h.config.Filter != nil {
|
if h.Filter != nil {
|
||||||
record = h.config.Filter(info)
|
record = h.Filter(info)
|
||||||
}
|
}
|
||||||
|
|
||||||
if record {
|
if record {
|
||||||
@@ -116,22 +275,26 @@ func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont
|
|||||||
ctx,
|
ctx,
|
||||||
name,
|
name,
|
||||||
trace.WithSpanKind(trace.SpanKindClient),
|
trace.WithSpanKind(trace.SpanKindClient),
|
||||||
trace.WithAttributes(append(attrs, h.config.SpanAttributes...)...),
|
trace.WithAttributes(append(attrs, h.SpanAttributes...)...),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
gctx := gRPCContext{
|
gctx := gRPCContext{
|
||||||
metricAttrs: append(attrs, h.config.MetricAttributes...),
|
metricAttrs: append(attrs, h.MetricAttributes...),
|
||||||
record: record,
|
record: record,
|
||||||
}
|
}
|
||||||
|
|
||||||
return inject(context.WithValue(ctx, gRPCContextKey{}, &gctx), h.config.Propagators)
|
return inject(context.WithValue(ctx, gRPCContextKey{}, &gctx), h.Propagators)
|
||||||
}
|
}
|
||||||
|
|
||||||
// HandleRPC processes the RPC stats.
|
// HandleRPC processes the RPC stats.
|
||||||
func (h *clientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
|
func (h *clientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
|
||||||
isServer := false
|
h.handleRPC(
|
||||||
h.handleRPC(ctx, rs, isServer)
|
ctx, rs, h.duration, h.inSize, h.outSize, h.inMsg, h.outMsg,
|
||||||
|
func(s *status.Status) (codes.Code, string) {
|
||||||
|
return codes.Error, s.Message()
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TagConn can attach some information to the given context.
|
// TagConn can attach some information to the given context.
|
||||||
@@ -144,77 +307,86 @@ func (h *clientHandler) HandleConn(context.Context, stats.ConnStats) {
|
|||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *config) handleRPC(ctx context.Context, rs stats.RPCStats, isServer bool) { // nolint: revive // isServer is not a control flag.
|
func (c *config) handleRPC(
|
||||||
span := trace.SpanFromContext(ctx)
|
ctx context.Context,
|
||||||
var metricAttrs []attribute.KeyValue
|
rs stats.RPCStats,
|
||||||
var messageId int64
|
duration metric.Float64Histogram,
|
||||||
|
inSize, outSize, inMsg, outMsg metric.Int64Histogram,
|
||||||
|
recordStatus func(*status.Status) (codes.Code, string),
|
||||||
|
) {
|
||||||
gctx, _ := ctx.Value(gRPCContextKey{}).(*gRPCContext)
|
gctx, _ := ctx.Value(gRPCContextKey{}).(*gRPCContext)
|
||||||
if gctx != nil {
|
if gctx != nil && !gctx.record {
|
||||||
if !gctx.record {
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
metricAttrs = make([]attribute.KeyValue, 0, len(gctx.metricAttrs)+1)
|
|
||||||
metricAttrs = append(metricAttrs, gctx.metricAttrs...)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span := trace.SpanFromContext(ctx)
|
||||||
|
var messageId int64
|
||||||
|
|
||||||
switch rs := rs.(type) {
|
switch rs := rs.(type) {
|
||||||
case *stats.Begin:
|
case *stats.Begin:
|
||||||
case *stats.InPayload:
|
case *stats.InPayload:
|
||||||
if gctx != nil {
|
if gctx != nil {
|
||||||
messageId = atomic.AddInt64(&gctx.inMessages, 1)
|
messageId = atomic.AddInt64(&gctx.inMessages, 1)
|
||||||
c.rpcInBytes.Record(ctx, int64(rs.Length), metric.WithAttributeSet(attribute.NewSet(metricAttrs...)))
|
inSize.Record(ctx, int64(rs.Length), metric.WithAttributes(gctx.metricAttrs...))
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.ReceivedEvent {
|
if c.ReceivedEvent && span.IsRecording() {
|
||||||
span.AddEvent("message",
|
span.AddEvent("message",
|
||||||
trace.WithAttributes(
|
trace.WithAttributes(
|
||||||
semconv.MessageTypeReceived,
|
semconv.RPCMessageTypeReceived,
|
||||||
semconv.MessageIDKey.Int64(messageId),
|
semconv.RPCMessageIDKey.Int64(messageId),
|
||||||
semconv.MessageCompressedSizeKey.Int(rs.CompressedLength),
|
semconv.RPCMessageCompressedSizeKey.Int(rs.CompressedLength),
|
||||||
semconv.MessageUncompressedSizeKey.Int(rs.Length),
|
semconv.RPCMessageUncompressedSizeKey.Int(rs.Length),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
case *stats.OutPayload:
|
case *stats.OutPayload:
|
||||||
if gctx != nil {
|
if gctx != nil {
|
||||||
messageId = atomic.AddInt64(&gctx.outMessages, 1)
|
messageId = atomic.AddInt64(&gctx.outMessages, 1)
|
||||||
c.rpcOutBytes.Record(ctx, int64(rs.Length), metric.WithAttributeSet(attribute.NewSet(metricAttrs...)))
|
outSize.Record(ctx, int64(rs.Length), metric.WithAttributes(gctx.metricAttrs...))
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.SentEvent {
|
if c.SentEvent && span.IsRecording() {
|
||||||
span.AddEvent("message",
|
span.AddEvent("message",
|
||||||
trace.WithAttributes(
|
trace.WithAttributes(
|
||||||
semconv.MessageTypeSent,
|
semconv.RPCMessageTypeSent,
|
||||||
semconv.MessageIDKey.Int64(messageId),
|
semconv.RPCMessageIDKey.Int64(messageId),
|
||||||
semconv.MessageCompressedSizeKey.Int(rs.CompressedLength),
|
semconv.RPCMessageCompressedSizeKey.Int(rs.CompressedLength),
|
||||||
semconv.MessageUncompressedSizeKey.Int(rs.Length),
|
semconv.RPCMessageUncompressedSizeKey.Int(rs.Length),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
case *stats.OutTrailer:
|
case *stats.OutTrailer:
|
||||||
case *stats.OutHeader:
|
case *stats.OutHeader:
|
||||||
if p, ok := peer.FromContext(ctx); ok {
|
if span.IsRecording() {
|
||||||
span.SetAttributes(peerAttr(p.Addr.String())...)
|
if p, ok := peer.FromContext(ctx); ok {
|
||||||
|
span.SetAttributes(serverAddrAttrs(p.Addr.String())...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case *stats.End:
|
case *stats.End:
|
||||||
var rpcStatusAttr attribute.KeyValue
|
var rpcStatusAttr attribute.KeyValue
|
||||||
|
|
||||||
|
var s *status.Status
|
||||||
if rs.Error != nil {
|
if rs.Error != nil {
|
||||||
s, _ := status.FromError(rs.Error)
|
s, _ = status.FromError(rs.Error)
|
||||||
if isServer {
|
|
||||||
statusCode, msg := serverStatus(s)
|
|
||||||
span.SetStatus(statusCode, msg)
|
|
||||||
} else {
|
|
||||||
span.SetStatus(codes.Error, s.Message())
|
|
||||||
}
|
|
||||||
rpcStatusAttr = semconv.RPCGRPCStatusCodeKey.Int(int(s.Code()))
|
rpcStatusAttr = semconv.RPCGRPCStatusCodeKey.Int(int(s.Code()))
|
||||||
} else {
|
} else {
|
||||||
rpcStatusAttr = semconv.RPCGRPCStatusCodeKey.Int(int(grpc_codes.OK))
|
rpcStatusAttr = semconv.RPCGRPCStatusCodeKey.Int(int(grpc_codes.OK))
|
||||||
}
|
}
|
||||||
span.SetAttributes(rpcStatusAttr)
|
if span.IsRecording() {
|
||||||
span.End()
|
if s != nil {
|
||||||
|
c, m := recordStatus(s)
|
||||||
|
span.SetStatus(c, m)
|
||||||
|
}
|
||||||
|
span.SetAttributes(rpcStatusAttr)
|
||||||
|
span.End()
|
||||||
|
}
|
||||||
|
|
||||||
|
var metricAttrs []attribute.KeyValue
|
||||||
|
if gctx != nil {
|
||||||
|
metricAttrs = make([]attribute.KeyValue, 0, len(gctx.metricAttrs)+1)
|
||||||
|
metricAttrs = append(metricAttrs, gctx.metricAttrs...)
|
||||||
|
}
|
||||||
metricAttrs = append(metricAttrs, rpcStatusAttr)
|
metricAttrs = append(metricAttrs, rpcStatusAttr)
|
||||||
// Allocate vararg slice once.
|
// Allocate vararg slice once.
|
||||||
recordOpts := []metric.RecordOption{metric.WithAttributeSet(attribute.NewSet(metricAttrs...))}
|
recordOpts := []metric.RecordOption{metric.WithAttributeSet(attribute.NewSet(metricAttrs...))}
|
||||||
@@ -223,10 +395,10 @@ func (c *config) handleRPC(ctx context.Context, rs stats.RPCStats, isServer bool
|
|||||||
// Measure right before calling Record() to capture as much elapsed time as possible.
|
// Measure right before calling Record() to capture as much elapsed time as possible.
|
||||||
elapsedTime := float64(rs.EndTime.Sub(rs.BeginTime)) / float64(time.Millisecond)
|
elapsedTime := float64(rs.EndTime.Sub(rs.BeginTime)) / float64(time.Millisecond)
|
||||||
|
|
||||||
c.rpcDuration.Record(ctx, elapsedTime, recordOpts...)
|
duration.Record(ctx, elapsedTime, recordOpts...)
|
||||||
if gctx != nil {
|
if gctx != nil {
|
||||||
c.rpcInMessages.Record(ctx, atomic.LoadInt64(&gctx.inMessages), recordOpts...)
|
inMsg.Record(ctx, atomic.LoadInt64(&gctx.inMessages), recordOpts...)
|
||||||
c.rpcOutMessages.Record(ctx, atomic.LoadInt64(&gctx.outMessages), recordOpts...)
|
outMsg.Record(ctx, atomic.LoadInt64(&gctx.outMessages), recordOpts...)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return
|
return
|
||||||
|
|||||||
Generated
Vendored
+1
-8
@@ -5,13 +5,6 @@ package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.g
|
|||||||
|
|
||||||
// Version is the current release version of the gRPC instrumentation.
|
// Version is the current release version of the gRPC instrumentation.
|
||||||
func Version() string {
|
func Version() string {
|
||||||
return "0.60.0"
|
return "0.61.0"
|
||||||
// This string is updated by the pre_release.sh script during release
|
// This string is updated by the pre_release.sh script during release
|
||||||
}
|
}
|
||||||
|
|
||||||
// SemVersion is the semantic version to be supplied to tracer/meter creation.
|
|
||||||
//
|
|
||||||
// Deprecated: Use [Version] instead.
|
|
||||||
func SemVersion() string {
|
|
||||||
return Version()
|
|
||||||
}
|
|
||||||
|
|||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
# Semconv v1.17.0
|
|
||||||
|
|
||||||
[](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.17.0)
|
|
||||||
-188
@@ -1,188 +0,0 @@
|
|||||||
// Copyright The OpenTelemetry Authors
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
// Code generated from semantic convention specification. DO NOT EDIT.
|
|
||||||
|
|
||||||
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
|
|
||||||
|
|
||||||
import "go.opentelemetry.io/otel/attribute"
|
|
||||||
|
|
||||||
// This semantic convention defines the attributes used to represent a feature
|
|
||||||
// flag evaluation as an event.
|
|
||||||
const (
|
|
||||||
// FeatureFlagKeyKey is the attribute Key conforming to the
|
|
||||||
// "feature_flag.key" semantic conventions. It represents the unique
|
|
||||||
// identifier of the feature flag.
|
|
||||||
//
|
|
||||||
// Type: string
|
|
||||||
// RequirementLevel: Required
|
|
||||||
// Stability: stable
|
|
||||||
// Examples: 'logo-color'
|
|
||||||
FeatureFlagKeyKey = attribute.Key("feature_flag.key")
|
|
||||||
|
|
||||||
// FeatureFlagProviderNameKey is the attribute Key conforming to the
|
|
||||||
// "feature_flag.provider_name" semantic conventions. It represents the
|
|
||||||
// name of the service provider that performs the flag evaluation.
|
|
||||||
//
|
|
||||||
// Type: string
|
|
||||||
// RequirementLevel: Recommended
|
|
||||||
// Stability: stable
|
|
||||||
// Examples: 'Flag Manager'
|
|
||||||
FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name")
|
|
||||||
|
|
||||||
// FeatureFlagVariantKey is the attribute Key conforming to the
|
|
||||||
// "feature_flag.variant" semantic conventions. It represents the sHOULD be
|
|
||||||
// a semantic identifier for a value. If one is unavailable, a stringified
|
|
||||||
// version of the value can be used.
|
|
||||||
//
|
|
||||||
// Type: string
|
|
||||||
// RequirementLevel: Recommended
|
|
||||||
// Stability: stable
|
|
||||||
// Examples: 'red', 'true', 'on'
|
|
||||||
// Note: A semantic identifier, commonly referred to as a variant, provides
|
|
||||||
// a means
|
|
||||||
// for referring to a value without including the value itself. This can
|
|
||||||
// provide additional context for understanding the meaning behind a value.
|
|
||||||
// For example, the variant `red` maybe be used for the value `#c05543`.
|
|
||||||
//
|
|
||||||
// A stringified version of the value can be used in situations where a
|
|
||||||
// semantic identifier is unavailable. String representation of the value
|
|
||||||
// should be determined by the implementer.
|
|
||||||
FeatureFlagVariantKey = attribute.Key("feature_flag.variant")
|
|
||||||
)
|
|
||||||
|
|
||||||
// FeatureFlagKey returns an attribute KeyValue conforming to the
|
|
||||||
// "feature_flag.key" semantic conventions. It represents the unique identifier
|
|
||||||
// of the feature flag.
|
|
||||||
func FeatureFlagKey(val string) attribute.KeyValue {
|
|
||||||
return FeatureFlagKeyKey.String(val)
|
|
||||||
}
|
|
||||||
|
|
||||||
// FeatureFlagProviderName returns an attribute KeyValue conforming to the
|
|
||||||
// "feature_flag.provider_name" semantic conventions. It represents the name of
|
|
||||||
// the service provider that performs the flag evaluation.
|
|
||||||
func FeatureFlagProviderName(val string) attribute.KeyValue {
|
|
||||||
return FeatureFlagProviderNameKey.String(val)
|
|
||||||
}
|
|
||||||
|
|
||||||
// FeatureFlagVariant returns an attribute KeyValue conforming to the
|
|
||||||
// "feature_flag.variant" semantic conventions. It represents the sHOULD be a
|
|
||||||
// semantic identifier for a value. If one is unavailable, a stringified
|
|
||||||
// version of the value can be used.
|
|
||||||
func FeatureFlagVariant(val string) attribute.KeyValue {
|
|
||||||
return FeatureFlagVariantKey.String(val)
|
|
||||||
}
|
|
||||||
|
|
||||||
// RPC received/sent message.
|
|
||||||
const (
|
|
||||||
// MessageTypeKey is the attribute Key conforming to the "message.type"
|
|
||||||
// semantic conventions. It represents the whether this is a received or
|
|
||||||
// sent message.
|
|
||||||
//
|
|
||||||
// Type: Enum
|
|
||||||
// RequirementLevel: Optional
|
|
||||||
// Stability: stable
|
|
||||||
MessageTypeKey = attribute.Key("message.type")
|
|
||||||
|
|
||||||
// MessageIDKey is the attribute Key conforming to the "message.id"
|
|
||||||
// semantic conventions. It represents the mUST be calculated as two
|
|
||||||
// different counters starting from `1` one for sent messages and one for
|
|
||||||
// received message.
|
|
||||||
//
|
|
||||||
// Type: int
|
|
||||||
// RequirementLevel: Optional
|
|
||||||
// Stability: stable
|
|
||||||
// Note: This way we guarantee that the values will be consistent between
|
|
||||||
// different implementations.
|
|
||||||
MessageIDKey = attribute.Key("message.id")
|
|
||||||
|
|
||||||
// MessageCompressedSizeKey is the attribute Key conforming to the
|
|
||||||
// "message.compressed_size" semantic conventions. It represents the
|
|
||||||
// compressed size of the message in bytes.
|
|
||||||
//
|
|
||||||
// Type: int
|
|
||||||
// RequirementLevel: Optional
|
|
||||||
// Stability: stable
|
|
||||||
MessageCompressedSizeKey = attribute.Key("message.compressed_size")
|
|
||||||
|
|
||||||
// MessageUncompressedSizeKey is the attribute Key conforming to the
|
|
||||||
// "message.uncompressed_size" semantic conventions. It represents the
|
|
||||||
// uncompressed size of the message in bytes.
|
|
||||||
//
|
|
||||||
// Type: int
|
|
||||||
// RequirementLevel: Optional
|
|
||||||
// Stability: stable
|
|
||||||
MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size")
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
// sent
|
|
||||||
MessageTypeSent = MessageTypeKey.String("SENT")
|
|
||||||
// received
|
|
||||||
MessageTypeReceived = MessageTypeKey.String("RECEIVED")
|
|
||||||
)
|
|
||||||
|
|
||||||
// MessageID returns an attribute KeyValue conforming to the "message.id"
|
|
||||||
// semantic conventions. It represents the mUST be calculated as two different
|
|
||||||
// counters starting from `1` one for sent messages and one for received
|
|
||||||
// message.
|
|
||||||
func MessageID(val int) attribute.KeyValue {
|
|
||||||
return MessageIDKey.Int(val)
|
|
||||||
}
|
|
||||||
|
|
||||||
// MessageCompressedSize returns an attribute KeyValue conforming to the
|
|
||||||
// "message.compressed_size" semantic conventions. It represents the compressed
|
|
||||||
// size of the message in bytes.
|
|
||||||
func MessageCompressedSize(val int) attribute.KeyValue {
|
|
||||||
return MessageCompressedSizeKey.Int(val)
|
|
||||||
}
|
|
||||||
|
|
||||||
// MessageUncompressedSize returns an attribute KeyValue conforming to the
|
|
||||||
// "message.uncompressed_size" semantic conventions. It represents the
|
|
||||||
// uncompressed size of the message in bytes.
|
|
||||||
func MessageUncompressedSize(val int) attribute.KeyValue {
|
|
||||||
return MessageUncompressedSizeKey.Int(val)
|
|
||||||
}
|
|
||||||
|
|
||||||
// The attributes used to report a single exception associated with a span.
|
|
||||||
const (
|
|
||||||
// ExceptionEscapedKey is the attribute Key conforming to the
|
|
||||||
// "exception.escaped" semantic conventions. It represents the sHOULD be
|
|
||||||
// set to true if the exception event is recorded at a point where it is
|
|
||||||
// known that the exception is escaping the scope of the span.
|
|
||||||
//
|
|
||||||
// Type: boolean
|
|
||||||
// RequirementLevel: Optional
|
|
||||||
// Stability: stable
|
|
||||||
// Note: An exception is considered to have escaped (or left) the scope of
|
|
||||||
// a span,
|
|
||||||
// if that span is ended while the exception is still logically "in
|
|
||||||
// flight".
|
|
||||||
// This may be actually "in flight" in some languages (e.g. if the
|
|
||||||
// exception
|
|
||||||
// is passed to a Context manager's `__exit__` method in Python) but will
|
|
||||||
// usually be caught at the point of recording the exception in most
|
|
||||||
// languages.
|
|
||||||
//
|
|
||||||
// It is usually not possible to determine at the point where an exception
|
|
||||||
// is thrown
|
|
||||||
// whether it will escape the scope of a span.
|
|
||||||
// However, it is trivial to know that an exception
|
|
||||||
// will escape, if one checks for an active exception just before ending
|
|
||||||
// the span,
|
|
||||||
// as done in the [example above](#recording-an-exception).
|
|
||||||
//
|
|
||||||
// It follows that an exception may still escape the scope of the span
|
|
||||||
// even if the `exception.escaped` attribute was not set or set to false,
|
|
||||||
// since the event might have been recorded at a time where it was not
|
|
||||||
// clear whether the exception will escape.
|
|
||||||
ExceptionEscapedKey = attribute.Key("exception.escaped")
|
|
||||||
)
|
|
||||||
|
|
||||||
// ExceptionEscaped returns an attribute KeyValue conforming to the
|
|
||||||
// "exception.escaped" semantic conventions. It represents the sHOULD be set to
|
|
||||||
// true if the exception event is recorded at a point where it is known that
|
|
||||||
// the exception is escaping the scope of the span.
|
|
||||||
func ExceptionEscaped(val bool) attribute.KeyValue {
|
|
||||||
return ExceptionEscapedKey.Bool(val)
|
|
||||||
}
|
|
||||||
-10
@@ -1,10 +0,0 @@
|
|||||||
// Copyright The OpenTelemetry Authors
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
|
|
||||||
|
|
||||||
// HTTP scheme attributes.
|
|
||||||
var (
|
|
||||||
HTTPSchemeHTTP = HTTPSchemeKey.String("http")
|
|
||||||
HTTPSchemeHTTPS = HTTPSchemeKey.String("https")
|
|
||||||
)
|
|
||||||
-1999
File diff suppressed because it is too large
Load Diff
-3364
File diff suppressed because it is too large
Load Diff
+155
@@ -0,0 +1,155 @@
|
|||||||
|
# Semantic Convention Changes
|
||||||
|
|
||||||
|
The `go.opentelemetry.io/otel/semconv/v1.30.0` should be a drop-in replacement for `go.opentelemetry.io/otel/semconv/v1.28.0` with the following exceptions.
|
||||||
|
|
||||||
|
Note: `go.opentelemetry.io/otel/semconv/v1.29.0` does not exist due to bugs from the upstream [OpenTelemetry Semantic Conventions].
|
||||||
|
|
||||||
|
## Dropped deprecations
|
||||||
|
|
||||||
|
The following declarations have been deprecated in the [OpenTelemetry Semantic Conventions].
|
||||||
|
Refer to the respective documentation in that repository for deprecation instructions for each type.
|
||||||
|
|
||||||
|
- `CodeColumn`
|
||||||
|
- `CodeColumnKey`
|
||||||
|
- `CodeFunction`
|
||||||
|
- `CodeFunctionKey`
|
||||||
|
- `DBCassandraConsistencyLevelAll`
|
||||||
|
- `DBCassandraConsistencyLevelAny`
|
||||||
|
- `DBCassandraConsistencyLevelEachQuorum`
|
||||||
|
- `DBCassandraConsistencyLevelKey`
|
||||||
|
- `DBCassandraConsistencyLevelLocalOne`
|
||||||
|
- `DBCassandraConsistencyLevelLocalQuorum`
|
||||||
|
- `DBCassandraConsistencyLevelLocalSerial`
|
||||||
|
- `DBCassandraConsistencyLevelOne`
|
||||||
|
- `DBCassandraConsistencyLevelQuorum`
|
||||||
|
- `DBCassandraConsistencyLevelSerial`
|
||||||
|
- `DBCassandraConsistencyLevelThree`
|
||||||
|
- `DBCassandraConsistencyLevelTwo`
|
||||||
|
- `DBCassandraCoordinatorDC`
|
||||||
|
- `DBCassandraCoordinatorDCKey`
|
||||||
|
- `DBCassandraCoordinatorID`
|
||||||
|
- `DBCassandraCoordinatorIDKey`
|
||||||
|
- `DBCassandraIdempotence`
|
||||||
|
- `DBCassandraIdempotenceKey`
|
||||||
|
- `DBCassandraPageSize`
|
||||||
|
- `DBCassandraPageSizeKey`
|
||||||
|
- `DBCassandraSpeculativeExecutionCount`
|
||||||
|
- `DBCassandraSpeculativeExecutionCountKey`
|
||||||
|
- `DBCosmosDBClientID`
|
||||||
|
- `DBCosmosDBClientIDKey`
|
||||||
|
- `DBCosmosDBConnectionModeDirect`
|
||||||
|
- `DBCosmosDBConnectionModeGateway`
|
||||||
|
- `DBCosmosDBConnectionModeKey`
|
||||||
|
- `DBCosmosDBOperationTypeBatch`
|
||||||
|
- `DBCosmosDBOperationTypeCreate`
|
||||||
|
- `DBCosmosDBOperationTypeDelete`
|
||||||
|
- `DBCosmosDBOperationTypeExecute`
|
||||||
|
- `DBCosmosDBOperationTypeExecuteJavascript`
|
||||||
|
- `DBCosmosDBOperationTypeHead`
|
||||||
|
- `DBCosmosDBOperationTypeHeadFeed`
|
||||||
|
- `DBCosmosDBOperationTypeInvalid`
|
||||||
|
- `DBCosmosDBOperationTypeKey`
|
||||||
|
- `DBCosmosDBOperationTypePatch`
|
||||||
|
- `DBCosmosDBOperationTypeQuery`
|
||||||
|
- `DBCosmosDBOperationTypeQueryPlan`
|
||||||
|
- `DBCosmosDBOperationTypeRead`
|
||||||
|
- `DBCosmosDBOperationTypeReadFeed`
|
||||||
|
- `DBCosmosDBOperationTypeReplace`
|
||||||
|
- `DBCosmosDBOperationTypeUpsert`
|
||||||
|
- `DBCosmosDBRequestCharge`
|
||||||
|
- `DBCosmosDBRequestChargeKey`
|
||||||
|
- `DBCosmosDBRequestContentLength`
|
||||||
|
- `DBCosmosDBRequestContentLengthKey`
|
||||||
|
- `DBCosmosDBSubStatusCode`
|
||||||
|
- `DBCosmosDBSubStatusCodeKey`
|
||||||
|
- `DBElasticsearchNodeName`
|
||||||
|
- `DBElasticsearchNodeNameKey`
|
||||||
|
- `DBSystemAdabas`
|
||||||
|
- `DBSystemCache`
|
||||||
|
- `DBSystemCassandra`
|
||||||
|
- `DBSystemClickhouse`
|
||||||
|
- `DBSystemCloudscape`
|
||||||
|
- `DBSystemCockroachdb`
|
||||||
|
- `DBSystemColdfusion`
|
||||||
|
- `DBSystemCosmosDB`
|
||||||
|
- `DBSystemCouchDB`
|
||||||
|
- `DBSystemCouchbase`
|
||||||
|
- `DBSystemDb2`
|
||||||
|
- `DBSystemDerby`
|
||||||
|
- `DBSystemDynamoDB`
|
||||||
|
- `DBSystemEDB`
|
||||||
|
- `DBSystemElasticsearch`
|
||||||
|
- `DBSystemFilemaker`
|
||||||
|
- `DBSystemFirebird`
|
||||||
|
- `DBSystemFirstSQL`
|
||||||
|
- `DBSystemGeode`
|
||||||
|
- `DBSystemH2`
|
||||||
|
- `DBSystemHBase`
|
||||||
|
- `DBSystemHSQLDB`
|
||||||
|
- `DBSystemHanaDB`
|
||||||
|
- `DBSystemHive`
|
||||||
|
- `DBSystemInfluxdb`
|
||||||
|
- `DBSystemInformix`
|
||||||
|
- `DBSystemIngres`
|
||||||
|
- `DBSystemInstantDB`
|
||||||
|
- `DBSystemInterbase`
|
||||||
|
- `DBSystemIntersystemsCache`
|
||||||
|
- `DBSystemKey`
|
||||||
|
- `DBSystemMSSQL`
|
||||||
|
- `DBSystemMariaDB`
|
||||||
|
- `DBSystemMaxDB`
|
||||||
|
- `DBSystemMemcached`
|
||||||
|
- `DBSystemMongoDB`
|
||||||
|
- `DBSystemMssqlcompact`
|
||||||
|
- `DBSystemMySQL`
|
||||||
|
- `DBSystemNeo4j`
|
||||||
|
- `DBSystemNetezza`
|
||||||
|
- `DBSystemOpensearch`
|
||||||
|
- `DBSystemOracle`
|
||||||
|
- `DBSystemOtherSQL`
|
||||||
|
- `DBSystemPervasive`
|
||||||
|
- `DBSystemPointbase`
|
||||||
|
- `DBSystemPostgreSQL`
|
||||||
|
- `DBSystemProgress`
|
||||||
|
- `DBSystemRedis`
|
||||||
|
- `DBSystemRedshift`
|
||||||
|
- `DBSystemSpanner`
|
||||||
|
- `DBSystemSqlite`
|
||||||
|
- `DBSystemSybase`
|
||||||
|
- `DBSystemTeradata`
|
||||||
|
- `DBSystemTrino`
|
||||||
|
- `DBSystemVertica`
|
||||||
|
- `EventName`
|
||||||
|
- `EventNameKey`
|
||||||
|
- `ExceptionEscaped`
|
||||||
|
- `ExceptionEscapedKey`
|
||||||
|
- `GenAIOpenaiRequestSeed`
|
||||||
|
- `GenAIOpenaiRequestSeedKey`
|
||||||
|
- `ProcessExecutableBuildIDProfiling`
|
||||||
|
- `ProcessExecutableBuildIDProfilingKey`
|
||||||
|
- `SystemNetworkStateClose`
|
||||||
|
- `SystemNetworkStateCloseWait`
|
||||||
|
- `SystemNetworkStateClosing`
|
||||||
|
- `SystemNetworkStateDelete`
|
||||||
|
- `SystemNetworkStateEstablished`
|
||||||
|
- `SystemNetworkStateFinWait1`
|
||||||
|
- `SystemNetworkStateFinWait2`
|
||||||
|
- `SystemNetworkStateKey`
|
||||||
|
- `SystemNetworkStateLastAck`
|
||||||
|
- `SystemNetworkStateListen`
|
||||||
|
- `SystemNetworkStateSynRecv`
|
||||||
|
- `SystemNetworkStateSynSent`
|
||||||
|
- `SystemNetworkStateTimeWait`
|
||||||
|
- `VCSRepositoryChangeID`
|
||||||
|
- `VCSRepositoryChangeIDKey`
|
||||||
|
- `VCSRepositoryChangeTitle`
|
||||||
|
- `VCSRepositoryChangeTitleKey`
|
||||||
|
- `VCSRepositoryRefName`
|
||||||
|
- `VCSRepositoryRefNameKey`
|
||||||
|
- `VCSRepositoryRefRevision`
|
||||||
|
- `VCSRepositoryRefRevisionKey`
|
||||||
|
- `VCSRepositoryRefTypeBranch`
|
||||||
|
- `VCSRepositoryRefTypeKey`
|
||||||
|
- `VCSRepositoryRefTypeTag`
|
||||||
|
|
||||||
|
[OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
# Semconv v1.30.0
|
||||||
|
|
||||||
|
[](https://pkg.go.dev/go.opentelemetry.io/otel/semconv/v1.30.0)
|
||||||
+12333
File diff suppressed because it is too large
Load Diff
Generated
Vendored
+3
-3
@@ -4,6 +4,6 @@
|
|||||||
// Package semconv implements OpenTelemetry semantic conventions.
|
// Package semconv implements OpenTelemetry semantic conventions.
|
||||||
//
|
//
|
||||||
// OpenTelemetry semantic conventions are agreed standardized naming
|
// OpenTelemetry semantic conventions are agreed standardized naming
|
||||||
// patterns for OpenTelemetry things. This package represents the conventions
|
// patterns for OpenTelemetry things. This package represents the v1.30.0
|
||||||
// as of the v1.17.0 version of the OpenTelemetry specification.
|
// version of the OpenTelemetry semantic conventions.
|
||||||
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
|
package semconv // import "go.opentelemetry.io/otel/semconv/v1.30.0"
|
||||||
Generated
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// Copyright The OpenTelemetry Authors
|
// Copyright The OpenTelemetry Authors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
|
package semconv // import "go.opentelemetry.io/otel/semconv/v1.30.0"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// ExceptionEventName is the name of the Span event representing an exception.
|
// ExceptionEventName is the name of the Span event representing an exception.
|
||||||
+1750
File diff suppressed because it is too large
Load Diff
Generated
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
// Copyright The OpenTelemetry Authors
|
// Copyright The OpenTelemetry Authors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
package semconv // import "go.opentelemetry.io/otel/semconv/v1.17.0"
|
package semconv // import "go.opentelemetry.io/otel/semconv/v1.30.0"
|
||||||
|
|
||||||
// SchemaURL is the schema URL that matches the version of the semantic conventions
|
// SchemaURL is the schema URL that matches the version of the semantic conventions
|
||||||
// that this package defines. Semconv packages starting from v1.4.0 must declare
|
// that this package defines. Semconv packages starting from v1.4.0 must declare
|
||||||
// non-empty schema URL in the form https://opentelemetry.io/schemas/<version>
|
// non-empty schema URL in the form https://opentelemetry.io/schemas/<version>
|
||||||
const SchemaURL = "https://opentelemetry.io/schemas/1.17.0"
|
const SchemaURL = "https://opentelemetry.io/schemas/1.30.0"
|
||||||
Vendored
+3
-3
@@ -2035,8 +2035,8 @@ go.opencensus.io/trace/tracestate
|
|||||||
## explicit; go 1.22.0
|
## explicit; go 1.22.0
|
||||||
go.opentelemetry.io/auto/sdk
|
go.opentelemetry.io/auto/sdk
|
||||||
go.opentelemetry.io/auto/sdk/internal/telemetry
|
go.opentelemetry.io/auto/sdk/internal/telemetry
|
||||||
# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0
|
# go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0
|
||||||
## explicit; go 1.22.0
|
## explicit; go 1.23.0
|
||||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
|
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
|
||||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal
|
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal
|
||||||
# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0
|
# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0
|
||||||
@@ -2062,11 +2062,11 @@ go.opentelemetry.io/otel/propagation
|
|||||||
go.opentelemetry.io/otel/semconv/internal
|
go.opentelemetry.io/otel/semconv/internal
|
||||||
go.opentelemetry.io/otel/semconv/internal/v4
|
go.opentelemetry.io/otel/semconv/internal/v4
|
||||||
go.opentelemetry.io/otel/semconv/v1.10.0
|
go.opentelemetry.io/otel/semconv/v1.10.0
|
||||||
go.opentelemetry.io/otel/semconv/v1.17.0
|
|
||||||
go.opentelemetry.io/otel/semconv/v1.20.0
|
go.opentelemetry.io/otel/semconv/v1.20.0
|
||||||
go.opentelemetry.io/otel/semconv/v1.20.0/httpconv
|
go.opentelemetry.io/otel/semconv/v1.20.0/httpconv
|
||||||
go.opentelemetry.io/otel/semconv/v1.21.0
|
go.opentelemetry.io/otel/semconv/v1.21.0
|
||||||
go.opentelemetry.io/otel/semconv/v1.26.0
|
go.opentelemetry.io/otel/semconv/v1.26.0
|
||||||
|
go.opentelemetry.io/otel/semconv/v1.30.0
|
||||||
go.opentelemetry.io/otel/semconv/v1.4.0
|
go.opentelemetry.io/otel/semconv/v1.4.0
|
||||||
# go.opentelemetry.io/otel/exporters/jaeger v1.17.0
|
# go.opentelemetry.io/otel/exporters/jaeger v1.17.0
|
||||||
## explicit; go 1.19
|
## explicit; go 1.19
|
||||||
|
|||||||
Reference in New Issue
Block a user