Skip to content

Commit

Permalink
reporter: use semantic convention to report frame type
Browse files Browse the repository at this point in the history
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 <florian.lehner@elastic.co>
  • Loading branch information
florianl committed Sep 24, 2024
1 parent 42ec3c1 commit 162de1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libpf/interpretertype.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ var interpreterTypeToString = map[InterpreterType]string{
UnknownInterp: "unknown",
PHP: "php",
PHPJIT: "phpjit",
Python: "python",
Python: "cpython",
Native: "native",
Kernel: "kernel",
HotSpot: "jvm",
Ruby: "ruby",
Perl: "perl",
V8: "v8",
V8: "v8js",
Dotnet: "dotnet",
APMInt: "apm-integration",
}
Expand Down
9 changes: 6 additions & 3 deletions reporter/otlp_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,16 @@ 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{
{key: "profile.frame.type", value: traceInfo.frameTypes[i].String()},
},
attributeMap)

loc := &profiles.Location{
// Id - Optional element we do not use.
TypeIndex: getStringMapIndex(stringMap,
traceInfo.frameTypes[i].String()),
Address: uint64(traceInfo.linenos[i]),
// IsFolded - Optional element we do not use.
// Attributes - Optional element we do not use.
Attributes: frameAttributes,
}

switch frameKind := traceInfo.frameTypes[i]; frameKind {
Expand Down

0 comments on commit 162de1f

Please sign in to comment.