-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Metricbeat: Canonicalize MBean names in Jolokia module #7321
Metricbeat: Canonicalize MBean names in Jolokia module #7321
Conversation
c2374dd
to
a84cbbf
Compare
jenkins, test this again, please |
return errors.Errorf("metric key '%v' for mbean '%s' not found in mapping (%+v)", attributeName, requestMbeanName, mapping) | ||
// This shouldn't ever happen, if it does it is probably that some of our | ||
// assumptions when building the request and the mapping is wrong. | ||
logp.Debug("jolokia.jmx", fmt.Sprintf("mapping: %+v", mapping)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need the fmt.Sprintf
part here, you can write:
logp.Debug("jolokia.jmx", "mapping: %+v", mapping)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or you can use Debugw
with a the structured logger with a "jolokia" context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better without Sprintf
yes, thanks :)
We were setting the `canonicalNaming` option to `false` in requests to Jolokia, assuming that it should leave MBean names in responses as they are. We need that for mappings to work. But in some scenarios, as when using wildcards, Jolokia is responding with canonicalized names, what breaks mappings. This change canonicalizes names from config only for mappings and the pre-built request. If we see that after setting `canonicalNaming` to `true` there is some scenario in which Jolokia replies with non-canonicalized names, then we'd have to canonicalize also MBeans for responses, or rethink how we do the mapping.
a84cbbf
to
5e98ce5
Compare
We were setting the `canonicalNaming` option to `false` in requests to Jolokia, assuming that it should leave MBean names in responses as they are. We need that for mappings to work. But in some scenarios, as when using wildcards, Jolokia is responding with canonicalized names, what breaks mappings. This change canonicalizes names from config only for mappings and the pre-built request. If we see that after setting `canonicalNaming` to `true` there is some scenario in which Jolokia replies with non-canonicalized names, then we'd have to canonicalize also MBeans for responses, or rethink how we do the mapping. (cherry picked from commit ef70ea0)
…okia module (#7385) We were setting the `canonicalNaming` option to `false` in requests to Jolokia, assuming that it should leave MBean names in responses as they are. We need that for mappings to work. But in some scenarios, as when using wildcards, Jolokia is responding with canonicalized names, what breaks mappings. This change canonicalizes names from config only for mappings and the pre-built request. If we see that after setting `canonicalNaming` to `true` there is some scenario in which Jolokia replies with non-canonicalized names, then we'd have to canonicalize also MBeans for responses, or rethink how we do the mapping. (cherry picked from commit ef70ea0)
… in Jolokia module (elastic#7385) We were setting the `canonicalNaming` option to `false` in requests to Jolokia, assuming that it should leave MBean names in responses as they are. We need that for mappings to work. But in some scenarios, as when using wildcards, Jolokia is responding with canonicalized names, what breaks mappings. This change canonicalizes names from config only for mappings and the pre-built request. If we see that after setting `canonicalNaming` to `true` there is some scenario in which Jolokia replies with non-canonicalized names, then we'd have to canonicalize also MBeans for responses, or rethink how we do the mapping. (cherry picked from commit 7dbdf8f)
We were setting the
canonicalNaming
option tofalse
in requests toJolokia, assuming that it should leave MBean names in responses as they
are. We need MBeans in request and in responses to be the same for
mappings to work.
But in some scenarios, as when using wildcards, Jolokia is responding with
canonicalized names, what breaks mappings.
This change canonicalizes names from config only for mappings and the
pre-built request. If we see that after setting
canonicalNaming
totrue
there is some scenario in which Jolokia replies with non-canonicalized
names, then we'd have to canonicalize also MBeans for responses, or rethink
how we do the mapping.