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

Clarify behavior for empty/not present/invalid trace_id and span_id fields #442

Conversation

tigrannajaryan
Copy link
Member

@tigrannajaryan tigrannajaryan commented Jan 3, 2023

Resolves open-telemetry/opentelemetry-specification#3040

This is not a breaking change:

  • For Span it now defines more precisely the receiver behavior that was previously defined vaguely (e.g. it was unclear what "empty" means for bytes field).

  • For LogRecord it now defines the receiver behavior that was previously unspecified. This ensures that the wording is consistent with what we have for the Span.

@jmacd
Copy link
Contributor

jmacd commented Jan 6, 2023

Still, to me these statements do not belong in the specification anywhere; they look like accidents. Does the collector relaly implement this (if so where)?

I would call this a defect covered by open-telemetry/opentelemetry-specification#1929. We are aware that there are ill-formed trace and span IDs, but we are referring to a .proto file instead of a data model specification. The metrics data model & SDK specifications address a number of potential ill-formed features in the data, such as duplicate-conflicting instrument definitions. The data model and SDK specifications explain that processors should pass through such invalid data and let consumers decide what to do with it. The question here is, what do we gain by filling in random fields with no other indication that the IDs are not real to cover for invalid data?

Copy link
Member

@Aneurysm9 Aneurysm9 left a comment

Choose a reason for hiding this comment

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

@jmacd has convinced me that this is not the correct change to make.

opentelemetry/proto/trace/v1/trace.proto Outdated Show resolved Hide resolved
opentelemetry/proto/trace/v1/trace.proto Outdated Show resolved Hide resolved
@tigrannajaryan
Copy link
Member Author

I did some spelunking and the "generate" recommendation comes from the very first commit: b5bcfff#diff-ef5f80fbf835dd57e14cb9264944f03d80cf6b04cc7671b0e7fb33167c67efcc where they were copied from Java repo, to which they were copied from OpenCensus open-telemetry/opentelemetry-java#134 and in OpenCensus the wording first time appeared here census-instrumentation/opencensus-proto#160 (authored by @SergeyKanzhelev, merged by @bogdandrutu ). I don't see any discussion on why "generating" is the right or wrong approach.

@bogdandrutu @SergeyKanzhelev do you by any chance remember why this wording is used?

@tigrannajaryan
Copy link
Member Author

I also checked the Collector's OTLP receiver and I don't see any code that implements the "generate on invalid" part.

Unless we hear some arguments that explain why generating is important I agree to treat it as a bug and delete the requirement.

tigrannajaryan added a commit to tigrannajaryan/opentelemetry-proto that referenced this pull request Jan 10, 2023
…received

This is considered an bug in the spec that was uncovered in the discussion here:
open-telemetry#442 (comment)

I did some spelunking and the "generate" recommendation comes from the very first commit:
open-telemetry@b5bcfff#diff-ef5f80fbf835dd57e14cb9264944f03d80cf6b04cc7671b0e7fb33167c67efcc
where they were copied from Java repo, to which they were copied from OpenCensus
open-telemetry/opentelemetry-java#134 and in OpenCensus the
wording first time appeared here census-instrumentation/opencensus-proto#160
(authored by @SergeyKanzhelev, merged by @bogdandrutu).

We are deleting the requirement to generate a new trace id or span id if an invalid
id is received. The receivers can decide how they want to treat the invalid id (just
like upon receiving any other invalid id), e.g. they may drop it, log an error, accept
the invalid data, etc. We are not going to prescribe a particular receiver behavior
when invalid trace/span id is received.
@tigrannajaryan
Copy link
Member Author

I created a separate PR to delete the "generate" requirement: #444

If that gets accepted I will rewrite this PR as necessary.

