-
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] Add STAN (NATS streaming) module #14839
Conversation
f5e9331
to
4d9ccfc
Compare
e4b2602
to
f9ccafe
Compare
absPath, _ := filepath.Abs("./_meta/test/") | ||
|
||
response, _ := ioutil.ReadFile(absPath + "/channels.json") | ||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
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.
Might be worth moving some of the setup to another function?
if err != nil { | ||
return mb.Event{}, err | ||
} | ||
if err != nil { |
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.
We're checking the same error twice here, it looks like?
if evt, err = eventMapping(chWrapper); err != nil { | ||
r.Error(errors.Wrap(err, "failure to map channel to its schema")) | ||
} | ||
if !r.Event(evt) { |
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.
There's been some debate about this. The only time r.Event
will return false
is when the underlying channel is closed and metricbeat is shutting down. I believe we decide that if we check this in a loop (which we should) It shouldn't be reported as an error and we should just return.
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
784ada4
to
79743d4
Compare
Signed-off-by: chrismark <[email protected]>
Thanks for the suggestions @odacremolbap ! Updates were pushed. |
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
11a4b26
to
644e6e8
Compare
Signed-off-by: chrismark <[email protected]>
644e6e8
to
e20c930
Compare
As discussed offline, let's try to make mage log the output of |
Signed-off-by: chrismark <[email protected]>
Signed-off-by: chrismark <[email protected]>
(cherry picked from commit 10c741a)
This PR cherry-picks the commits of @devon-kim
from 7.2...devon-kim:ops-1844-stan-metricbeat so as to be merged to
beats/master
as part of #14629.cc: @exekias
Manual testing
docker build -t stan_test .
(run this command underx-pack/metricbeat/module/stan/_meta
)docker run -p 8222:8222 stan_test
(Note that default fetching period is 60secs, so this might should be changed for the testing)