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

InfluxDB Publisher String Handling #198

Merged
merged 7 commits into from
Mar 18, 2021
Merged

Conversation

BrianJKoopman
Copy link
Member

Description

Add string support to the line protocol publishing in the InfluxDB publisher.

Related changes include splitting out the helper class and function from the InfluxDB Publisher agent file to ocs/agent/ like has been done with other Agents.

Motivation and Context

'line' and 'json' protocols in the InfluxDB python module have different format requirements for strings. This patch updates the line protocol to properly place strings in double quotes before publishing.

Splitting the helper code from the Agent to the OCS library enabled writing two small unit tests, one for timestamp formatting and one for data formatting with the 'line' protocol. In doing so, we also added some code to enforce UTC in the timestamp translation function. This makes sense, as InfluxDB by default expects UTC, and in the past having an OS with a non-UTC timezone has caused some confusion.

fixes #197

How Has This Been Tested?

Test build running on the system at Yale. Still requires testing with the ACU agent, as that's the one where we first noticed the poor string handling shown in #197.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Unless I am preparing a release, I have opened this PR onto the develop branch.

@BrianJKoopman
Copy link
Member Author

Testing with the ACU agent was successful, the publisher in 'line' protocol now properly handles strings.

@BrianJKoopman BrianJKoopman merged commit ff0c239 into develop Mar 18, 2021
@BrianJKoopman BrianJKoopman deleted the influxdb-string-handling branch March 18, 2021 14:23
@BrianJKoopman BrianJKoopman mentioned this pull request May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InfluxDB Publisher line protocol doesn't handle strings properly
1 participant