Package codes defines the canonical error codes used by OpenTelemetry.

    This package is currently in a pre-GA phase. Backwards incompatible changes may be introduced in subsequent minor version releases as we work to track the evolving OpenTelemetry specification and user feedback.

    It conforms to [the OpenTelemetry specification](



    This section is empty.


    This section is empty.


    This section is empty.


    type Code

    type Code uint32

      Code is an 32-bit representation of a status state.

      const (
      	// Unset is the default status code.
      	Unset Code = 0
      	// Error indicates the operation contains an error.
      	Error Code = 1
      	// Ok indicates operation has been validated by an Application developers
      	// or Operator to have completed successfully, or contain no error.
      	Ok Code = 2

      func (*Code) MarshalJSON

      func (c *Code) MarshalJSON() ([]byte, error)

        MarshalJSON returns c as the JSON encoding of c.

        func (Code) String

        func (c Code) String() string

          String returns the Code as a string.

          func (*Code) UnmarshalJSON

          func (c *Code) UnmarshalJSON(b []byte) error

            UnmarshalJSON unmarshals b into the Code.

            This is based on the functionality in the gRPC codes package:

            Source Files