osisoftpi-grafana icon indicating copy to clipboard operation
osisoftpi-grafana copied to clipboard

Summaries does not work in 5.0.0

Open SC-66 opened this issue 1 year ago • 5 comments

In version 5.0.0 the "Summaries" works completely different compared to 4.2.0. It looks like a bug, if not then all our dashboards must be remade. First, this is the output in 4.2.0 when using Range for an attribute: image

And this is the same when using 5.0.0: image

  1. The element name is now shown before the attribute. This is not the same behavior as in 4.2.0.
  2. Time is now written "time". In 4.2.0 it was "Time". Why change?
  3. The Range summary is not working; It does not present the Range value of that attribute for selected time period (in this example: Today). Instead it shows the range for a set time period of 30 secs, why that time period, and logs it as separate values. The Range, and al other summarize types should use the time period set by the Grafana time picker. This is a completely new behavior which must be a bug. (Note: We are using webapi 2023 SP1)

SC-66 avatar Aug 21 '24 13:08 SC-66

Can this be fixed in 5.1.0?

SC-66 avatar Sep 03 '24 10:09 SC-66

  1. This was a change in naming
  2. That was a typo that was fixed
  3. I made some changes in v5.1.0 to use more options in PiWebAPI. If you can provide an example of the PiWebAPI Url to use I can check against what is being used

coderReview avatar Sep 06 '24 15:09 coderReview

Hello!

  1. Can it be changed back as it was? Or as an option to use? Having the element name before the attribute name for every data point cause makes it very difficult to use general (generic) transformations for all elements.

  2. OK!

  3. I might misunderstand what you mean by "example of the PiWebAPI Url to use" but for example, here is the query that works in 4.2.0 but not in 5.0.0: ( I cannot provide the 5.0.0 query since we cant use that version, we changed back to 4.2.0) In the example below "Range" is used, but we use all summaries types. image

{ "request": { "url": "api/datasources/proxy/uid/", "data": { "Req1": { "Method": "GET", "Resource": "https:///piwebapi/attributes?selectedFields=Type%3BDefaultUnitsName%3BDescription%3BWebId%3BName%3BPath&path=\\\\Applications\Mobile Machines\Grafana\GAR_111BRO|TotalDrilledMeters" }, "Req1001": { "Method": "GET", "ParentIds": [ "Req1" ], "Parameters": [ "$.Req1.Content.WebId" ], "Resource": "https:///piwebapi/streamsets/summary?startTime=2024-09-07T22:00:00.000Z&endTime=2024-09-08T21:59:59.999Z&intervals=6000&summaryType=Range&calculationBasis=EventWeighted&webId={0}" } }, "method": "POST", "hideFromInspector": false }, "response": { "Req1": { "Status": 200, "Headers": { "Content-Type": "application/json; charset=utf-8" }, "Content": { "WebId": "", "Name": "TotalDrilledMeters", "Description": "Total Drilled Meters", "Path": "\\\\Business Units\Garpenberg\Assets\Mine\Mobile Machines\Drilling and charging\Face drilling\GAR_111BRO|TotalDrilledMeters", "Type": "Double", "DefaultUnitsName": "meter" } }, "Req1001": { "Status": 200, "Headers": { "Content-Type": "application/json; charset=utf-8" }, "Content": { "Links": {}, "Items": [ { "WebId": "", "Name": "TotalDrilledMeters", "Path": "\\\\Business Units\Garpenberg\Assets\Mine\Mobile Machines\Drilling and charging\Face drilling\GAR_111BRO|TotalDrilledMeters", "Links": { "Source": "https:///piwebapi/attributes/" }, "Items": [ { "Type": "Range", "Value": { "Timestamp": "2024-09-07T22:00:00Z", "Value": 844.5999999999767, "UnitsAbbreviation": "m", "Good": true, "Questionable": false, "Substituted": false, "Annotated": false } } ] } ] } } } }

SC-66 avatar Sep 09 '24 05:09 SC-66

  1. You can use the Regex to remove it. Search: (.*)|(.*) and Replace: $2
  2. ok
  3. I will check but the URL should be the same

pvmagacho-nde avatar Sep 09 '24 17:09 pvmagacho-nde

These are the possible URLs:

  1. "streamsets/summary?startTime=2024-09-19T06:13:23Z&endTime=2024-09-19T18:13:23Z&summaryType=Range&summaryBasis=EventWeighted&summaryDuration=1h&sampleType=Interval&sampleInterval=1h&webId=
  2. streamsets/summary?startTime=2024-09-19T06:13:51Z&endTime=2024-09-19T18:13:51Z&summaryType=Range&summaryBasis=EventWeighted&summaryDuration=1h&webId=
  3. streamsets/summary?startTime=2024-09-19T06:14:05Z&endTime=2024-09-19T18:14:05Z&summaryType=Range&summaryBasis=EventWeighted&webId=

All are working

coderReview avatar Sep 19 '24 18:09 coderReview

Will be fixed in v5.1.0 final. This will allow for better migration.

pvmagacho-nde avatar Nov 01 '24 17:11 pvmagacho-nde