Boerderij / Varken

Standalone application to aggregate data from the Plex ecosystem into InfluxDB using Grafana as a frontend
MIT License
1.14k stars 132 forks source link

Libraries with Apostrophes Do Not Populate #118

Closed BzowK closed 5 years ago

BzowK commented 5 years ago

Describe the bug Within Grafana, I can query stats from all of my Plex libraries (via Tautulli) successfully except for ones with apostrophes. When attempting to make/edit a graph showing just the # of movies in a library titled something like "Children's Movies", the result is 0. I found this is the result for all libraries which include an apostrophe in its name.

To Reproduce Steps to reproduce the behavior:

  1. Name / rename a Plex library to include an apostrophe
  2. Sync & clean libraries within Tautulli
  3. Try to create a graph in Grafanas using the library (Query below)

Expected behavior For stats to be pulled for the library just like ones without an apostrophe

Example Query Below is the output from a query using the library "Movies" which works and displays a value. However, the issue is if I change "Movies" to "Children's Movies" (selected from list - not typed manually), it does not work and I get "0". When choosing the Query Inspector with "Children's Movies" selected, it seems to time out and doesn't display anything...

Object
xhrStatus:"complete"
request:Object
method:"GET"
url:"api/datasources/proxy/3/query"
params:Object
db:"varken"
q:"SELECT last("total") FROM "Tautulli" WHERE ("section_name" = 'Movies') AND time >= now() - 1d"
epoch:"ms"
data:null
precision:"ms"
response:Object
results:Array[1]
0:Object

Additional Notes

Environment:

Additional context That's about it. Doubt it makes a difference, but below are a few more notes...

Overall, I considered renaming the libraries; but since I share Plex with family I didn't want to confuse them (you'd be surprised :)) so thought I'd post first.

Thanks for the great work, guys - Appreciate it!

samwiseg0 commented 5 years ago

Have you tried the query directly with influx? I don't see how this is fixable and I believe this would be a Grafana bug/limitation?

BzowK commented 5 years ago

Sorry for late reply...

No, I haven't. I assume you mean from SSH, but beyond that not sure how. Ill play around with it later, but if you could suggest a string to try, I'd appreciate it.

Thanks

samwiseg0 commented 5 years ago

You could use the link below to query influx. But the command line would be ideal. That way we know if it’s a grafana issue or influx. We can sanitize the data if it’s influx. If grafana is handling it improperly then there should be a bug report created on their side.

https://github.com/Boerderij/Varken/wiki/Frequently-Asked-Questions#influx-q1

dirtycajunrice commented 5 years ago

Going to close this out for lack of movement. If you find that it is not a grafana issue let us know and we can look into sanitizing apostrophes.