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

[Metricbeat] Release Golang module as GA. #10312

Merged
merged 10 commits into from
Feb 5, 2019
Merged

Conversation

ruflin
Copy link
Member

@ruflin ruflin commented Jan 24, 2019

  • Add integration tests. Use metricbeat as Golang example app.
  • Add data.json

@ruflin ruflin added module review Metricbeat Metricbeat needs_backport PR is waiting to be backported to other branches. Team:Integrations Label for the Integrations team labels Jan 24, 2019
@ruflin ruflin requested a review from jsoriano January 24, 2019 11:46
@ruflin ruflin requested review from a team as code owners January 24, 2019 11:46
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It LGTM, but I'd suggest to use a smaller image, or would it be an option to start an http listener with pprof in the test itself?

@ruflin ruflin force-pushed the golang-ga branch 2 times, most recently from 9790b79 to 02deb7f Compare January 25, 2019 12:20
@ruflin ruflin self-assigned this Jan 25, 2019
@ruflin ruflin force-pushed the golang-ga branch 2 times, most recently from a4bd397 to 430f254 Compare January 29, 2019 08:46
@ruflin
Copy link
Member Author

ruflin commented Jan 29, 2019

I'm getting the following error on CI:

01-29T09:37:34.087Z\tWARN\ttransport/tcp.go:53\tDNS lookup failure "golang": lookup golang on 127.0.0.11:53: no such host\n2019-01-29T09:37:34.088Z\tDEBUG\t[publisher]\tpipeline/processor.go:305\tPublish event: {\n  "@timestamp": "2019-01-29T09:37:34.044Z",\n  "@metadata": {\n    "beat": "metricbeat",\n    "type": "_doc",\n    "version": "7.0.0"\n  },\n  "agent": {\n    "id": "eca3e1b9-16b5-4009-83bf-057a137dbe35",\n    "version": "7.0.0",\n    "type": "metricbeat",\n    "ephemeral_id": "844e0bd2-24e7-4cef-b653-16b2744c23e7",\n    "hostname": "b4604df432a9"\n  },\n  "metricset": {\n    "name": "heap"\n  },\n  "service": {\n    "address": "golang:6060",\n    "type": "golang"\n  },\n  "error": {\n    "message": "error making http request: Get http://golang:6060/debug/vars: lookup golang on 127.0.0.11:53: no such host"\n  },\n  "event": {\n    "dataset": "golang.heap",\n    "module": "golang",\n    "duration": 43325852\n  },\n  "host": {\n    "name": "b4604df432a9"\n  },\n  "ecs": {\n    "version": "1.0.0-beta2"\n  }\n}\n

I wonder if the healthcheck is wrong or not waiting long enough. At the same time there seems to be something odd with the host?

@@ -50,7 +50,7 @@ func WriteEvent(f mb.EventFetcher, t testing.TB) error {
}

fullEvent := CreateFullEvent(f, event)
WriteEventToDataJSON(t, fullEvent, "")
WriteEventToDataJSON(t, fullEvent, ".")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsoriano Not sure if I have to make this change because of #10367 Seems to have worked a few days ago without the dot. No deal breaker.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is related for sure 🙁 I'll make "" to behave as "." for BC.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruflin
Copy link
Member Author

ruflin commented Jan 29, 2019

For some reason it seems the http pprof endpoint and starts and stops again inside the container.

@jsoriano
Copy link
Member

jsoriano commented Feb 5, 2019

Failing tests are related

@ruflin
Copy link
Member Author

ruflin commented Feb 5, 2019

Yes, and I can't really figure out what happens :-(

@ruflin ruflin removed the needs_backport PR is waiting to be backported to other branches. label Feb 5, 2019
@jsoriano
Copy link
Member

jsoriano commented Feb 5, 2019

@ruflin GOLANG_HOST has a value now and it is used in test_golang.py for the listening address. I think this should be replaced by 0.0.0.0 (or localhost):

        proc = self.start_beat(
            extra_args=[
                "-httpprof",
                "0.0.0.0" +
                ":" +
                os.getenv(
                    'GOLANG_PORT',
                    '6060')])

@ruflin
Copy link
Member Author

ruflin commented Feb 5, 2019

@jsoriano Exactly what I was looking for. For now I event set it to localhost only as this should work as the system tests run on the same machine as the binary itself, so no external access needed 🤞

@ruflin ruflin merged commit 651665a into elastic:master Feb 5, 2019
@ruflin ruflin deleted the golang-ga branch February 5, 2019 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metricbeat Metricbeat module review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants