Skip to content

Conversation

@lmolkova
Copy link
Member

@lmolkova lmolkova commented Jan 3, 2026

Fixes #1853

Comment on lines +191 to +195
Define spans when:

- The corresponding operation is important for observability.
- The operation has duration.
- A new trace context should be created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all or any of these conditions be fulfilled? Are any points optional?

Maybe consider similar phrasing to the Defining attributes conditions.

Suggested change
Define spans when:
- The corresponding operation is important for observability.
- The operation has duration.
- A new trace context should be created.
Define spans when all of the following apply:
- The corresponding operation is important for observability.
- The operation has duration.
- A new trace context should be created.

Comment on lines +212 to +220
Don't try to capture all available properties as span attributes. Telemetry is
lossy, and it's important to assess the value-to-cost ratio of each referenced attribute.

Capture the details of that specific operation. Parent operations or sub-operations
will have their own spans.

For example, when recording a call to upload a file to an object store,
include the endpoint, collection, and object identifier. Don't include details of
the underlying HTTP/gRPC requests unless there is a strong reason to.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to attributes section

messaging queue, GenAI model, object store collection), input parameters, and
result properties that should be recorded on the span.

- When referencing attributes, refine its properties:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- When referencing attributes, refine its properties:
- When referencing an attribute, refine its properties:


- The corresponding operation is important for observability.
- The operation has duration.
- A new trace context should be created.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a link for trace context? maybe call it span context(?)

- The operation has duration.
- A new trace context should be created.

Don't define spans for point-in-time telemetry that does not need new context - use events instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the parts about not needing a new context is going to be confusing for most readers

wdyt of leaving that out of the main section and have an "exception" section below for messaging?

Comment on lines +212 to +213
Don't try to capture all available properties as span attributes. Telemetry is
lossy, and it's important to assess the value-to-cost ratio of each referenced attribute.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't follow the tie in to being lossy

> the duration of the same operation type. For example, the `http.client.request.duration`
> metric is recorded alongside the corresponding HTTP client span.

A span definition includes the following sections:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't follow this line, is it a heading for the sections below?

- When the span starts and ends.
- If this span represents a client call, specify whether it captures the logical call
(as observed by the API caller) or the physical call (per-try/per-attempt).
- Define a span per different operation type.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this is saying, maybe a short example could help?


Certain conditions can't be clearly classified as errors or not-errors (cancellations,
HTTP 404 and many others). Avoid using strict requirements - allow instrumentations
to leverage context they might have to provide accurate status.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to leverage context they might have to provide accurate status.
to leverage context they might have to provide a more accurate status.

Comment on lines +275 to +276
All span definitions MUST include a specific span kind. Don't mix definitions of
different span kinds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't mix definitions of different span kinds.

maybe this could be clearer, something like a span type(?) should only have one span kind?


- When referencing attributes, refine its properties:
- Specify if an attribute is relevant for head-sampling. Such attributes should be
provided at start time and would be passed to the sampler. Usually, these are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
provided at start time and would be passed to the sampler. Usually, these are
provided at start time so that they will be passed to the sampler. Usually, these are

Comment on lines +290 to +291
- Include some form of operation name that allows identifying different operations
of the same type.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"identifying different operations of the same type" seems vague

Maybe "important / useful categories of operations"?

Or could be even more specific and reframe it around {action} {target}?


- Static text should not be included, but can be used as a fallback.

E.g., we use `GET /{controller}/{action}` instead of `HTTP GET /{controller}/{action}`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the {action} here was meant to represent a URL path variable and not the action from the span name pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

SemConv guidance: document how to define spans

3 participants