Skip to content

feat: deprecate legacy integration attributes#595

Open
rajrohanyadav wants to merge 3 commits intomasterfrom
feat-deprecate-legacy-attr
Open

feat: deprecate legacy integration attributes#595
rajrohanyadav wants to merge 3 commits intomasterfrom
feat-deprecate-legacy-attr

Conversation

@rajrohanyadav
Copy link
Contributor

@rajrohanyadav rajrohanyadav commented Oct 7, 2025

  • remove integration_version and integration_name
  • introduce a config to control if these attributes need to be set
❯ ./bin/darwin/nri-flex -config_dir test/configs -pretty -verbose
DEBU[0000] Function.isAvailable: enter                  
DEBU[0000] Function.isAvailable: exit status: false     
INFO[0000] com.newrelic.nri-flex                         GOARCH=arm64 GOOS=darwin version=Unknown-SNAPSHOT
DEBU[0000] config: git sync configuration not set       
WARN[0000] config: testing agent config, agent features will not be available 
WARN[0000] config: testing agent config, agent features will not be available 
DEBU[0000] config: running async                         name=splitByTest
DEBU[0000] config: processing apis                       apis=1 name=splitByTest
DEBU[0000] fetch: collect data                           name=splitByTest
DEBU[0000] config: running async                         name=commandExample
DEBU[0000] config: processing apis                       apis=1 name=commandExample
DEBU[0000] fetch: collect data                           name=commandExample
DEBU[0000] config: running async                         name=commandExample
DEBU[0000] config: processing apis                       apis=1 name=commandExample
DEBU[0000] fetch: collect data                           name=commandExample
DEBU[0000] config: running async                         name=splitByTest
DEBU[0000] config: processing apis                       apis=1 name=splitByTest
DEBU[0000] fetch: collect data                           name=splitByTest
DEBU[0000] config: running async                         name=splitByTest
DEBU[0000] config: processing apis                       apis=1 name=splitByTest
DEBU[0000] fetch: collect data                           name=splitByTest
DEBU[0000] commands: executing                           count=1 name=commandExample
DEBU[0000] commands: executing                           count=1 name=splitByTest
DEBU[0000] commands: executing                           count=1 name=commandExample
DEBU[0000] commands: executing                           count=1 name=splitByTest
DEBU[0000] commands: executing                           count=1 name=splitByTest
DEBU[0000] config: running async                         name=splitByTest
DEBU[0000] config: processing apis                       apis=1 name=splitByTest
DEBU[0000] fetch: collect data                           name=splitByTest
DEBU[0000] commands: executing                           count=1 name=splitByTest
DEBU[0000] command: running printf "message:hello\nvalue:100\nerror:false\n" 
DEBU[0000] processor-data: running data handler          name=splitByTest
DEBU[0000] config: finished variable processing apis     apis=1 name=splitByTest
DEBU[0000] command: running printf "message::bye\nvalue::20.9\nerror::true\n" 
DEBU[0000] processor-data: running data handler          name=splitByTest
DEBU[0000] command: running printf "message:hello\nvalue:100\nerror:false\n" 
DEBU[0000] processor-data: running data handler          name=splitByTest
DEBU[0000] config: finished variable processing apis     apis=1 name=splitByTest
DEBU[0000] config: finished variable processing apis     apis=1 name=splitByTest
DEBU[0000] command: running printf "message::bye\nvalue::20.9\nerror::true\n" 
DEBU[0000] processor-data: running data handler          name=splitByTest
DEBU[0000] config: finished variable processing apis     apis=1 name=splitByTest
DEBU[0000] command: failed                               context_err= err="exit status 1" exec="cat ../../test/payloads/jsonPlaceholderTodo.json" suggestion="if you are handling this error case, ignore"
DEBU[0000] processor-data: running data handler          name=commandExample
DEBU[0000] command: failed                               context_err= err="exit status 1" exec="cat ../../test/payloads/jsonPlaceholderTodo.json" suggestion="if you are handling this error case, ignore"
DEBU[0000] processor-data: running data handler          name=commandExample
DEBU[0000] config: finished variable processing apis     apis=1 name=commandExample
DEBU[0000] config: finished variable processing apis     apis=1 name=commandExample
INFO[0000] flex: completed processing configs            configs=6
{
        "name": "com.newrelic.nri-flex",
        "protocol_version": "3",
        "integration_version": "Unknown-SNAPSHOT",
        "data": [
                {
                        "metrics": [
                                {
                                        "error": "false",
                                        "event_type": "MessageLegacySample",
                                        "flex.commandTimeMs": 167,
                                        "integration_name": "com.newrelic.nri-flex",
                                        "integration_version": "Unknown-SNAPSHOT",
                                        "message": "hello",
                                        "value": 100
                                },
                                {
                                        "error": "true",
                                        "event_type": "MessageLegacySample",
                                        "flex.commandTimeMs": 169,
                                        "integration_name": "com.newrelic.nri-flex",
                                        "integration_version": "Unknown-SNAPSHOT",
                                        "message": "bye",
                                        "value": 20.9
                                },
                                {
                                        "error": "false",
                                        "event_type": "MessageSample",
                                        "flex.commandTimeMs": 169,
                                        "message": "hello",
                                        "value": 100
                                },
                                {
                                        "error": "true",
                                        "event_type": "MessageSample",
                                        "flex.commandTimeMs": 170,
                                        "message": "bye",
                                        "value": 20.9
                                },
                                {
                                        "context_error": "",
                                        "error": "exit status 1",
                                        "error_exec": "cat ../../test/payloads/jsonPlaceholderTodo.json",
                                        "error_msg": "cat: ../../test/payloads/jsonPlaceholderTodo.json: No such file or directory\n",
                                        "event_type": "commandJsonOutSample",
                                        "myCustomAttr": "theValue"
                                },
                                {
                                        "context_error": "",
                                        "error": "exit status 1",
                                        "error_exec": "cat ../../test/payloads/jsonPlaceholderTodo.json",
                                        "error_msg": "cat: ../../test/payloads/jsonPlaceholderTodo.json: No such file or directory\n",
                                        "event_type": "commandJsonOutSample",
                                        "integration_name": "com.newrelic.nri-flex",
                                        "integration_version": "Unknown-SNAPSHOT",
                                        "myCustomAttr": "theValue"
                                },
                                {
                                        "event_type": "flexStatusSample",
                                        "flex.Hostname": "C3JKHGMYPX",
                                        "flex.IntegrationVersion": "Unknown-SNAPSHOT",
                                        "flex.counter.ConfigsProcessed": 6,
                                        "flex.counter.EventCount": 6,
                                        "flex.counter.EventDropCount": 0,
                                        "flex.counter.MessageLegacySample": 2,
                                        "flex.counter.MessageSample": 2,
                                        "flex.counter.commandJsonOutSample": 2,
                                        "flex.time.elapsedMs": 177,
                                        "flex.time.endMs": 1759823126091,
                                        "flex.time.startMs": 1759823125914
                                }
                        ],
                        "inventory": {},
                        "events": []
                }
        ]
}

