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

Generate fields for APM package #4432

Merged
merged 21 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export GO111MODULE=on

GOOSBUILD=./build/$(shell go env GOOS)
APPROVALS=$(GOOSBUILD)/approvals
GENPACKAGE=$(GOOSBUILD)/genpackage
GOIMPORTS=$(GOOSBUILD)/goimports
GOLICENSER=$(GOOSBUILD)/go-licenser
GOLINT=$(GOOSBUILD)/golint
Expand Down Expand Up @@ -75,6 +76,10 @@ check-approvals: $(APPROVALS)
check: $(MAGE) check-headers
@$(MAGE) check

.PHONY: gen-package
gen-package: $(GENPACKAGE)
@$(GENPACKAGE)

.PHONY: bench
bench:
@go test -benchmem -run=XXX -benchtime=100ms -bench='.*' ./...
Expand Down Expand Up @@ -105,7 +110,7 @@ docker-compose.override.yml:
# Rules for updating config files, fields.yml, etc.
##############################################################################

update: fields go-generate add-headers copy-docs notice $(MAGE)
update: fields gen-package go-generate add-headers copy-docs notice $(MAGE)
jalvz marked this conversation as resolved.
Show resolved Hide resolved
@$(MAGE) update

fields_sources=\
Expand Down Expand Up @@ -247,6 +252,11 @@ $(MAGE): magefile.go $(BIN_MAGE)
$(STATICCHECK): go.mod
go build -o $@ honnef.co/go/tools/cmd/staticcheck

.PHONY: $(GENPACKAGE)
$(GENPACKAGE):
@go build -o $@ github.com/elastic/apm-server/apmpackage/cmd/gen-package


$(GOLINT): go.mod
go build -o $@ golang.org/x/lint/golint

Expand Down
17 changes: 10 additions & 7 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ Contents of "LICENSE":
--------------------------------------------------------------------
Dependency: github.com/elastic/beats/v7
Version: v7.0.0
Revision: 0fda3061815d
Revision: 633285e75a03
License type (autodetected): Apache-2.0

--------------------------------------------------------------------
Expand Down Expand Up @@ -976,7 +976,8 @@ License type (autodetected): Apache-2.0

--------------------------------------------------------------------
Dependency: github.com/elastic/go-ucfg
Version: v0.8.3
Version: v0.8.4
Revision: 1232bd4774a6
License type (autodetected): Apache-2.0

--------------------------------------------------------------------
Expand All @@ -993,7 +994,8 @@ Contents of "NOTICE.txt":

--------------------------------------------------------------------
Dependency: github.com/elastic/gosigar
Version: v0.12.0
Version: v0.10.6
Revision: f115143bb233
License type (autodetected): Apache-2.0
Contents of "NOTICE":

Expand All @@ -1009,7 +1011,7 @@ Contents of "NOTICE":

--------------------------------------------------------------------
Dependency: github.com/fatih/color
Version: v1.10.0
Version: v1.9.0
License type (autodetected): MIT
Contents of "LICENSE.md":

Expand Down Expand Up @@ -3571,7 +3573,8 @@ License type (autodetected): Apache-2.0

--------------------------------------------------------------------
Dependency: go.elastic.co/apm
Version: v1.9.0
Version: v1.8.1
Revision: 2aef45b9cf4b
License type (autodetected): Apache-2.0
Contents of "NOTICE":

Expand Down Expand Up @@ -3902,7 +3905,7 @@ Contents of "LICENSE":

--------------------------------------------------------------------
Dependency: golang.org/x/net
Revision: 69a78807bb2b
Revision: 942e2f445f3c
License type (autodetected): BSD-3-Clause
Contents of "LICENSE":

Expand Down Expand Up @@ -4004,7 +4007,7 @@ Contents of "LICENSE":

--------------------------------------------------------------------
Dependency: golang.org/x/sys
Revision: 5cba982894dd
Revision: 201ba4db2418
License type (autodetected): BSD-3-Clause
Contents of "LICENSE":

Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ To generate required configuration files and templates run:
make update
```

### Generate package

APM-Server includes a script to generate an integration package to run with Fleet.
To Generate a package run:

```
make fields gen-package
```

That command takes the existing `fields.yml` files and split them into `ecs.yml` and `fields.yml` files for each data stream type.
It also generates a `README.md` with a field reference that will be shown in the integration package.

After generating a package, `apmpackage/apm` should be manually copied to `elastic/integrations`.
Then follow instructions in https://github.com/elastic/integrations/blob/master/CONTRIBUTING.md.

### Cleanup

To clean APM Server source code, run the following commands:
Expand Down
12 changes: 12 additions & 0 deletions apmpackage/apm/0.1.0/data_stream/logs/fields/base-fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: '@timestamp'
type: date
description: Event timestamp.
- name: data_stream.type
type: constant_keyword
description: Data stream type.
- name: data_stream.dataset
type: constant_keyword
description: Data stream dataset.
- name: data_stream.namespace
type: constant_keyword
description: Data stream namespace.
Loading