Skip to content

Commit

Permalink
update depenencies version and small refactor Merge branch 'master' i…
Browse files Browse the repository at this point in the history
…nto update/deps/version

fix
fix

Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango committed Aug 16, 2022
1 parent 97eed29 commit 3aa3940
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions internal/observability/trace/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@ import (
)

const (
<<<<<<< HEAD
msgAttributeKey = attribute.Key("rpc.grpc.message")

StatusOK = ocodes.Ok
StatusError = ocodes.Error
)

=======
grpcMsgAttributeKey = attribute.Key("rpc.grpc.message")
StatusOK = ocodes.Ok
StatusError = ocodes.Error
)

>>>>>>> update/deps/version
func FromGRPCStatus(code codes.Code, msg string) []attribute.KeyValue {
switch code {
case codes.OK:
Expand Down Expand Up @@ -72,118 +80,186 @@ func FromGRPCStatus(code codes.Code, msg string) []attribute.KeyValue {
func StatusCodeOK(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeOk,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeCancelled(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeCancelled,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeUnknown(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeUnknown,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeInvalidArgument(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeInvalidArgument,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeDeadlineExceeded(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeDeadlineExceeded,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeNotFound(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeNotFound,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeAlreadyExists(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeAlreadyExists,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodePermissionDenied(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodePermissionDenied,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeResourceExhausted(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeResourceExhausted,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeFailedPrecondition(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeFailedPrecondition,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeAborted(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeAborted,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeOutOfRange(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeOutOfRange,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeUnimplemented(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeUnimplemented,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeInternal(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeInternal,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeUnavailable(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeUnavailable,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeDataLoss(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeDataLoss,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

func StatusCodeUnauthenticated(msg string) []attribute.KeyValue {
return []attribute.KeyValue{
semconv.RPCGRPCStatusCodeUnauthenticated,
<<<<<<< HEAD
msgAttributeKey.String(msg),
=======
grpcMsgAttributeKey.String(msg),
>>>>>>> update/deps/version
}
}

0 comments on commit 3aa3940

Please sign in to comment.