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

Replace golang with Go #7948

Merged
merged 2 commits into from Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/devguide/contributing.asciidoc
Expand Up @@ -45,8 +45,8 @@ Beats].
=== Setting Up Your Dev Environment

The Beats are Go programs, so install the latest version of
http://golang.org/[golang] if you don't have it already. The current Go version
used for development is Golang {go-version}.
http://golang.org/[Go] if you don't have it already. The current Go version
used for development is Go {go-version}.

The location where you clone is important. Please clone under the source
directory of your `GOPATH`. If you don't have `GOPATH` already set, you can
Expand Down
4 changes: 2 additions & 2 deletions docs/devguide/create-metricset.asciidoc
Expand Up @@ -69,13 +69,13 @@ https://github.com/elastic/beats/blob/master/metricbeat/scripts/module/metricset
include::../../metricbeat/scripts/module/metricset/metricset.go.tmpl[]
----

The `package` clause and `import` declaration are part of the base structure of each Golang file. You should only
The `package` clause and `import` declaration are part of the base structure of each Go file. You should only
modify this part of the file if your implementation requires more imports.

[float]
===== Initialisation

The init method registers the metricset with the central registry. In Golang the `init()` function is called
The init method registers the metricset with the central registry. In Go the `init()` function is called
before the execution of all other code. This means the module will be automatically registered with the global registry.

The `New` method, which is passed to `AddMetricSet`, will be called after the setup of the module and before starting to fetch data. You normally don't need to change this part of the file.
Expand Down
2 changes: 1 addition & 1 deletion docs/devguide/creating-beat-from-metricbeat.asciidoc
Expand Up @@ -7,7 +7,7 @@ own metricsets.
[float]
==== Requirements

To create your own Beat, you must have Golang {go-version} or later installed, and the `$GOPATH`
To create your own Beat, you must have Go {go-version} or later installed, and the `$GOPATH`
must be set up correctly. In addition, the following tools are required:

* https://www.python.org/downloads/[python]
Expand Down
4 changes: 2 additions & 2 deletions docs/devguide/metricset-details.asciidoc
Expand Up @@ -145,8 +145,8 @@ It's important to also add tests for your metricset. There are three different t
* system tests

We recommend that you use all three when you create a metricset. Unit tests are
written in Golang and have no dependencies. Integration tests are also written
in Golang but require the service from which the module collects metrics to also be running.
written in Go and have no dependencies. Integration tests are also written
in Go but require the service from which the module collects metrics to also be running.
System tests for Metricbeat also require the service to be running in most cases and are
written in Python based on our small Python test framework.
We use `virtualenv` to deal with Python dependencies.
Expand Down
2 changes: 1 addition & 1 deletion docs/devguide/modules-dev-guide.asciidoc
Expand Up @@ -260,7 +260,7 @@ input configuration are documented in the
the Filebeat documentation.

The template files use the templating language defined by the
https://golang.org/pkg/text/template/[Golang standard library].
https://golang.org/pkg/text/template/[Go standard library].

Here is another example that also configures multiline stitching:

Expand Down
2 changes: 1 addition & 1 deletion docs/devguide/newbeat.asciidoc
Expand Up @@ -77,7 +77,7 @@ daemonzing, and Windows service handling, and data processing modules.

image:./images/beat_overview.png[Beat overview architecture]

The event that you create is a JSON-like object (Golang type `map[string]interface{}`) that
The event that you create is a JSON-like object (Go type `map[string]interface{}`) that
contains the collected data to send to the publisher. At a minimum, the event object
must contain a `@timestamp` field and a `type` field. Beyond
that, events can contain any additional fields, and they can be created as often
Expand Down
2 changes: 1 addition & 1 deletion docs/devguide/newdashboards.asciidoc
Expand Up @@ -208,7 +208,7 @@ make update
=== Exporting New and Modified Beat Dashboards

To export all the dashboards for any Elastic Beat or any community Beat, including any new or modified dashboards and all dependencies such as
visualizations, searches, you can use the Golang script `export_dashboards.go` from
visualizations, searches, you can use the Go script `export_dashboards.go` from
https://github.com/elastic/beats/tree/master/dev-tools/cmd/dashboards[dev-tools] for exporting Kibana 6.0 dashboards or later, and the Python script `export_5x_dashboards.py`
for exporting Kibana 5.x dashboards. See the dev-tools
https://github.com/elastic/beats/tree/master/dev-tools/README.md[readme] for more info.
Expand Down
22 changes: 11 additions & 11 deletions docs/devguide/testing.asciidoc
Expand Up @@ -5,20 +5,20 @@ Beats has a various sets of tests. This guide should help to understand how the

In general there are two major test suites:

* Tests written in Golang
* Tests written in Go
* Tests written in Python

