Skip to main content

RESTCONF Extension to support Trace Context Headers
draft-ietf-netconf-restconf-trace-ctx-headers-00

Document Type Active Internet-Draft (netconf WG)
Authors Roque Gagliano , Kristian Larsson , Jan Lindblad
Last updated 2024-04-10
Replaces draft-netconf-restconf-trace-ctx-headers
RFC stream Internet Engineering Task Force (IETF)
Intended RFC status (None)
Formats
Additional resources Mailing list discussion
Stream WG state WG Document
Document shepherd (None)
IESG IESG state I-D Exists
Consensus boilerplate Unknown
Telechat date (None)
Responsible AD (None)
Send notices to (None)
draft-ietf-netconf-restconf-trace-ctx-headers-00
NETCONF                                                      R. Gagliano
Internet-Draft                                             Cisco Systems
Intended status: Standards Track                              K. Larsson
Expires: 12 October 2024                             Deutsche Telekom AG
                                                             J. Lindblad
                                                           Cisco Systems
                                                           10 April 2024

          RESTCONF Extension to support Trace Context Headers
            draft-ietf-netconf-restconf-trace-ctx-headers-00

Abstract

   This document extends the RESTCONF protocol in order to support trace
   context propagation as defined by the W3C.

About This Document

   This note is to be removed before publishing as an RFC.

   The latest revision of this draft can be found at TBD.  Status
   information for this document may be found at
   https://datatracker.ietf.org/doc/draft-ietf-netconf-restconf-trace-
   ctx-headers/.

   Discussion of this document takes place on the NETCONF Working Group
   mailing list (mailto:netconf@ietf.org), which is archived at
   https://mailarchive.ietf.org/arch/browse/netmod/.  Subscribe at
   https://www.ietf.org/mailman/listinfo/netconf/.

   Source for this draft and an issue tracker can be found at
   https://github.com/TBD.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

Gagliano, et al.         Expires 12 October 2024                [Page 1]
Internet-Draft                  rc_trace                      April 2024

   This Internet-Draft will expire on 12 October 2024.

Copyright Notice

   Copyright (c) 2024 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents (https://trustee.ietf.org/
   license-info) in effect on the date of publication of this document.
   Please review these documents carefully, as they describe your rights
   and restrictions with respect to this document.  Code Components
   extracted from this document must include Revised BSD License text as
   described in Section 4.e of the Trust Legal Provisions and are
   provided without warranty as described in the Revised BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  RESTCONF Extensions . . . . . . . . . . . . . . . . . . . . .   3
     2.1.  Errors handling . . . . . . . . . . . . . . . . . . . . .   3
     2.2.  Trace Context header versionning  . . . . . . . . . . . .   5
   3.  Security Considerations . . . . . . . . . . . . . . . . . . .   5
   4.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   5
   5.  Acknowledgments . . . . . . . . . . . . . . . . . . . . . . .   5
   6.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   5
     6.1.  Normative References  . . . . . . . . . . . . . . . . . .   5
     6.2.  Informative References  . . . . . . . . . . . . . . . . .   6
   Appendix A.  Example RESTCONF calls . . . . . . . . . . . . . . .   6
   Appendix B.  Changes (to be deleted by RFC Editor)  . . . . . . .   6
     B.1.  From version 00 to
           draft-ietf-netconf-restconf-trace-ctx-headers-00  . . . .   6
   Appendix C.  TO DO List (to be deleted by RFC Editor) . . . . . .   6
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .   7

1.  Introduction

   Network automation and management systems commonly consist of
   multiple sub-systems and together with the network devices they
   manage, they effectively form a distributed system.  Distributed
   tracing is a methodology implemented by tracing tools to follow,
   analyze and debug operations, such as configuration transactions,
   across multiple distributed systems.  An operation is uniquely
   identified by a trace-id and through a trace context, carries some
   metadata about the operation.  Propagating this "trace context"
   between systems enables forming a coherent view of the entire
   operation as carried out by all involved systems.

Gagliano, et al.         Expires 12 October 2024                [Page 2]
Internet-Draft                  rc_trace                      April 2024

   The W3C has defined two HTTP headers (traceparent and tracestate) for
   context propagation that are useful for distributed systems like the
   ones defined in [RFC8309].  The goal of this document is to adopt
   this W3C specification for the RESTCONF protocol.

   This document does not define new HTTP extensions but makes those
   defined in [W3C-Trace-Context] optional headers for the RESTCONF
   protocol.

   In [I-D.draft-rogaglia-netconf-trace-ctx-extension-03], the NETCONF
   protocol extension is defined and we will re-use several of the YANG
   and XML objects defined in that document for RESTCONF.  Please refer
   to that document for additional context and example applications.

1.1.  Terminology

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
   NOT","SHOULD","SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY",
   and "OPTIONAL" in this document are to be interpreted as described in
   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

2.  RESTCONF Extensions

   A RESTCONF server SHOULD support trace context traceparent header as
   defined in [W3C-Trace-Context].

   A RESTCONF server SHOULD support trace context tracestate header as
   defined in [W3C-Trace-Context].

2.1.  Errors handling

   The RESTCONF server SHOULD follow the "Processing Model for Working
   with Trace Context" as specified in [W3C-Trace-Context].

   If the server rejects the RPC because of the trace context headers
   values, the server MUST return an rpc-error with the following
   values:

     error-tag:      operation-failed
     error-type:     protocol
     error-severity: error

   Additionally, the error-info tag SHOULD contain a relevant details
   about the error.

