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

Default display name format changed from version 4.x.x to 5.x.x

Open asenfter opened this issue 1 year ago • 4 comments

Hello everyone,

we encountered an issue when migrating from 4.2.0 to 5.x.x due to changes in the display name format. The new plugin configuration introduces the "Enable New Data Format" setting, which can be switched on or off.

Behavior:

  1. Enable New Data Format = unchecked:

    • Display name changes from <AF-Attribute-Name> to <AF-Element><pipe><AF-Attribute-Name>.
    • Example:
      • In version 4.2.0: pressure
      • In version 5.x.x: pump|pressure
  2. Enable New Data Format = checked:

    • Display name changes from <AF-Attribute-Name> to <AF-Attribute-Name> {element=<AF-Element> name=<AF-Attribute-Name> type=...}.
    • Example:
      • In version 4.2.0: pressure
      • In version 5.x.x: pressure {element=pump name=pressure type=...}

Issues: The following problems occurred when testing both options:

  • Field overrides by name in panel configuration no longer work as expected.
  • Referencing fields in standard panel transformations fails.
  • Series names changed in histograms, legends, ...
  • ...

Expected Behavior: We expected Enable New Data Format=unchecked to keep the exact display name format from version 4.2.0 for backward compatibility.

Was it intentional that the unchecked option differs from the old format? If not, can this be fixed in a future patch?

asenfter avatar Nov 26 '24 15:11 asenfter

Dear @coderReview I'd be really grateful if you could take a look. Thank you so much in advance!

asenfter avatar Dec 09 '24 14:12 asenfter

@asenfter I am not planning to move back to the old format in 4.2.0.

coderReview avatar Feb 19 '25 11:02 coderReview

Hi @coderReview thank for the answer. Do you consider merging a PR with possibility of enabling attribute name compatibility with version 4.x ?

This could work in following way:

  • Custom Configuration section will receive a new option - "Enable attribute name backward compatibility"
  • If the option enabled and an option "Enable new data format" is disabled, then backend will send {"name": "pressure"} instead of {"name": "pump|pressure"}

We could work on a PR if there are chances to add the functionality to version 5 of the plugin.

malaman avatar Feb 25 '25 14:02 malaman

@malaman feel free to provide the PR. This is an opensource project. More contributions the better.

coderReview avatar Feb 25 '25 17:02 coderReview