Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming to baggage #27

Merged
merged 9 commits into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing into Correlation Context
# Contributing into Baggage

This repository is being used for work in the [W3C Distributed Trace Context Working Group](https://www.w3.org/2018/distributed-tracing/).

Expand Down Expand Up @@ -31,4 +31,4 @@ This repository follows the best practices from https://w3c.github.io/

- Report is generated by [ReSpec](https://github.com/w3c/respec/wiki)
- To view report locally - start the local server like `python -m SimpleHTTPServer` to avoid cross-site file loading issue
- You can preview report from your branch or fork `http://htmlpreview.github.io/?https://github.com/<organization or form name>/correlation-context/blob/<branch name>/index.html`. It is useful to review PR suggestions.
- You can preview report from your branch or fork `http://htmlpreview.github.io/?https://github.com/<organization or form name>/baggage/blob/<branch name>/index.html`. It is useful to review PR suggestions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Correlation Context Specification
# Baggage Specification

This repository is associated with the [Correlation
Context](https://w3c.github.io/correlation-context/) specification.
This repository is associated with the [Baggage](https://w3c.github.io/badgage/) specification.

Status of the report is
[Editor Draft](https://www.w3.org/2017/Process-20170301/#working-draft).

See rationale
[document](correlation_context/HTTP_HEADER_FORMAT_RATIONALE.md) for
[document](baggage/HTTP_HEADER_FORMAT_RATIONALE.md) for
clarifications.

## Team Communication
Expand All @@ -21,7 +20,7 @@ made in specification.

## Goal

This specification defines propagation of context for events correlation
This specification defines propagation of baggage for events correlation
beyond the request identification that is covered by [trace
context](https://w3c.github.io/trace-context/) specification. Our goal
is to share this with the community so that various tracing and
Expand Down
5 changes: 5 additions & 0 deletions abstract/baggage-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Overview

Baggage represented by set of name/value pairs describing user defined properties of the trace.
danielkhan marked this conversation as resolved.
Show resolved Hide resolved

`Baggage` header represents user-defined baggage associated with the trace. Libraries and platforms MAY propagate this header.
danielkhan marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion abstract/common-abstract.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Distributed tracing is a set of tools and practices to monitor the health and re

The main concept behind distributed tracing is event correlation. Event correlation is a way to correlate events from one component to the events from another. It allows to find the cause-and-effect relationship between these events. For instance – find which user action in a browser caused a failure in the business logic layer.

To correlate events between components, these components need to exchange and store a piece of information called context. Typically context consists of an originating event identifier, an originating component identity and other event properties. Context has two parts. The first part is a trace context. Trace context consists of properties crucial for event correlation. The second part is correlation context. Correlation context carries user-defined properties. These properties may be helpful for correlation scenarios. But they are not required and components may choose to not carry or store them.
To correlate events between components, these components need to exchange and store a piece of information called context. Typically context consists of an originating event identifier, an originating component identity and other event properties. Context has two parts. The first part is a trace context. Trace context consists of properties crucial for event correlation. The second part is baggage. Baggage carries user-defined properties. These properties may be helpful for correlation scenarios. But they are not required and components may choose to not carry or store them.

Unifying the format of distributed tracing context as well as aligning on semantic meaning of the values is the main objective of this working group. The goal is to share this with the community so that various tracing and diagnostics products can operate together.
5 changes: 0 additions & 5 deletions abstract/correlation-context-overview.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Correlation Context HTTP Header Format
# Baggage HTTP Header Format

The correlation context header is used to propagate user-supplied key-value pairs through a trace.
The baggage header is used to propagate user-supplied key-value pairs through a trace.
danielkhan marked this conversation as resolved.
Show resolved Hide resolved
danielkhan marked this conversation as resolved.
Show resolved Hide resolved
A received header MAY be altered to change or add information and it MUST be passed on to all downstream request.

Multiple correlation context headers are allowed. Values can be combined in a single header according to [RFC 7230](https://tools.ietf.org/html/rfc7230#page-24).
Multiple baggage headers are allowed. Values can be combined in a single header according to [RFC 7230](https://tools.ietf.org/html/rfc7230#page-24).
danielkhan marked this conversation as resolved.
Show resolved Hide resolved

*See [rationale document](HTTP_HEADER_FORMAT_RATIONALE.md) for details of decisions made for this format.*


# Header Name

Header name: `Correlation-Context`
Header name: `Baggage`

@TODO: Agree on the header name
@TODO: Add more information on casing once we agree on the final header name
danielkhan marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -49,11 +49,11 @@ It can not be guaranteed that keys are unique.
Consumers MUST be able to handle duplicate keys while producers SHOULD try to deduplicate the list.

### key
ASCII string according to the `token` format, defined in [[RFC2616], Section 2.2](https://tools.ietf.org/html/rfc2616#section-2.2).
ASCII string according to the `token` format, defined in [[RFC2616], Section 2.2](https://tools.ietf.org/html/rfc2616#section-2.2).
Leading and trailing whitespaces (OWS) are allowed but MUST be trimmed when converting the header into a data structure.

### value
A value contains an URL encoded UTF-8 string.
A value contains an URL encoded UTF-8 string.
Leading and trailing whitespaces (OWS) are allowed but MUST be trimmed when converting the header into a data structure.

### property
Expand All @@ -66,36 +66,36 @@ Leading and trailing OWS is allowed but MUST be trimmed when converting the head
Single header:

```
Correlation-Context: userId=sergey,serverNode=DF:28,isProduction=false
Bag: userId=sergey,serverNode=DF:28,isProduction=false
danielkhan marked this conversation as resolved.
Show resolved Hide resolved
```

Context might be split into multiple headers:

```
Correlation-Context: userId=sergey
Correlation-Context: serverNode=DF%3A28,isProduction=false
Baggage: userId=sergey
Baggage: serverNode=DF%3A28,isProduction=false
```

Values and names might begin and end with spaces:

```
Correlation-Context: userId = sergey
Correlation-Context: serverNode = DF%3A28, isProduction = false
Baggage: userId = sergey
Baggage: serverNode = DF%3A28, isProduction = false
```

## Example use case

For example, if all of your data needs to be sent to a single node, you could propagate a property indicating that.
```
Correlation-Context: serverNode=DF:28
Baggage: serverNode=DF:28
```

For example, if you need to log the original user ID when making transactions arbitrarily deep into a trace.
```
Correlation-Context: userId=sergey
Baggage: userId=sergey
```

For example, if you have non-production requests that flow through the same services as production requests.
```
Correlation-Context: isProduction=false
Baggage: isProduction=false
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Correlation Context Header Format Rationale
# Baggage Header Format Rationale

This document provides a rationale for the decisions made for the `Correlation-Context` header format.
This document provides a rationale for the decisions made for the `Baggage` header format.

## General considerations

Expand All @@ -15,7 +15,7 @@ Another option would be to use prefixed headers, such as `trace-context-X`, wher
field name. That could reduce the size of the data, particularly in http/2, where header
compression can apply.

Generally speaking, a `Correlation-Context` header may be split into multiple headers, and
Generally speaking, a `Baggage` header may be split into multiple headers, and
compression may be at the same ballpark as repeating values are converted into a single value
in HPAC's dynamic collection. That said, there was no profiling made to make this decision.

Expand All @@ -29,13 +29,13 @@ name.

The [Vary](https://tools.ietf.org/html/rfc7231#section-7.1.4) approach is another alternative,
where a fixed header is used to enumerate the list of other headers that actually contain the data.
which could be used to accomplish the same. For example, `Correlation-Context: x-department; x-user-id;
which could be used to accomplish the same. For example, `Baggage: x-department; x-user-id;
ttl=1` could tell the propagation to look at and forward the parent ID header, but only to the
next hop. This has an advantage of HTTP header compression (hpack) and also weave-in with legacy
tracing headers.

Vary approach may be implemented as a new "header reference" value type `ref`.
`Correlation-Context: x-b3-parentid;type=ref;ttl=1` if proven needed.
`Baggage: x-b3-parentid;type=ref;ttl=1` if proven needed.

## Trimming of spaces

Expand All @@ -57,11 +57,11 @@ Url encoding is a low-overhead way to encode Unicode characters for non-Latin ch
## Limits

The idea behind limits is to provide trace vendors standard safeguards so the content of the
`Correlation-Context` header can be stored with the request. Thus the limits are defined on the
`Baggage` header can be stored with the request. Thus the limits are defined on the
number of keys, max pair length, and the total size. The total size limit is the most important for planning data storage requirements.

Another consideration was that HTTP cookies provide a similar way to pass custom data via HTTP
headers. So the limits should make the correlation context name-value pairs fit the typical
headers. So the limits should make the baggage name-value pairs fit the typical
cookie limits.

- *Maximum number of name-value pairs* - this limit was taken as a number of cookies allowed by
Expand Down
10 changes: 5 additions & 5 deletions correlation_context/README.md → baggage/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Correlation-Context Header
# Baggage Header

Correlation context header is used to propagate properties not defined in `Trace-Parent`. There
are two common use cases. First is to define a context on trace initiation. Such context will
have customer's identity, high-level operation name and other properties like a flight name.
Second use case is to pass the caller's name to the next component. This name-value pair will be
Baggage context header is used to propagate properties not defined in `Trace-Parent`. There
danielkhan marked this conversation as resolved.
Show resolved Hide resolved
are two common use cases. First is to define a context on trace initiation. Such context will
have customer's identity, high-level operation name and other properties like a flight name.
Second use case is to pass the caller's name to the next component. This name-value pair will be
overridden by every service to it's own name.

## HTTP Format
Expand Down
113 changes: 57 additions & 56 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,62 +1,63 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Propagation format for distributed trace context: Trace Context headers</title>
<script
src='https://www.w3.org/Tools/respec/respec-w3c-common'
class='remove'></script>
<script class='remove'>
var respecConfig = {
specStatus: "ED",
editors: [{
name: "Sergey Kanzhelev",
company: "Microsoft",
companyURL: "https://microsoft.com",
w3cid: "103966"
},
{
name: "Morgan McLean",
company: "Google",
companyURL: "https://google.com",
w3cid: "104128"
},
{
name: "Alois Reitbauer",
company: "Dynatrace",
companyURL: "https://dynatrace.com",
w3cid: "48276"
}],
github: {
repoURL: "https://github.com/w3c/correlation-context/",
branch: "master",
},
edDraftURI: "https://w3c.github.io/correlation-context/",
shortName: "correlation-context",
format: "markdown",
subjectPrefix: "correlation-context",
wg: "Distributed Tracing Working Group",
wgPublicList: "public-trace-context",
wgURI: "https://www.w3.org/2018/distributed-tracing/",
//isPreview: true, //this will add ugly box saying it's preview
otherLinks: [{
key: 'Discussions',
data: [{
value: 'We are on Gitter.',
href: 'https://gitter.im/TraceContext/Lobby'
}]
}],
wgPatentURI: "https://www.w3.org/2004/01/pp-impl/108594/status"
};
</script>
</head>
<body>
<section id='abstract' data-include="abstract/common-abstract.md" data-include-format='markdown'></section>
<section id='sotd' data-include="abstract/common-sotd.md" data-include-format='markdown'></section>

<section data-include="abstract/correlation-context-overview.md" data-include-format='markdown'></section>
<head>
<meta charset='utf-8'>
<title>Propagation format for distributed trace context: Baggage</title>
<script src='https://www.w3.org/Tools/respec/respec-w3c-common' class='remove'></script>
<script class='remove'>
var respecConfig = {
specStatus: "ED",
editors: [{
name: "Sergey Kanzhelev",
company: "Microsoft",
companyURL: "https://microsoft.com",
w3cid: "103966"
},
{
name: "Morgan McLean",
company: "Google",
companyURL: "https://google.com",
w3cid: "104128"
},
{
name: "Alois Reitbauer",
company: "Dynatrace",
companyURL: "https://dynatrace.com",
w3cid: "48276"
}],
github: {
repoURL: "https://github.com/w3c/baggage/",
branch: "master",
},
edDraftURI: "https://w3c.github.io/baggage/",
shortName: "baggage",
format: "markdown",
subjectPrefix: "baggage",
wg: "Distributed Tracing Working Group",
wgPublicList: "public-trace-context",
wgURI: "https://www.w3.org/2018/distributed-tracing/",
//isPreview: true, //this will add ugly box saying it's preview
otherLinks: [{
key: 'Discussions',
data: [{
value: 'We are on Gitter.',
href: 'https://gitter.im/TraceContext/Lobby'
}]
}],
wgPatentURI: "https://www.w3.org/2004/01/pp-impl/108594/status"
};
</script>
</head>

<section data-include="correlation_context/HTTP_HEADER_FORMAT.md" data-include-format='markdown'></section>
<body>
<section id='abstract' data-include="abstract/common-abstract.md" data-include-format='markdown'></section>
<section id='sotd' data-include="abstract/common-sotd.md" data-include-format='markdown'></section>

<section data-include="abstract/baggage-overview.md" data-include-format='markdown'></section>

<section data-include="baggage/HTTP_HEADER_FORMAT.md" data-include-format='markdown'></section>

</body>

</body>
</html>