Gagliano, et al.         Expires 12 October 2024                [Page 3]
Internet-Draft                  rc_trace                      April 2024

   Finally, the sx:structure defined in
   [I-D.draft-rogaglia-netconf-trace-ctx-extension-03] SHOULD be present
   in any error message from the server.

   Example of a badly formated trace context extension using [RFC8040]
   example B.2.1:

     POST /restconf/data/example-jukebox:jukebox/library HTTP/1.1
     Host: example.com
     Content-Type: application/yang-data+json
     traceparent: SomeBadFormatHere
     tracestate: OrSomeBadFormatHere

     {
       "example-jukebox:artist" : [
         {
           "name" : "Foo Fighters"
         }
       ]
     }

   And the expected error message:

    HTTP/1.1 400 Bad Request
    Date: Tue, 20 Jun 2023 20:56:30 GMT
    Server: example-server
    Content-Type: application/yang-data+json

    { "ietf-restconf:errors" : {
        "error" : [
          {
            "error-type" : "protocol",
            "error-tag" : "operation-failed",
            "error-severity" : "error",
            "error-message" :
            "OTLP traceparent attribute incorrectly formatted",
            "error-info": {
              "ietf-netconf-otlp-context:meta-name" : "traceparent",
              "ietf-netconf-otlp-context:meta-value" :
              "SomeBadFormatHere",
              "ietf-netconf-otlp-context:error-type" :
              "ietf-netconf-otlp-context:bad-format"
            }
          }
        ]
      }
    }

Gagliano, et al.         Expires 12 October 2024                [Page 4]
Internet-Draft                  rc_trace                      April 2024

2.2.  Trace Context header versionning

   This extension refers to the [W3C-Trace-Context] trace context
   capability.  The W3C traceparent and trace-state headers include the
   notion of versions.  It would be desirable for a RESTCONF client to
   be able to discover the one or multiple versions of these headers
   supported by a server.  We would like to achieve this goal avoiding
   the deffinition of new RESTCONF capabilities for each headers'
   version.

   [I-D.draft-rogaglia-netconf-trace-ctx-extension-03] defines a pair
   YANG modules that SHOULD be included in the YANG library per
   [RFC8525] of the RESTCONF server supporting the RESTCONF Trace
   Context extension that will refer to the headers' supported versions.
   Future updates of this document could include additional YANG modules
   for new headers' versions.

3.  Security Considerations

   TODO Security

4.  IANA Considerations

   This document has no IANA actions.

5.  Acknowledgments

   We would like to acknowledge

6.  References

6.1.  Normative References

   [I-D.draft-rogaglia-netconf-trace-ctx-extension-03]
              Gagliano, R., Larsson, K., and J. Lindblad, "NETCONF
              Extension to support Trace Context propagation", Work in
              Progress, Internet-Draft, draft-rogaglia-netconf-trace-
              ctx-extension-03, 6 July 2023,
              <https://datatracker.ietf.org/doc/html/draft-rogaglia-
              netconf-trace-ctx-extension-03>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/rfc/rfc2119>.

Gagliano, et al.         Expires 12 October 2024                [Page 5]
Internet-Draft                  rc_trace                      April 2024

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/rfc/rfc8040>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/rfc/rfc8174>.

   [RFC8525]  Bierman, A., Bjorklund, M., Schoenwaelder, J., Watsen, K.,
              and R. Wilton, "YANG Library", RFC 8525,
              DOI 10.17487/RFC8525, March 2019,
              <https://www.rfc-editor.org/rfc/rfc8525>.

   [W3C-Trace-Context]
              "W3C Recommendation on Trace Context", 23 November 2021,
              <https://www.w3.org/TR/2021/REC-trace-context-
              1-20211123/>.

6.2.  Informative References

   [RFC8309]  Wu, Q., Liu, W., and A. Farrel, "Service Models
              Explained", RFC 8309, DOI 10.17487/RFC8309, January 2018,
              <https://www.rfc-editor.org/rfc/rfc8309>.

Appendix A.  Example RESTCONF calls

   TBD

Appendix B.  Changes (to be deleted by RFC Editor)

B.1.  From version 00 to draft-ietf-netconf-restconf-trace-ctx-
      headers-00

   *  Adopted by NETCONF WG

   *  Moved repository to NETCONF WG

   *  Changed build system to use martinthomson's excellent framework

   *  Ran make fix-lint to remove white space at EOL etc.

   *  Added this change note.  No other content changes.

Appendix C.  TO DO List (to be deleted by RFC Editor)

   *  Security Considerations

   *  Example RESTCONF Calls

Gagliano, et al.         Expires 12 October 2024                [Page 6]
Internet-Draft                  rc_trace                      April 2024

   *  The W3C is working on a draft document to introduce the concept of
      "baggage" that we expect part of a future draft for NETCONF and
      RESTCONF

Authors' Addresses

   Roque Gagliano
   Cisco Systems
   Avenue des Uttins 5
   CH-1180 Rolle
   Switzerland
   Email: rogaglia@cisco.com

   Kristian Larsson
   Deutsche Telekom AG
   Email: kll@dev.terastrm.net

   Jan Lindblad
   Cisco Systems
   Email: jlindbla@cisco.com

Gagliano, et al.         Expires 12 October 2024                [Page 7]