Skip to content
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

ITransaction.AddCustomAttribute should support Array arguments #2977

Open
nr-ahemsath opened this issue Jan 31, 2025 · 1 comment
Open

ITransaction.AddCustomAttribute should support Array arguments #2977

nr-ahemsath opened this issue Jan 31, 2025 · 1 comment
Labels
feature request To tag an issue after triage that is a feature instead of TD

Comments

@nr-ahemsath
Copy link
Member

The .NET agent API method ITransaction.AddCustomAttribute currently does not support values of type Array. The documentation says that unsupported types will have .ToString() called on them and treated as strings. This appears to be the current behavior; the following code:

        [Transaction]
        private static void CreateTransactionWithCustomAttributeArrayArgument(int length)
        {
            var eventAttributes = new string[length];
            for (int i = 0; i < length; i++) {
                eventAttributes[i] = $"foo{i}";
            }
            var tx = NewRelic.Api.Agent.NewRelic.GetAgent().CurrentTransaction;
            tx.AddCustomAttribute("ArrayAttributeTest", eventAttributes);
        }

results in the following atrribute attached to the transaction:
ArrayAttributeTest System.String[]

We have a customer request to support array custom attribute values "not via escaping & stringifying json & then using NRQL for parsing".

@nr-ahemsath nr-ahemsath added the feature request To tag an issue after triage that is a feature instead of TD label Jan 31, 2025
@workato-integration
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request To tag an issue after triage that is a feature instead of TD
Projects
None yet
Development

No branches or pull requests

1 participant