Skip to content

Commit

Permalink
fixup: add OTel requirement level
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Lehner <[email protected]>
  • Loading branch information
florianl committed Nov 11, 2024
1 parent d872678 commit 792c3cf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions reporter/otlp_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ type traceEvents struct {

// attrKeyValue is a helper to populate Profile.attribute_table.
type attrKeyValue[T string | int64] struct {
key string
value T
key string
// Set to true for OTel SemConv attributes with RequirementL: Required
required bool
value T
}

// OTLPReporter receives and transforms information to be OTLP/profiles compliant.
Expand Down Expand Up @@ -753,7 +755,7 @@ func addProfileAttributes[T string | int64](profile *profiles.Profile,

switch val := any(attr.value).(type) {
case string:
if val == "" {
if !attr.required && val == "" {
return
}
attributeCompositeKey = attr.key + "_" + val
Expand Down

0 comments on commit 792c3cf

Please sign in to comment.