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

[inputs.solr] Changed response format in Solr7 leaves plugin returning 0 for most values #3665

Closed
kingcrunch opened this issue Jan 12, 2018 · 8 comments
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@kingcrunch
Copy link

Bug report

Relevant telegraf.conf:

[[inputs.solr]]
  servers = ["http://localhost:8983"]

System info:

Telegraf: 1.5.1
Solr: 7.1 and Solr 7.2

Steps to reproduce:

  1. Setup Solr >=7.0 with Core
  2. Configure telegraf to use inputs.solr
  3. telegraf -config telegraf.conf -input-filter solr -test

Expected behavior:

Reasonable values are retrieved

Actual behavior:

Most values are simply 0

Additional info:

See https://gist.github.com/KingCrunch/37187347ddfb2ac4267cb3166c8b2680

This are outputs from /solr/a_core/admin/mbeans?... from one Solr 6.6 and one Solr 7.2. That are two different instances, so don't expect, that both has the same values.
I had to remove some values.

@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Jan 12, 2018
@ljagiello
Copy link
Contributor

Solr 7 was released after the telegraf plugin was created :(

@mkboudreau
Copy link
Contributor

I'd be interested in working on this as I'm looking at adding in Solr 3 compatibility (#3681) and adding in dataimporthandler data (#3682). I would love some discussion around what makes sense for implementation (separate plugin or version config flag or ???)

@danielnelson
Copy link
Contributor

We need to investigate all the details to decide, but I imagine we can do this in the same plugin. Ideally we can just handle both cases without a server_version = 7 style option, but that's an option too.

@mkboudreau
Copy link
Contributor

I've been looking through the solr docs as well as looking through the API request/responses, including http headers. I cannot find anything to give a good indication of server version in order to allow detection of the server version.

Here are the approaches I currently see (and maybe you see something I don't), but only two that appear to be feasible:

  1. Detect version from API somehow (does not appear to be feasible from what I can find)
  2. Use a config parameter, such as server_version
  3. Rework parsing to be more generic and do more type detection, where applicable. The drawback here is the code is fairly clean when it can make assumptions about the json and use json tags for unmarshalling.
  4. Use a separate plugin altogether (not desirable)

Thoughts?

@danielnelson
Copy link
Contributor

It depends on how different the versions end up being. I think we start with 3, and fallback to 2 if we see something that is radically different and can't coexist.

@mkboudreau
Copy link
Contributor

Yeah, that makes sense. I was kinda thinking the same thing, but I wanted to have the discussion first. My definition of radically different might be different than other people. ;)

@thePanz
Copy link

thePanz commented Feb 16, 2018

@mkboudreau http://localhost:8983/solr/admin/info/system?wt=json looks like it contains the solr version. (tested on Solr 6.6.0)

Still unsure if it is available by default and how it differs on different Solr versions

@danielnelson danielnelson added this to the 1.8.0 milestone Jun 12, 2018
@danielnelson
Copy link
Contributor

Closed by #4271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

5 participants