-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Remove lookup table access from profiles in ottl #40227
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Use this changelog template to create an entry for release notes. | ||
|
|
||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: breaking | ||
|
|
||
| # The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
| component: ottl | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Remove access to the profile lookup tables | ||
|
|
||
| # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
| issues: [40227] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| # These lines will be padded with 2 spaces and then inserted directly into the document. | ||
| # Use pipe (|) for multiline entries. | ||
| subtext: | ||
dmathieu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # If your change doesn't affect end users or the exported elements of any package, | ||
| # you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
| # Optional: The change log or logs in which this entry should be included. | ||
| # e.g. '[user]' or '[user, api]' | ||
| # Include 'user' if the change is relevant to end users. | ||
| # Include 'api' if there is a change to a library API. | ||
| # Default: '[user]' | ||
| change_logs: [user] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,22 +31,8 @@ func PathGetSetter[K ProfileContext](path ottl.Path[K]) (ottl.GetSetter[K], erro | |
| return accessSampleType[K](), nil | ||
| case "sample": | ||
| return accessSample[K](), nil | ||
| case "mapping_table": | ||
| return accessMappingTable[K](), nil | ||
| case "location_table": | ||
| return accessLocationTable[K](), nil | ||
| case "location_indices": | ||
| return accessLocationIndices[K](), nil | ||
| case "function_table": | ||
| return accessFunctionTable[K](), nil | ||
| case "attribute_table": | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also remove the If the plan is to abstract the internal format, I guess we wouldn't want them to be set manually, and some mechanism similar to the attributes would be provided. Is that correct?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The plan is to make the pdata upgrade possible.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree removing the _indices fields makes sense as well, and I'm happy to do it. But I'd rather do that in another PR in order to avoid stalling #40285 |
||
| return accessAttributeTable[K](), nil | ||
| case "attribute_units": | ||
| return accessAttributeUnits[K](), nil | ||
| case "link_table": | ||
| return accessLinkTable[K](), nil | ||
| case "string_table": | ||
| return accessStringTable[K](), nil | ||
| case "time_unix_nano": | ||
| return accessTimeUnixNano[K](), nil | ||
| case "time": | ||
|
|
@@ -113,34 +99,6 @@ func accessSample[K ProfileContext]() ottl.StandardGetSetter[K] { | |
| } | ||
| } | ||
|
|
||
| func accessMappingTable[K ProfileContext]() ottl.StandardGetSetter[K] { | ||
| return ottl.StandardGetSetter[K]{ | ||
| Getter: func(_ context.Context, tCtx K) (any, error) { | ||
| return tCtx.GetProfile().MappingTable(), nil | ||
| }, | ||
| Setter: func(_ context.Context, tCtx K, val any) error { | ||
| if v, ok := val.(pprofile.MappingSlice); ok { | ||
| v.CopyTo(tCtx.GetProfile().MappingTable()) | ||
| } | ||
| return nil | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| func accessLocationTable[K ProfileContext]() ottl.StandardGetSetter[K] { | ||
| return ottl.StandardGetSetter[K]{ | ||
| Getter: func(_ context.Context, tCtx K) (any, error) { | ||
| return tCtx.GetProfile().LocationTable(), nil | ||
| }, | ||
| Setter: func(_ context.Context, tCtx K, val any) error { | ||
| if v, ok := val.(pprofile.LocationSlice); ok { | ||
| v.CopyTo(tCtx.GetProfile().LocationTable()) | ||
| } | ||
| return nil | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| func accessLocationIndices[K ProfileContext]() ottl.StandardGetSetter[K] { | ||
| return ottl.StandardGetSetter[K]{ | ||
| Getter: func(_ context.Context, tCtx K) (any, error) { | ||
|
|
@@ -152,73 +110,6 @@ func accessLocationIndices[K ProfileContext]() ottl.StandardGetSetter[K] { | |
| } | ||
| } | ||
|
|
||
| func accessFunctionTable[K ProfileContext]() ottl.StandardGetSetter[K] { | ||
| return ottl.StandardGetSetter[K]{ | ||
| Getter: func(_ context.Context, tCtx K) (any, error) { | ||
| return tCtx.GetProfile().FunctionTable(), nil | ||
| }, | ||
| Setter: func(_ context.Context, tCtx K, val any) error { | ||
| if v, ok := val.(pprofile.FunctionSlice); ok { | ||
| v.CopyTo(tCtx.GetProfile().FunctionTable()) | ||
| } | ||
| return nil | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| func accessAttributeTable[K ProfileContext]() ottl.StandardGetSetter[K] { | ||
| return ottl.StandardGetSetter[K]{ | ||
| Getter: func(_ context.Context, tCtx K) (any, error) { | ||
| return tCtx.GetProfile().AttributeTable(), nil | ||
| }, | ||
| Setter: func(_ context.Context, tCtx K, val any) error { | ||
| if v, ok := val.(pprofile.AttributeTableSlice); ok { | ||
| v.CopyTo(tCtx.GetProfile().AttributeTable()) | ||
| } | ||
| return nil | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| func accessAttributeUnits[K ProfileContext]() ottl.StandardGetSetter[K] { | ||
| return ottl.StandardGetSetter[K]{ | ||
| Getter: func(_ context.Context, tCtx K) (any, error) { | ||
| return tCtx.GetProfile().AttributeUnits(), nil | ||
| }, | ||
| Setter: func(_ context.Context, tCtx K, val any) error { | ||
| if v, ok := val.(pprofile.AttributeUnitSlice); ok { | ||
| v.CopyTo(tCtx.GetProfile().AttributeUnits()) | ||
| } | ||
| return nil | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| func accessLinkTable[K ProfileContext]() ottl.StandardGetSetter[K] { | ||
| return ottl.StandardGetSetter[K]{ | ||
| Getter: func(_ context.Context, tCtx K) (any, error) { | ||
| return tCtx.GetProfile().LinkTable(), nil | ||
| }, | ||
| Setter: func(_ context.Context, tCtx K, val any) error { | ||
| if v, ok := val.(pprofile.LinkSlice); ok { | ||
| v.CopyTo(tCtx.GetProfile().LinkTable()) | ||
| } | ||
| return nil | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| func accessStringTable[K ProfileContext]() ottl.StandardGetSetter[K] { | ||
| return ottl.StandardGetSetter[K]{ | ||
| Getter: func(_ context.Context, tCtx K) (any, error) { | ||
| return tCtx.GetProfile().StringTable().AsRaw(), nil | ||
| }, | ||
| Setter: func(_ context.Context, tCtx K, val any) error { | ||
| return ctxutil.SetCommonTypedSliceValues[string](tCtx.GetProfile().StringTable(), val) | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| func accessTimeUnixNano[K ProfileContext]() ottl.StandardGetSetter[K] { | ||
| return ottl.StandardGetSetter[K]{ | ||
| Getter: func(_ context.Context, tCtx K) (any, error) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.