The tests written in Golang use the https://golang.org/pkg/testing/[Golang Testing package]. The tests written in Python depend on http://nose.readthedocs.io/en/latest/[nosetests] and require a compiled and executable binary from the Golang code. The python test run a beat with a specific config and params and either check if the output is as expected or if the correct things show up in the logs.
The tests written in Go use the https://golang.org/pkg/testing/[Go Testing package]. The tests written in Python depend on http://nose.readthedocs.io/en/latest/[nosetests] and require a compiled and executable binary from the Go code. The python test run a beat with a specific config and params and either check if the output is as expected or if the correct things show up in the logs.

For both of the above test suites so called integration tests exists. Integration tests in Beats are tests which require an external system like Elasticsearch to test if the integration with this service works as expected. Beats provides in its testsuite docker containers and docker-compose files to start these environments but a developer can run the required services also locally.

==== Running Golang Tests
==== Running Go Tests

The golang tests can be executed in each Golang package by running `go test .`. This will execute all tests which don't don't require an external service to be running. To also run the Golang integration tests run `go test -tags=integration .`. It will require you to run the expected services on localhost.
The Go tests can be executed in each Go package by running `go test .`. This will execute all tests which don't don't require an external service to be running. To also run the Go integration tests run `go test -tags=integration .`. It will require you to run the expected services on localhost.

To run all non integration tests for a beat run `make unit`. This will execute all the tests which are not inside a `vendor` directory. If you want to have a coverage report for the tests which were run use `make unit-tests`. A coverage report will be generated under `build/coverage` directory.

All Golang tests are in the same package as the tested code itself and have the postfix `_test` in the file name. Most of the tests are in the same package as the rest of the code. Some of the tests which should be separate from the rest of the code or should not use private variables go under `{packagename}_test`.
All Go tests are in the same package as the tested code itself and have the postfix `_test` in the file name. Most of the tests are in the same package as the rest of the code. Some of the tests which should be separate from the rest of the code or should not use private variables go under `{packagename}_test`.


==== Running Python Tests
Expand All @@ -37,10 +37,10 @@ All Python tests are under `tests/system` directory.

This is a quick summary of the available test commands:

* `unit`: Golang tests
* `unit-tests`: Golang tests with coverage reports
* `integration-tests`: Golang tests with services in local docker
* `integration-tests-environment`: Golang tests inside docker with service in docker
* `unit`: Go tests
* `unit-tests`: Go tests with coverage reports
* `integration-tests`: Go tests with services in local docker
* `integration-tests-environment`: Go tests inside docker with service in docker
* `fast-system-tests`: Python tests
* `system-tests`: Python tests with coverage report
* `INTEGRATION_TESTS=1 system-tests`: Python tests with local services
Expand All @@ -50,7 +50,7 @@ This is a quick summary of the available test commands:

There are two experimental test commands:

* `benchmark-tests`: Running golang tests with `-bench` flag
* `benchmark-tests`: Running Go tests with `-bench` flag
* `load-tests`: Running system tests with `LOAD_TESTS=1` flag


Expand All @@ -60,7 +60,7 @@ If the tests were run to create a test coverage, the coverage report files can b

==== Race detection

All tests can be run with the Golang race detector enabled by setting the environment variable `RACE_DETECTOR=1`. This applies to tests in Golang and Python. For Python the test binary has to be recompile when the flag is changed. Having the race detection enabled will slow down the tests.
All tests can be run with the Go race detector enabled by setting the environment variable `RACE_DETECTOR=1`. This applies to tests in Go and Python. For Python the test binary has to be recompile when the flag is changed. Having the race detection enabled will slow down the tests.

==== Docker environment

Expand Down
2 changes: 1 addition & 1 deletion filebeat/docs/getting-started.asciidoc
Expand Up @@ -166,7 +166,7 @@ filebeat.inputs:
+
The input in this example harvests all files in the path `/var/log/*.log`, which means
that Filebeat will harvest all files in the directory `/var/log/` that end with `.log`. All patterns supported
by https://golang.org/pkg/path/filepath/#Glob[Golang Glob] are also supported here.
by https://golang.org/pkg/path/filepath/#Glob[Go Glob] are also supported here.
+
To fetch all files from a predefined level of subdirectories, the following pattern can be used:
`/var/log/*/*.log`. This fetches all `.log` files from the subfolders of `/var/log`. It does not
Expand Down
6 changes: 3 additions & 3 deletions filebeat/docs/inputs/input-log.asciidoc
Expand Up @@ -7,10 +7,10 @@
<titleabbrev>Log</titleabbrev>
++++

Use the `log` input to read lines from log files.
Use the `log` input to read lines from log files.

To configure this input, specify a list of glob-based <<input-paths,`paths`>>
that must be crawled to locate and fetch the log lines.
that must be crawled to locate and fetch the log lines.

