Skip to content

Add design doc for Go labels#465

Merged
fabled merged 4 commits intoopen-telemetry:mainfrom
parca-dev:go-labels-dd
Jun 27, 2025
Merged

Add design doc for Go labels#465
fabled merged 4 commits intoopen-telemetry:mainfrom
parca-dev:go-labels-dd

Conversation

@gnurizen
Copy link
Copy Markdown
Contributor

No description provided.

@gnurizen gnurizen marked this pull request as ready for review May 19, 2025 21:23
@gnurizen gnurizen requested review from a team as code owners May 19, 2025 21:23
Comment thread design-docs/00002-custom-labels/README.md Outdated
Co-authored-by: Felix Geisendörfer <felix@felixge.de>
Comment thread design-docs/00002-custom-labels/README.md
Comment thread design-docs/00002-custom-labels/README.md Outdated
- When disabled custom labels has little to no impact on performance or memory usage of the profiler
- Custom labels should be limited so that even if a program has thousands of eligible labels the number supported is reasonably small (mostly enforced by eBPF itself)
- Custom labels should be short and have fixed memory overhead
- The custom labels should be made available to the reporter backend but otherwise it should be left up to implementors what to do with them
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To fit into OTel it would be great to make the costum labels available with the OTel SemConv. Package reporter should just be an implementation detail.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How does one make something available with the OTel SemConv package?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Taking environment variable as example, information like labels can be provided as attribute:

attrMgr.AppendOptionalString(
sample.AttributeIndices(),
attribute.Key("env."+key),
value)

From a quick lock, currently there is no specific OTel SemConv for labels afaict. But we should use a label that is commonly agreed until there is a OTel SemConv variant. Where this label key/value pair is used, e.g. in package reporter, then just becomes an implementation detail.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So should I add something like this to the custom labels PR:

https://gist.github.com/gnurizen/1b2c6bd8904a603d8ed621d57e28c83a

Comment thread design-docs/00002-custom-labels/README.md
Comment thread design-docs/00002-custom-labels/README.md Outdated
Copy link
Copy Markdown
Member

@florianl florianl left a comment

Choose a reason for hiding this comment

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

Just some minor nits. The overall idea sounds good to me.

Copy link
Copy Markdown
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.

Should we also merge this now since the PR got merged? @gnurizen if there's follow up work that includes changes to this design document we can open a new PR.

@fabled fabled merged commit f01b436 into open-telemetry:main Jun 27, 2025
25 checks passed
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.

5 participants