I am trying to add new fields to the target that is sent out as a request from Grafana. This is a part of a custom data source that I have developed based on the SimpleJSON plugin. I am able to get the new values set by the user from the html page all the way to “datasource.js” page, “buildQueryParameters” function, but the execution fails here at this line
( options.targets = _.filter(options.targets, function (target))* with an error that states:
"angular.js:14700 TypeError: Cannot create property ‘targets’ on string ‘inputvalueXXX’ ",**
as a result options.target never gets created and hence the target json is not getting populated with the new values.
This is what I am trying to achieve: (ideal case json request: want to add customfields to target)
But I am not able to proceed because of the error. Is there a predefined list of target elements somewhere that I need to change as well to add new segments? Please let me know what I am missing.
Could you’ll please advise how I can add new values to the target variable in this case?
Any pointers to proceed from here would be greatly appreciated.