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

reporter: use semantic convention to report frame type #167

Merged
merged 7 commits into from
Oct 22, 2024

Conversation

florianl
Copy link
Contributor

With open-telemetry/semantic-conventions#1188 a semantic convention for frame types was defined and open-telemetry/opentelemetry-proto#578 removed Location.type_index from the OTel profiling signal in favor of the semantic convention.
Update the reporter to use this semantic convention.

@florianl florianl requested review from a team as code owners September 24, 2024 06:14
With open-telemetry/semantic-conventions#1188 a
semantic convention for frame types was defined and
open-telemetry/opentelemetry-proto#578 removed
Location.type_index from the OTel profiling signal in favor of the semantic
convention.
Update the reporter to use this semantic convention.

Signed-off-by: Florian Lehner <[email protected]>
@florianl
Copy link
Contributor Author

I did run into issues when creating a new devfiler version. So, sorry for the delay 🙏

@florianl
Copy link
Contributor Author

florianl commented Oct 3, 2024

sorry again for the delay 🙏 PR got updated and provides now a link in the README to the new devfiler version

@@ -55,13 +55,13 @@ var interpreterTypeToString = map[InterpreterType]string{
UnknownInterp: "unknown",
PHP: "php",
PHPJIT: "phpjit",
Copy link
Member

@christos68k christos68k Oct 3, 2024

Choose a reason for hiding this comment

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

Currently there is no phpjit semantic convention, just php, so we should also introduce it (unless we think there is no value in the distinction between the two). It seems useful to keep the distinction.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. A lot of language runtimes have multiple execution tiers like "interpreted", "jit" or in the case of HotSpot even multiple tiers of JITing (C1 and C2). Perhaps instead of duplicating each frame kind, we should consider a separate attribute for that?

Copy link
Contributor

Choose a reason for hiding this comment

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

@christos68k Does it make sense to create a separate issue for this, so we can merge this PR. Without it, the devfiler won't work with the latest agent.

Copy link
Member

Choose a reason for hiding this comment

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

We discussed this and decided to wait until @florianl comes back as there's a decision to be made also for error frames and I lack context.

Copy link
Member

@christos68k christos68k Oct 14, 2024

Choose a reason for hiding this comment

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

We also discussed this today and think that it makes sense to introduce a new attribute for per-frame interpreter-specific metadata which may include:

  1. Error frame designation and error code
  2. Inline status
  3. JIT optimization / compiler level

We can discuss the specifics in the SIG.

As far as this PR is concerned, I think we can keep the frame type attribute and its string encoding, but this PR needs to be amended to be compliant with semantic conventions by:

  1. Sending PHPJIT frame types as "php" rather than "phpjit"
  2. Stripping error information (e.g. send "jvm" instead of "jvm-error")
  3. If we want to send abort frames we'd also need to define them in semconv

@florianl What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

applied the suggested changes.

@@ -546,13 +546,15 @@ func (r *OTLPReporter) getProfile() (profile *profiles.Profile, startTS, endTS u

// Walk every frame of the trace.
for i := range traceInfo.frameTypes {
frameAttributes := addProfileAttributes(profile, []attrKeyValue{
Copy link
Member

@christos68k christos68k Oct 3, 2024

Choose a reason for hiding this comment

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

This allows "abort-marker" (abortFrameName) to be a value that the agent sends with profile.frame.type, but there's no semantic convention for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

@christos68k Does it make sense to create a separate issue for this, so we can merge this PR. Without it, the devfiler won't work with the latest agent.

Copy link
Member

@christos68k christos68k left a comment

Choose a reason for hiding this comment

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

LGTM (we should also add abort-marker / abortFrameName to semconv in a separate PR)

libpf/interpretertype.go Outdated Show resolved Hide resolved
Co-authored-by: Christos Kalkanis <[email protected]>
Copy link
Contributor

@rockdaboot rockdaboot left a comment

Choose a reason for hiding this comment

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

LGTM

@florianl florianl merged commit 9be4ee2 into main Oct 22, 2024
23 checks passed
@florianl florianl deleted the flo-drop-type-index branch October 22, 2024 06:44
florianl added a commit that referenced this pull request Oct 25, 2024
Signed-off-by: Florian Lehner <[email protected]>
Co-authored-by: Christos Kalkanis <[email protected]>
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.

4 participants