From 4ab384b2bc8cbb6984faf5104e5c784cb18003fe Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Fri, 14 Oct 2022 04:08:17 -0600 Subject: [PATCH] [pkg/ottl] Rename instrumentation_library to instrumentation_scope in ottltraces (#14933) --- .chloggen/ottl-fix-trace-is.yaml | 16 ++++++++++++++++ pkg/ottl/contexts/ottltraces/traces.go | 2 +- pkg/ottl/contexts/ottltraces/traces_test.go | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100755 .chloggen/ottl-fix-trace-is.yaml diff --git a/.chloggen/ottl-fix-trace-is.yaml b/.chloggen/ottl-fix-trace-is.yaml new file mode 100755 index 000000000000..d87a28c75448 --- /dev/null +++ b/.chloggen/ottl-fix-trace-is.yaml @@ -0,0 +1,16 @@ +# 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: pkg/ottl + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Renames accessor for instrumentation scope from `instrumentation_library` to `instrumentation_scope` to match documentation + +# One or more tracking issues related to the change +issues: [14933] + +# (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: diff --git a/pkg/ottl/contexts/ottltraces/traces.go b/pkg/ottl/contexts/ottltraces/traces.go index aafc3b57521d..b5970a3af7bf 100644 --- a/pkg/ottl/contexts/ottltraces/traces.go +++ b/pkg/ottl/contexts/ottltraces/traces.go @@ -95,7 +95,7 @@ func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], erro switch path[0].Name { case "resource": return ottlcommon.ResourcePathGetSetter[TransformContext](path[1:]) - case "instrumentation_library": + case "instrumentation_scope": return ottlcommon.ScopePathGetSetter[TransformContext](path[1:]) case "trace_id": if len(path) == 1 { diff --git a/pkg/ottl/contexts/ottltraces/traces_test.go b/pkg/ottl/contexts/ottltraces/traces_test.go index 5fb93bbe8bba..874594e7752c 100644 --- a/pkg/ottl/contexts/ottltraces/traces_test.go +++ b/pkg/ottl/contexts/ottltraces/traces_test.go @@ -494,7 +494,7 @@ func Test_newPathGetSetter(t *testing.T) { name: "instrumentation_scope", path: []ottl.Field{ { - Name: "instrumentation_library", + Name: "instrumentation_scope", }, }, orig: refIS,