tigrannajaryan added a commit that referenced this pull request Jan 20, 2023
…received (#444)

This is considered an bug in the spec that was uncovered in the discussion here:
#442 (comment)

I did some spelunking and the "generate" recommendation comes from the very first commit:
b5bcfff#diff-ef5f80fbf835dd57e14cb9264944f03d80cf6b04cc7671b0e7fb33167c67efcc
where they were copied from Java repo, to which they were copied from OpenCensus
open-telemetry/opentelemetry-java#134 and in OpenCensus the
wording first time appeared here census-instrumentation/opencensus-proto#160
(authored by @SergeyKanzhelev, merged by @bogdandrutu).

We are deleting the requirement to generate a new trace id or span id if an invalid
id is received. The receivers can decide how they want to treat the invalid id (just
like upon receiving any other invalid id), e.g. they may drop it, log an error, accept
the invalid data, etc. We are not going to prescribe a particular receiver behavior
when invalid trace/span id is received.
@tigrannajaryan tigrannajaryan force-pushed the feature/tigran/clarify-not-present-id branch 2 times, most recently from 1a1ef77 to 1c6a5c8 Compare January 20, 2023 19:42
…ields

Resolves open-telemetry/opentelemetry-specification#3040

This is not a breaking change:

- For Span it now defines more precisely the receiver behavior that was
  previously defined vaguely (e.g. it was unclear what "empty" means for
  bytes field).

- For LogRecord it now defines the receiver behavior that was previously
  unspecified. This ensures that the wording are consistent with what we
  have for the Span.
@tigrannajaryan
Copy link
Member Author

All, please take another look. #444 is now merged and this is rebased from main.

@tigrannajaryan
Copy link
Member Author

@jsuereth @jmacd please take another look.

@tigrannajaryan
Copy link
Member Author

@jsuereth @jmacd I made changes based on your comments. Please take a look. If I do not see objections I will join this tomorrow since we have enough approvals.

@open-telemetry open-telemetry deleted a comment from akasyagroup Jan 27, 2023
@tigrannajaryan
Copy link
Member Author

Has enough approvals, 2 days passed since last change, merging.

@tigrannajaryan tigrannajaryan merged commit 2bdeb79 into open-telemetry:main Jan 27, 2023
@tigrannajaryan tigrannajaryan deleted the feature/tigran/clarify-not-present-id branch January 27, 2023 00:50
@abitrolly
Copy link

Is it possible to have human readable documentation? Not everybody is .proto literate. There are many of us DevOps who are skilled in YAML only.

@tigrannajaryan
Copy link
Member Author

Is it possible to have human readable documentation? Not everybody is .proto literate. There are many of us DevOps who are skilled in YAML only.

@abitrolly The target audience of this repository are developers who implement OTLP protocol. The topics for devops engineers are here https://opentelemetry.io/ and if you would like something to be added there please create an issue at https://github.com/open-telemetry/opentelemetry.io/issues

@abitrolly
Copy link

@tigrannajaryan missed the repo name. Opened a PR in open-telemetry/opentelemetry-specification#3152 to fill missing docs in protocol limitation.

VinozzZ pushed a commit to VinozzZ/opentelemetry-proto that referenced this pull request Jun 21, 2024
…received (open-telemetry#444)

This is considered an bug in the spec that was uncovered in the discussion here:
open-telemetry#442 (comment)

I did some spelunking and the "generate" recommendation comes from the very first commit:
open-telemetry@b5bcfff#diff-ef5f80fbf835dd57e14cb9264944f03d80cf6b04cc7671b0e7fb33167c67efcc
where they were copied from Java repo, to which they were copied from OpenCensus
open-telemetry/opentelemetry-java#134 and in OpenCensus the
wording first time appeared here census-instrumentation/opencensus-proto#160
(authored by @SergeyKanzhelev, merged by @bogdandrutu).

We are deleting the requirement to generate a new trace id or span id if an invalid
id is received. The receivers can decide how they want to treat the invalid id (just
like upon receiving any other invalid id), e.g. they may drop it, log an error, accept
the invalid data, etc. We are not going to prescribe a particular receiver behavior
when invalid trace/span id is received.
VinozzZ pushed a commit to VinozzZ/opentelemetry-proto that referenced this pull request Jun 21, 2024
…ields (open-telemetry#442)

Resolves open-telemetry/opentelemetry-specification#3040

This is not a breaking change:

- For Span it now defines more precisely the receiver behavior that was
  previously defined vaguely (e.g. it was unclear what "empty" means for
  bytes field).

- For LogRecord it now defines the receiver behavior that was previously
  unspecified. This ensures that the wording are consistent with what we
  have for the Span.
VinozzZ pushed a commit to VinozzZ/opentelemetry-proto that referenced this pull request Jun 21, 2024
…received (open-telemetry#444)

This is considered an bug in the spec that was uncovered in the discussion here:
open-telemetry#442 (comment)

I did some spelunking and the "generate" recommendation comes from the very first commit:
open-telemetry@b5bcfff#diff-ef5f80fbf835dd57e14cb9264944f03d80cf6b04cc7671b0e7fb33167c67efcc
where they were copied from Java repo, to which they were copied from OpenCensus
open-telemetry/opentelemetry-java#134 and in OpenCensus the
wording first time appeared here census-instrumentation/opencensus-proto#160
(authored by @SergeyKanzhelev, merged by @bogdandrutu).

We are deleting the requirement to generate a new trace id or span id if an invalid
id is received. The receivers can decide how they want to treat the invalid id (just
like upon receiving any other invalid id), e.g. they may drop it, log an error, accept
the invalid data, etc. We are not going to prescribe a particular receiver behavior
when invalid trace/span id is received.
VinozzZ pushed a commit to VinozzZ/opentelemetry-proto that referenced this pull request Jun 21, 2024
…ields (open-telemetry#442)

Resolves open-telemetry/opentelemetry-specification#3040

This is not a breaking change:

- For Span it now defines more precisely the receiver behavior that was
  previously defined vaguely (e.g. it was unclear what "empty" means for
  bytes field).

- For LogRecord it now defines the receiver behavior that was previously
  unspecified. This ensures that the wording are consistent with what we
  have for the Span.
VinozzZ pushed a commit to VinozzZ/opentelemetry-proto that referenced this pull request Jun 21, 2024
…received (open-telemetry#444)

This is considered an bug in the spec that was uncovered in the discussion here:
open-telemetry#442 (comment)

I did some spelunking and the "generate" recommendation comes from the very first commit:
open-telemetry@b5bcfff#diff-ef5f80fbf835dd57e14cb9264944f03d80cf6b04cc7671b0e7fb33167c67efcc
where they were copied from Java repo, to which they were copied from OpenCensus
open-telemetry/opentelemetry-java#134 and in OpenCensus the
wording first time appeared here census-instrumentation/opencensus-proto#160
(authored by @SergeyKanzhelev, merged by @bogdandrutu).

We are deleting the requirement to generate a new trace id or span id if an invalid
id is received. The receivers can decide how they want to treat the invalid id (just
like upon receiving any other invalid id), e.g. they may drop it, log an error, accept
the invalid data, etc. We are not going to prescribe a particular receiver behavior
when invalid trace/span id is received.
VinozzZ pushed a commit to VinozzZ/opentelemetry-proto that referenced this pull request Jun 21, 2024
…ields (open-telemetry#442)

Resolves open-telemetry/opentelemetry-specification#3040

This is not a breaking change:

- For Span it now defines more precisely the receiver behavior that was
  previously defined vaguely (e.g. it was unclear what "empty" means for
  bytes field).

- For LogRecord it now defines the receiver behavior that was previously
  unspecified. This ensures that the wording are consistent with what we
  have for the Span.
VinozzZ pushed a commit to VinozzZ/opentelemetry-proto that referenced this pull request Jun 21, 2024
…received (open-telemetry#444)

This is considered an bug in the spec that was uncovered in the discussion here:
open-telemetry#442 (comment)

I did some spelunking and the "generate" recommendation comes from the very first commit:
open-telemetry@b5bcfff#diff-ef5f80fbf835dd57e14cb9264944f03d80cf6b04cc7671b0e7fb33167c67efcc
where they were copied from Java repo, to which they were copied from OpenCensus
open-telemetry/opentelemetry-java#134 and in OpenCensus the
wording first time appeared here census-instrumentation/opencensus-proto#160
(authored by @SergeyKanzhelev, merged by @bogdandrutu).

We are deleting the requirement to generate a new trace id or span id if an invalid
id is received. The receivers can decide how they want to treat the invalid id (just
like upon receiving any other invalid id), e.g. they may drop it, log an error, accept
the invalid data, etc. We are not going to prescribe a particular receiver behavior
when invalid trace/span id is received.
VinozzZ pushed a commit to VinozzZ/opentelemetry-proto that referenced this pull request Jun 21, 2024
…ields (open-telemetry#442)

Resolves open-telemetry/opentelemetry-specification#3040

This is not a breaking change:

- For Span it now defines more precisely the receiver behavior that was
  previously defined vaguely (e.g. it was unclear what "empty" means for
  bytes field).

- For LogRecord it now defines the receiver behavior that was previously
  unspecified. This ensures that the wording are consistent with what we
  have for the Span.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OTLP/JSON: Clarify behavior when traceid/spanid fields are not present or not valid