@rajrohanyadav rajrohanyadav force-pushed the feat-deprecate-legacy-attr branch 2 times, most recently from 559a17f to 43acbe1 Compare October 7, 2025 03:52
@coveralls
Copy link

coveralls commented Oct 7, 2025

Pull Request Test Coverage Report for Build 18368969351

Details

  • 0 of 13 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.005%) to 31.097%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/processor/create.go 0 13 0.0%
Totals Coverage Status
Change from base Build 18268432238: -0.005%
Covered Lines: 1970
Relevant Lines: 6335

💛 - Coveralls

@rajrohanyadav rajrohanyadav force-pushed the feat-deprecate-legacy-attr branch 3 times, most recently from 39b6b99 to b54c187 Compare October 7, 2025 06:00
* remove integration_version and integration_name
* introduce a config to control if these attributes need to be set
* add tests for legacy integration attribute config option
@rajrohanyadav rajrohanyadav force-pushed the feat-deprecate-legacy-attr branch from b54c187 to cbe07e1 Compare October 7, 2025 06:18
@rajrohanyadav rajrohanyadav marked this pull request as ready for review October 7, 2025 06:31
@rajrohanyadav rajrohanyadav requested a review from a team October 7, 2025 07:40
Copy link

@abhishuraina abhishuraina left a comment

Choose a reason for hiding this comment

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

Just added a few Nits

Copy link

@abhishuraina abhishuraina left a comment

Choose a reason for hiding this comment

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

Overall looks good I've added 2 small comments

Co-authored-by: abhishuraina <45932588+abhishuraina@users.noreply.github.com>
Copy link

@abhishuraina abhishuraina left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

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.

3 participants

Comments