etichy / grafana-swis-datasource

DataSource plugin for grafana to access SolarWinds data via SWIS REST API
MIT License
52 stars 11 forks source link

EntityNotFoundException #4

Closed Netw0rkN1nja closed 4 years ago

Netw0rkN1nja commented 4 years ago

Hello @etichy ,

Solarwinds recently updated their table names and it looks like the Grafana SWIS Datasource can't find the new names in the SemanticChecker.

"SolarWinds.Data.Query.EntityNotFoundException: Source entity [SolarwindsOrion.dbo.InterfaceTraffic] not found in catalog at SolarWinds.Data.Query.Processor.SemanticChecker.HandleSourceEntityExpression(SourceExpression sourceExpression) at SolarWinds.Data.Query.Processor.SemanticChecker.Visit(SourceExpression sourceExpression) at SolarWinds.Data.Query.Swql.ParseTreeDuplicatorNoState.Visit(FromClause from) at SolarWinds.Data.Query.Processor.SemanticChecker.Visit(SelectStatement statement) at SolarWinds.Data.Query.Processor.SemanticChecker.Process(SelectStatement statement, PreProcessorState state, String replaceStatementTagWith) at SolarWinds.Data.Query.Processor.SemanticChecker.Process(SelectStatement statement, PreProcessorState state) at SolarWinds.Data.Query.Processor.PreProcessor.Process(SelectStatement selectStatement, PreProcessorState& preProcessorState) at SolarWinds.Data.Query.Engine.QueryProcessor.CompileQueryExecutionPlan(String query, IQueryExecutionContext context) at SolarWinds.InformationService.Core.QueryPlanCache.GetQueryPlan(String query, String username, Boolean federationEnabled, Func1 buildQueryPlan) at SolarWinds.InformationService.Core.InformationService.GetQueryExecutionPlan(String query, IIdentity currentIdentity, Boolean federationEnabled, IQueryExecutionContext queryExecutionContext) at SolarWinds.InformationService.Core.InformationService.RunQuery(String query, IDictionary2 parameters, IDataSerializer serializer, IMessageFormatterStrategy messageFormatterStrategy)"

Netw0rkN1nja commented 4 years ago

Looks like this may be an issue with Solarwinds itself as I get the same error message by running the query via Postman.

etichy commented 4 years ago

Does it happen for all queries? Can you give me your testing query? thanks

Netw0rkN1nja commented 4 years ago

https://solarwinds.company.com:17778/SolarWinds/InformationService/v3/Json/Query?query=

SELECT Interfaces.Caption, DateTime, Interfaces.InPercentUtil AS Download

FROM SolarwindsOrion.dbo.InterfaceTraffic

LEFT JOIN SolarwindsOrion.dbo.Nodes ON (Nodes.NodeID = InterfaceTraffic.NodeID)

LEFT JOIN SolarwindsOrion.dbo.Interfaces ON (Interfaces.InterfaceID = InterfaceTraffic.InterfaceID)

WHERE Interfaces.Circuit_Type = 'ISP' AND Interfaces.Caption like '%ISP2%' AND Nodes.City = '$Site' AND (DATETIME >= DATEADD(day,-29,GETDATE()))

Netw0rkN1nja commented 4 years ago

I have a ticket open with Solarwinds but no response yet. If I hear anything I will let you know.

etichy commented 4 years ago

Hi, this is not SWQL query, but it is more SQL query as I can see.

This is correct SWQL query

SELECT Interfaces.Caption, DateTime, Interfaces.InPercentUtil AS Download
FROM Orion.NPM.InterfaceTraffic as InterfaceTraffic
LEFT JOIN Orion.Nodes as Nodes ON (Nodes.NodeID = InterfaceTraffic.NodeID)
LEFT JOIN Orion.NPM.Interfaces as Interfaces ON (Interfaces.InterfaceID = InterfaceTraffic.InterfaceID)
WHERE Interfaces.Circuit_Type = 'ISP' AND 
Interfaces.Caption like '%ISP2%' 
AND Nodes.City = '$Site' 
AND (DATETIME >= ADDDAY(-29,GETUTCDATE()))

Also not sure what this query should provide. It will retrieve a lot of data. All interface historical data for last 29 days.

etichy commented 4 years ago

It's not issue, closing.