Example configuration:

Expand Down Expand Up @@ -69,7 +69,7 @@ The `log` input supports the following configuration options plus the
===== `paths`

A list of glob-based paths that will be crawled and fetched. All patterns
supported by https://golang.org/pkg/path/filepath/#Glob[Golang Glob] are also
supported by https://golang.org/pkg/path/filepath/#Glob[Go Glob] are also
supported here. For example, to fetch all files from a predefined level of
subdirectories, the following pattern can be used: `/var/log/*/*.log`. This
fetches all `.log` files from the subfolders of `/var/log`. It does not
Expand Down
4 changes: 2 additions & 2 deletions libbeat/docs/outputconfig.asciidoc
Expand Up @@ -14,7 +14,7 @@
== Configure the output

ifdef::only-elasticsearch[]
You configure {beatname_uc} to write to Elasticsearch by setting options
You configure {beatname_uc} to write to Elasticsearch by setting options
in the `output.elasticsearch` section of the +{beatname_lc}.yml+ config file
endif::[]

Expand Down Expand Up @@ -207,7 +207,7 @@ The URL of the proxy to use when connecting to the Elasticsearch servers. The
value may be either a complete URL or a "host[:port]", in which case the "http"
scheme is assumed. If a value is not specified through the configuration file
then proxy environment variables are used. See the
https://golang.org/pkg/net/http/#ProxyFromEnvironment[golang documentation]
https://golang.org/pkg/net/http/#ProxyFromEnvironment[Go documentation]
for more information about the environment variables.

[[index-option-es]]
Expand Down
8 changes: 4 additions & 4 deletions libbeat/docs/overview.asciidoc
Expand Up @@ -13,9 +13,9 @@ for capturing:
Audit data:: https://www.elastic.co/products/beats/auditbeat[Auditbeat]
Log files:: https://www.elastic.co/products/beats/filebeat[Filebeat]
Availability:: https://www.elastic.co/products/beats/heartbeat[Heartbeat]
Metrics:: https://www.elastic.co/products/beats/metricbeat[Metricbeat]
Network traffic:: https://www.elastic.co/products/beats/packetbeat[Packetbeat]
Windows event logs:: https://www.elastic.co/products/beats/winlogbeat[Winlogbeat]
Metrics:: https://www.elastic.co/products/beats/metricbeat[Metricbeat]
Network traffic:: https://www.elastic.co/products/beats/packetbeat[Packetbeat]
Windows event logs:: https://www.elastic.co/products/beats/winlogbeat[Winlogbeat]

{beats} can send data directly to {es} or via
https://www.elastic.co/products/logstash[{ls}], where you can further process
Expand All @@ -31,7 +31,7 @@ To get started, see <<getting-started>>.

If you have a specific use case to solve, we encourage you to create a
<<community-beats,community Beat>>. We've created an infrastructure to simplify
the process. The _libbeat_ library, written entirely in Golang, offers the API
the process. The _libbeat_ library, written entirely in Go, offers the API
that all Beats use to ship data to Elasticsearch, configure the input options,
implement logging, and more. To learn how to create a new Beat, see the
{beatsdevguide}/index.html[Beats Developer Guide].
6 changes: 3 additions & 3 deletions metricbeat/docs/fields.asciidoc
Expand Up @@ -5239,15 +5239,15 @@ expvar
--
type: keyword

The cmdline of this golang program start with.
The cmdline of this Go program start with.


--

[float]
== heap fields

The golang program heap information exposed by expvar.
The Go program heap information exposed by expvar.



Expand All @@ -5256,7 +5256,7 @@ The golang program heap information exposed by expvar.
--
type: keyword

The cmdline of this golang program start with.
The cmdline of this Go program start with.


--
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/golang/expvar/_meta/docs.asciidoc
@@ -1,2 +1,2 @@
This is the `expvar` metricset of the Golang module.
Golang can expose its variables by the expvar API. With this metricset, you can collect all the expvar-exposed variables.
Go can expose its variables by the expvar API. With this metricset, you can collect all the expvar-exposed variables.
2 changes: 1 addition & 1 deletion metricbeat/module/golang/expvar/_meta/fields.yml
Expand Up @@ -7,4 +7,4 @@
- name: cmdline
type: keyword
description: >
The cmdline of this golang program start with.
The cmdline of this Go program start with.
2 changes: 1 addition & 1 deletion metricbeat/module/golang/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions metricbeat/module/golang/heap/_meta/fields.yml
@@ -1,13 +1,13 @@
- name: heap
type: group
description: >
The golang program heap information exposed by expvar.
The Go program heap information exposed by expvar.
release: beta
fields:
- name: cmdline
type: keyword
description: >
The cmdline of this golang program start with.
The cmdline of this Go program start with.

- name: gc
type: group
Expand Down