From c47591278467fcb884017df86bb30b88e9fc7734 Mon Sep 17 00:00:00 2001 From: Dan Jaglowski Date: Thu, 12 May 2022 12:24:47 -0400 Subject: [PATCH] [pkg/stanza] Remove files relating only to log-collection --- pkg/stanza/.github/CODEOWNERS | 15 - pkg/stanza/.github/codecov.yaml | 24 - pkg/stanza/.github/dependabot.yml | 10 - pkg/stanza/.github/workflows/codecov.yml | 50 -- .../.github/workflows/codeql-analysis.yml | 37 - .../.github/workflows/contrib-tests.yml | 23 - pkg/stanza/.github/workflows/gosec.yml | 30 - pkg/stanza/.github/workflows/main.yml | 146 --- pkg/stanza/CHANGELOG.md | 831 ------------------ pkg/stanza/Makefile | 129 --- pkg/stanza/check-contrib.sh | 20 - pkg/stanza/examples/k8s/daemonset.yaml | 94 -- pkg/stanza/examples/k8s/openshift.yaml | 93 -- pkg/stanza/examples/tomcat/access.log | 7 - pkg/stanza/examples/tomcat/config.yaml | 56 -- 15 files changed, 1565 deletions(-) delete mode 100644 pkg/stanza/.github/CODEOWNERS delete mode 100644 pkg/stanza/.github/codecov.yaml delete mode 100644 pkg/stanza/.github/dependabot.yml delete mode 100644 pkg/stanza/.github/workflows/codecov.yml delete mode 100644 pkg/stanza/.github/workflows/codeql-analysis.yml delete mode 100644 pkg/stanza/.github/workflows/contrib-tests.yml delete mode 100644 pkg/stanza/.github/workflows/gosec.yml delete mode 100644 pkg/stanza/.github/workflows/main.yml delete mode 100644 pkg/stanza/CHANGELOG.md delete mode 100644 pkg/stanza/Makefile delete mode 100755 pkg/stanza/check-contrib.sh delete mode 100644 pkg/stanza/examples/k8s/daemonset.yaml delete mode 100644 pkg/stanza/examples/k8s/openshift.yaml delete mode 100644 pkg/stanza/examples/tomcat/access.log delete mode 100644 pkg/stanza/examples/tomcat/config.yaml diff --git a/pkg/stanza/.github/CODEOWNERS b/pkg/stanza/.github/CODEOWNERS deleted file mode 100644 index 4f1c78f0c5a4..000000000000 --- a/pkg/stanza/.github/CODEOWNERS +++ /dev/null @@ -1,15 +0,0 @@ -##################################################### -# -# List of approvers for OpenTelemetry Log Collection -# -##################################################### -# -# Learn about membership in OpenTelemetry community: -# https://github.com/open-telemetry/community/blob/main/community-membership.md -# -# -# Learn about CODEOWNERS file format: -# https://help.github.com/en/articles/about-code-owners -# - -* @open-telemetry/log-collection-approvers diff --git a/pkg/stanza/.github/codecov.yaml b/pkg/stanza/.github/codecov.yaml deleted file mode 100644 index c793fa5699ec..000000000000 --- a/pkg/stanza/.github/codecov.yaml +++ /dev/null @@ -1,24 +0,0 @@ -codecov: - require_ci_to_pass: yes - -ignore: - - "internal/tools/*" - -coverage: - precision: 1 - round: down - range: "70...100" - status: - project: - default: - target: auto - threshold: 0.5% - patch: - default: - target: 50% - threshold: 0% - -comment: - layout: "reach,diff,flags,tree" - behavior: default - require_changes: yes diff --git a/pkg/stanza/.github/dependabot.yml b/pkg/stanza/.github/dependabot.yml deleted file mode 100644 index 7a211be735ce..000000000000 --- a/pkg/stanza/.github/dependabot.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "gomod" - directory: "/" - schedule: - interval: "weekly" - - package-ecosystem: "gomod" - directory: "/internal/tools" - schedule: - interval: "weekly" diff --git a/pkg/stanza/.github/workflows/codecov.yml b/pkg/stanza/.github/workflows/codecov.yml deleted file mode 100644 index 7d8980ca2235..000000000000 --- a/pkg/stanza/.github/workflows/codecov.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Run CodeCov -on: - push: - branches: - - main - pull_request: -env: - # Path to where test results will be saved. - TEST_RESULTS: /tmp/test-results - # Default minimum version of Go to support. - DEFAULT_GO_VERSION: 1.17 -jobs: - test-coverage: - runs-on: ubuntu-latest - steps: - - name: Install Go - uses: actions/setup-go@v2.1.3 - with: - go-version: ${{ env.DEFAULT_GO_VERSION }} - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Setup Environment - run: | - echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - - name: Module cache - uses: actions/cache@v2.1.6 - env: - cache-name: go-mod-cache - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} - - name: Run coverage tests - run: | - make test-coverage - mkdir $TEST_RESULTS - cp coverage.out $TEST_RESULTS - cp coverage.txt $TEST_RESULTS - cp coverage.html $TEST_RESULTS - - name: Upload coverage report - uses: codecov/codecov-action@v1 - with: - file: ./coverage.txt - fail_ci_if_error: false - verbose: true - - name: Store coverage test output - uses: actions/upload-artifact@v2 - with: - name: opentelemetry-log-collection-test-output - path: ${{ env.TEST_RESULTS }} diff --git a/pkg/stanza/.github/workflows/codeql-analysis.yml b/pkg/stanza/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 4cabc44cb88a..000000000000 --- a/pkg/stanza/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: "CodeQL Analysis" -on: - workflow_dispatch: - schedule: - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - # │ │ │ │ │ - # │ │ │ │ │ - # * * * * * - - cron: '30 1 * * *' - - pull_request: - branches: [ main ] - -jobs: - CodeQL-Build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: go - - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/pkg/stanza/.github/workflows/contrib-tests.yml b/pkg/stanza/.github/workflows/contrib-tests.yml deleted file mode 100644 index deee8171c118..000000000000 --- a/pkg/stanza/.github/workflows/contrib-tests.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: contrib-tests -on: - push: - branches: [ main ] - tags: - - v[0-9]+.[0-9]+.[0-9]+.* - pull_request: - -jobs: - contrib_tests: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - name: Run Contrib Tests - run: | - contrib_path=/tmp/opentelemetry-collector-contrib - git clone https://github.com/open-telemetry/opentelemetry-collector-contrib.git $contrib_path - ./check-contrib.sh diff --git a/pkg/stanza/.github/workflows/gosec.yml b/pkg/stanza/.github/workflows/gosec.yml deleted file mode 100644 index dc8f4f7fa041..000000000000 --- a/pkg/stanza/.github/workflows/gosec.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Run Gosec -on: - workflow_dispatch: - schedule: - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - # │ │ │ │ │ - # │ │ │ │ │ - # * * * * * - - cron: '30 1 * * *' - pull_request: - branches: [ main ] - -jobs: - tests: - runs-on: ubuntu-latest - env: - GO111MODULE: on - steps: - - name: Checkout Source - uses: actions/checkout@v2 - - - name: Run Gosec Security Scanner - uses: securego/gosec@master - with: - args: './...' diff --git a/pkg/stanza/.github/workflows/main.yml b/pkg/stanza/.github/workflows/main.yml deleted file mode 100644 index 56a7a27ee42e..000000000000 --- a/pkg/stanza/.github/workflows/main.yml +++ /dev/null @@ -1,146 +0,0 @@ -name: Go - -on: - push: - branches: [ main ] - pull_request: - -jobs: - - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - name: Cache Go Modules - uses: actions/cache@v2 - env: - cache-name: cache-go-modules - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }} - - name: Install tools - if: steps.tool-cache.outputs.cache-hit != 'true' - run: make install-tools - - name: Add Permissions to Tool Binaries - run: chmod -R +x ~/go/bin - - name: Check - run: make ci-check - - test-linux: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - name: Cache Go Modules - uses: actions/cache@v2 - env: - cache-name: cache-go-modules - with: - path: ~/go/bin - key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }} - - name: Run Unit Tests - run: make test - - test-macos: - runs-on: macos-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - name: Cache Go Modules - uses: actions/cache@v2 - env: - cache-name: cache-go-modules - with: - path: ~/go/bin - key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }} - - name: Run Unit Tests - run: make test - - test-windows: - runs-on: windows-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.17 - - name: Cache Go Modules - uses: actions/cache@v2 - env: - cache-name: cache-go-modules - with: - path: /Users/runneradmin/go/pkg/mod - key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }} - - name: Run Unit Tests - run: make test - - bench-linux: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - name: Cache Go Modules - uses: actions/cache@v2 - env: - cache-name: cache-go-modules - with: - path: ~/go/bin - key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }} - - name: Run Benchmarks - run: make bench - - bench-macos: - runs-on: macos-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - name: Cache Go Modules - uses: actions/cache@v2 - env: - cache-name: cache-go-modules - with: - path: ~/go/bin - key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }} - - name: Run Benchmarks - run: make bench - - bench-windows: - runs-on: windows-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.17 - - name: Cache Go Modules - uses: actions/cache@v2 - env: - cache-name: cache-go-modules - with: - path: /Users/runneradmin/go/pkg/mod - key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }} - - name: Run Benchmarks - run: make bench \ No newline at end of file diff --git a/pkg/stanza/CHANGELOG.md b/pkg/stanza/CHANGELOG.md deleted file mode 100644 index 458af5ca962f..000000000000 --- a/pkg/stanza/CHANGELOG.md +++ /dev/null @@ -1,831 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - - -## [0.29.1] - 2022-04-15 - -### Fixed -- Complete removal of `preserve_to` setting and ensure `parse_from` field is always retained. ([PR468](https://github.com/open-telemetry/opentelemetry-log-collection/pull/468)) - -# Upgrading to v0.29.0 - -Several changes have been made that affect configuration for the `filelog`, `syslog`, `tcplog`, `udplog`, and `journald` receivers. - -### Update all usages of [field](/docs/types/field.md) syntax - -Field syntax no longer requires the `$` character. Instead each field must begin with `body`, `attributes`, or `resource`. - - - - -
Deprecated ExampleUpdated Equivalent
- -`$$attributes["log.file.name"]` - - - -`attributes["log.file.name"]` - -
- -`$$resource["host.name"]` - - - -`resource["host.name"]` - -
- -`$$body.foo` - - - -`body.foo` - -
- -`$$.foo` - - - -`body.foo` - -
- -`foo` - - - -`body.foo` - -
- - -#### Tip for updating sub-parsers - -To update the `parse_from` field in a "sub-parser", such as `timestamp` or `severity`, consider where the value would reside if the sub-parser was excluded. - - - - -
Deprecated ExampleUpdated Equivalent
- -```yaml -operators: -- type: regex_parser - regex: '^Time=(?P - -```yaml -operators: -- type: regex_parser - regex: '^Time=(?P
- - -### `attributes` and `resource` now support arbitrary structure - -Field syntax can now refer to nested fields in both `attributes` and `resource`. Nested fields were previously only supported in `body`. For example, `attributes.foo.bar` refers to the value `"hello"` in the following entry: - -```json -{ - "attributes": { - "foo": { - "bar": "hello" - } - } -} -``` - - -### Update references to parsed values - -The default value of `parse_to` has been changed from `body` to `attributes`. As a general rule of thumb, any parsers that previously specified the `parse_to` field are unaffected. If the `parse_to` field was not previously specified, then subsequent operators may need to be updated. - - - - -
Deprecated ExampleUpdated Equivalent
- -```yaml -operators: -- type: regex_parser - regex: '^Foo=(?P\s.*)...' - parse_from: body -# parse_to: body (old default) -- type: move - from: foo - to: attributes.bar - ... -``` - - - -```yaml -operators: -- type: regex_parser - regex: '^Foo=(?P\s.*)...' - parse_from: body -# parse_to: attributes (new default) -- type: move - from: attributes.foo - to: attributes.bar - ... -``` - -
- - -### Remove or replace usages of `preserve_to` - -Parsers no longer support a `preserve_to` setting. Instead, the `parse_from` field is preserved by default. To preserve and move the field, use the `move` operator after the parse operator. To remove the field after parsing, use the `remove` operator. - - - - - -
Deprecated ExampleUpdated Equivalent
- -```yaml -operators: -- type: regex_parser - regex: '^Foo=(?P\s.*)...' - parse_from: body - preserve_to: attributes.backup - ... -``` - - - -```yaml -operators: -- type: regex_parser - regex: '^Foo=(?P\s.*)...' - parse_from: body -- type: move - from: body - to: attributes.backup - ... -``` - -
- -```yaml -operators: -- type: regex_parser - regex: '^Foo=(?P\s.*)...' - parse_from: body # implicitly deleted - ... -``` - - - -```yaml -operators: -- type: regex_parser - regex: '^Foo=(?P\s.*)...' - parse_from: body -- type: remove - field: body - ... -``` - -
- - - -### Replace usages of `restructure` operator - -The `restructure` operator has been removed. Use `add`, `copy`, `flatten`, `move`, `remove`, and `retain` operators instead. - - - - -
Deprecated ExampleUpdated Equivalent
- -```yaml -operators: - - type: restructure - ops: - - add: - field: set_me - value: foo - - add: - field: overwrite_me - value: bar - - move: - from: details.env - to: env - - remove: - field: delete_me -``` - - - -```yaml -operators: - - type: add - field: body.set_me - value: foo - - type: add - field: body.overwrite_me - value: bar - - type: move - from: body.details.env - to: body.env - - type: remove - field: body.delete_me -``` - -
- -### Replace usages of `metadata` operator - -The `metadata` operator has been removed. Use `add`, `copy`, or `move` operators instead. - - - - -
Deprecated ExampleUpdated Equivalent
- -```yaml -operators: - - type: metadata - attributes: - environment: production - file: 'EXPR( $$body.file )' - resource: - cluster: blue -``` - - - -```yaml -operators: - - type: add - field: attributes.environment - value: production - - type: copy - from: body.file - to: attributes.file - - type: add - field: resource.cluster - value: blue - - type: move - from: body.foo - to: attributes.bar -``` - -
- -### Update `filelog` attribute references - -The `filelog` receiver has adopted slightly different attribute names in order to match newly established semantic conventions. Configurations that previously refered to the `file.*` attributes should be updated. - - - - -
Deprecated AttributeUpdated Equivalent
- -`file.name` - - - -`log.file.name` - -
- -`file.path` - - - -`log.file.path` - -
- -`file.name.resolved` - - - -`log.file.name_resolved` - -
- -`file.path.resolved` - - - -`log.file.path_resolved` - -
- - -## **Note to Vendors**: A log record's `Timestamp` field may now be `nil` - -[A recent change to the Log Data Model](https://github.com/open-telemetry/opentelemetry-specification/pull/2184) has redefined the usage of the `Timestamp` field. Correspondingly, this field is no longer initialized by default. All Log Exporters should be evaluated to ensure this change is handled accordingly. - -Log exporters can use the following logic to mimic the previous functionality (psuedocode): - -```go -timestamp := log.ObservedTimestamp -if log.Timestamp != nil { - timestamp = log.Timestamp -} -``` - - -## [0.29.0] - 2022-04-11 - -### Breaking Changes - -- The default value of `parse_to` field in all parsers has been changed to `attributes`. ([PR463](https://github.com/open-telemetry/opentelemetry-log-collection/pull/463)) -- Parsers that contain a `parse_to` setting will no longer delete the `parse_from` field. ([PR464](https://github.com/open-telemetry/opentelemetry-log-collection/pull/464)) -- The `preserve_to` setting has been removed from parsers. ([PR464](https://github.com/open-telemetry/opentelemetry-log-collection/pull/464)) - -### Added - -- `key_value_parser` ([PR459](https://github.com/open-telemetry/opentelemetry-log-collection/pull/459)) -- `severity` parsign can now use `preset: otel` to recognize both numeric and text representations of OpenTelemetry's log data model. ([PR460](https://github.com/open-telemetry/opentelemetry-log-collection/pull/460)) -- `regex_parser` can now cache parsing parsing results using the `cache` setting. This can dramatically increase performance in cases where the same string is parsed repeatedly. ([PR440](https://github.com/open-telemetry/opentelemetry-log-collection/pull/440)) - -### Fixed - -- Issue where scope name parser would fail to initialize. ([PR465](https://github.com/open-telemetry/opentelemetry-log-collection/pull/465)) - -## [0.28.0] - 2022-03-28 - -### Breaking Changes -- `$` has been removed from [field](/docs/types/field.md) syntax. ([PR364](https://github.com/open-telemetry/opentelemetry-log-collection/pull/364)) - - Use `body` instead of `$body`. - - e.g. `body.foo`. - - Use `attributes` instead of `$attributes`. - - e.g. `attributes.["log.file.name"]` - - Use `resource` instead of `$resource`. - - e.g. `resource.["host.name"]` - - There is no longer a default top-level field. - - i.e. `foo` is no longer equivalent to `$body.foo`. (It is invalid.) - - A top-level field MUST be specified at the beginning of each field. - - e.g. `body.foo`, `attributes.foo`, or `resource.foo`. -- `entry.Entry.Timestamp` field is no longer required and is not initialized by default. ([PR370](https://github.com/open-telemetry/opentelemetry-log-collection/pull/370)) - - The value can be set using the `timestamp` block on any parser, or the using the standalone `time_parser` operator. -- Removed `metadata` operator. ([PR429](https://github.com/open-telemetry/opentelemetry-log-collection/pull/429)) - - Use `add`, `copy`, or `move` operators instead. -- Removed `restructure` operator. ([PR371](https://github.com/open-telemetry/opentelemetry-log-collection/pull/371)) - - Use `add`, `copy`, `flatten`, `move`, `remove`, and `retain` operators instead. -- Changed the names of attributes added by `file_input` operator to match new [semantic conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/semantic_conventions/media.md#log-file). ([PR372](https://github.com/open-telemetry/opentelemetry-log-collection/pull/372)) -- Switch to original `go-syslog` library, restoring strict enforcement of SD-NAME length. ([PR439](https://github.com/open-telemetry/opentelemetry-log-collection/pull/439)) - - -## [0.27.2] - 2022-03-17 - -### Fixed -- Revert version update on go-syslog, which introduced incompatibility with 386 architecture. ([PR438](https://github.com/open-telemetry/opentelemetry-log-collection/pull/438)) - - -## [0.27.1] - 2022-03-16 - -### Fixed -- Issue where pipelines could fail to build when running on Go 1.18. ([PR347](https://github.com/open-telemetry/opentelemetry-log-collection/pull/347)) - - -## [0.27.0] - 2022-03-10 - -### Added -- `entry.Entry.ObservedTimestamp` field. This is initialized automatically when an entry is created. ([PR370](https://github.com/open-telemetry/opentelemetry-log-collection/pull/370)) -- `entry.Entry.ScopeName` field. This field will be used in the collector to group related log entries. ([PR397](https://github.com/open-telemetry/opentelemetry-log-collection/pull/397)) - - A `scope_name` block is now supported by every parser. Alternately, use the standalone `scope_name_parser` operator. - - -## [0.27.0] - 2022-03-10 - -### Added -- `csv_parser` can now handle fields containing line breaks. ([PR425](https://github.com/open-telemetry/opentelemetry-log-collection/pull/425)) - -### Fixed -- Issue where `recombine` operator would combine entire file in certain specific circumstances. ([PR416](https://github.com/open-telemetry/opentelemetry-log-collection/pull/416)) - - -## [0.26.0] - 2022-02-25 - -### Added -- `source_identifier` setting to `recombine` operator, to ensure partial entries are joined to others from the same file, or other source. ([PR341](https://github.com/open-telemetry/opentelemetry-log-collection/pull/341)) -- `max_sources` setting to `recombine` operator, which limits the number of unique sources that may accumulate partial entries. ([PR341](https://github.com/open-telemetry/opentelemetry-log-collection/pull/341)) - -### Fixed -- Time parsing will now correctly parse timestamps from 1970. ([PR417](https://github.com/open-telemetry/opentelemetry-log-collection/pull/417)) -- Issue where `file_input` operator could duplicate a small number of log entries. ([PR413](https://github.com/open-telemetry/opentelemetry-log-collection/pull/413)) - -### Changed -- `entry.Attributes` data type from `map[string]string` to `map[string]interface{}`. ([PR401](https://github.com/open-telemetry/opentelemetry-log-collection/pull/401)) -- `entry.Resource` data type from `map[string]string` to `map[string]interface{}`. ([PR411](https://github.com/open-telemetry/opentelemetry-log-collection/pull/411)) - -### Removed -- `write_to` configuration setting from all input operators. Use `move` operator instead. ([PR412](https://github.com/open-telemetry/opentelemetry-log-collection/pull/412)) - - -## [0.25.0] - 2022-02-21 - -This release contains a few minor updates as well as a major cleanup of the codebase. See the [Reduce Complexity](https://github.com/open-telemetry/opentelemetry-log-collection/milestone/2?closed=1) milestone for full details on the cleanup. - -### Added -- `source_identifier` setting to `recombine` operator, to ensure partial entries are joined to others from the same file, or other source. ([PR341](https://github.com/open-telemetry/opentelemetry-log-collection/pull/341)) -- `max_sources` setting to `recombine` operator, which limits the number of unique sources that may accumulate partial entries. ([PR341](https://github.com/open-telemetry/opentelemetry-log-collection/pull/341)) - -### Fixed -- On Windows, `file_input` will immediately close files after reading. ([PR366](https://github.com/open-telemetry/opentelemetry-log-collection/pull/366)) - -### Changed -- When `file_input` cannot open a file, it will print a debug level log instead of an error level log. ([PR357](https://github.com/open-telemetry/opentelemetry-log-collection/pull/357)) - - -## [0.24.0] - 2021-12-21 - -### Added -- `force_flush_period` setting to `recombine` operator, to prevent recombine taking to long to process ([PR325](https://github.com/open-telemetry/opentelemetry-log-collection/pull/325)) -- `lazy_quotes` setting to `csv` parser operator. When enabled will preserve internal quotes in a csv field ([PR324](https://github.com/open-telemetry/opentelemetry-log-collection/pull/324)) -- `header_attribute` setting to `csv` parser operator. When set will dynamically parse the csv headers from the specified attribute on a log entry. ([PR335](https://github.com/open-telemetry/opentelemetry-log-collection/pull/335)) - -### Changed -- Updated CSV Parser to use idiomatic Go errors ([PR323](https://github.com/open-telemetry/opentelemetry-log-collection/pull/323)) - -## [0.23.0] - 2021-11-30 - - -### Added -- `combine_with` setting to `recombine` operator, to allow for joining on custom delimiter ([PR315](https://github.com/open-telemetry/opentelemetry-log-collection/pull/315)) -### Fixed -- Issue where `force_flush_period` could cause line splitting to be skipped ([PR303](https://github.com/open-telemetry/opentelemetry-log-collection/pull/303)) -- Issue where `tcp_input` and `udp_input` could panic when stopping ([PR273](https://github.com/open-telemetry/opentelemetry-log-collection/pull/273)) -- Syslog severity mapping is now aligned with log specification ([PR300](https://github.com/open-telemetry/opentelemetry-log-collection/pull/300)) - -### Changed -- Improve error message when timezone database is not found ([PR289](https://github.com/open-telemetry/opentelemetry-log-collection/pull/289)) - - - -## [0.22.0] - 2021-10-05 - -### Fixed -- Issue in `file_input` where doublestar globbing could only be used at a single level ([PR268](https://github.com/open-telemetry/opentelemetry-log-collection/pull/268)) -- Bug in `tcp_input`, `udp_input`, and `syslog_input` which could cause a panic ([PR273](https://github.com/open-telemetry/opentelemetry-log-collection/pull/273)) -- Made `windows_event_log_input` compatibile with Windows Server 2022 ([PR283](https://github.com/open-telemetry/opentelemetry-log-collection/pull/283)) - -### Changed -- `file_input` will now emit bytes when `encoding = nop` ([PR262](https://github.com/open-telemetry/opentelemetry-log-collection/pull/262)) - -## [0.21.0] - 2021-09-09 - -### Added -- The `timestamp` operator can now parse timestamps that use a comma separator ([Go v1.17](https://golang.org/doc/go1.17#time)) -- `journald_input` now accepts `units` and `priority` settings ([PR252](https://github.com/open-telemetry/opentelemetry-log-collection/pull/252)) -- `file_input` will now trim whitespace when using `multiline` ([PR212](https://github.com/open-telemetry/opentelemetry-log-collection/pull/212)) - -### Changed -- Operator IDs are now autogenerated sequentially, removing the necessity to specify the `id` field in most circumstances ([PR246](https://github.com/open-telemetry/opentelemetry-log-collection/pull/246)) -- Updated to go version 1.17 ([PR248](https://github.com/open-telemetry/opentelemetry-log-collection/pull/248)) - -### Fixed -- `file_input`'s `force_flush_period` now defaults to `500ms`, ensuring that the use of `multiline.line_start_regex` does not cause ommision of the last line of each file ([PR261](https://github.com/open-telemetry/opentelemetry-log-collection/pull/261)) - -## [0.20.0] - 2021-07-27 - -### Added -- `file_input` operator can now be configured to flush incomplete logs, using the `force_flush_period` setting ([PR216](https://github.com/open-telemetry/opentelemetry-log-collection/pull/216)) - -### Changed -- `severity` levels have been redefined to match OpenTelemetry standard levels ([PR228](https://github.com/open-telemetry/opentelemetry-log-collection/pull/228)) -### Fixed -- `multiline` splitting now trims whitespace characters ([PR212](https://github.com/open-telemetry/opentelemetry-log-collection/pull/212)) -- `windows_eventlog_input` log input now gives a helpful error message when a metadata request fails ([PR206](https://github.com/open-telemetry/opentelemetry-log-collection/pull/206)) - - -## [0.19.0] - 2021-06-22 - -### Added -- `csv_parser` ([PR123](https://github.com/open-telemetry/opentelemetry-log-collection/pull/123)) -- `multiline`, `encoding`, and `max_log_size` options to `udp_input` ([PR127](https://github.com/open-telemetry/opentelemetry-log-collection/pull/127)) -- `file_input` now has `include_file_name_resolved` and `include_file_path_resolved` settings which produce attributes `file.name.resolved` and `file.path.resolved`, respectively ([PR189](https://github.com/open-telemetry/opentelemetry-log-collection/pull/189)) -- GoSec workflow added to GitHub Actions ([PR154](https://github.com/open-telemetry/opentelemetry-log-collection/pull/154)) -- CodeQL workflow added to GitHub Actions ([PR153](https://github.com/open-telemetry/opentelemetry-log-collection/pull/153)) - -### Changed -- `file_input`'s default `encoding` is now `utf8` ([PR147](https://github.com/open-telemetry/opentelemetry-log-collection/pull/147)) -- `file_input`'s `include_file_name` and `include_file_path` settings now produce attributes `file.name` and `file.path`, respectively ([PR189](https://github.com/open-telemetry/opentelemetry-log-collection/pull/189)) - -### Fixed -- `file_input` can now track files that are rotated out of the `include` pattern matches ([PR182](https://github.com/open-telemetry/opentelemetry-log-collection/pull/182)) -- Noisy log message in `file_input` ([PR174](https://github.com/open-telemetry/opentelemetry-log-collection/pull/174)) -- Issue where failed parse operation could duplicate log entry ([PR188](https://github.com/open-telemetry/opentelemetry-log-collection/pull/188)) - -### Removed -- Parsers will no longer process `[]byte` data type ([PR149](https://github.com/open-telemetry/opentelemetry-log-collection/pull/149)) - -## [0.18.0] - 2021-05-11 - -### Added -- `file_input` now supports multi-level directory globs (i.e. `/var/**/logs/**/*.log`) ([PR97](https://github.com/open-telemetry/opentelemetry-log-collection/pull/97)) -- `add`, `remove`, `move`, `copy`, `retain`, and `flatten` operators, as alternatives to the `restructure` operator. -- `add_attributes` option to `tcp_input` and `udp_input`, for capturing network attributes ([PR108](https://github.com/open-telemetry/opentelemetry-log-collection/pull/108)) -- `multiline`, `encoding`, and `max_log_size` options to `tcp_input` ([PR125](https://github.com/open-telemetry/opentelemetry-log-collection/pull/125)) - -### Removed -- Database package. The same functionality is supported via a `Persister` interface, passed to `Start` methods ([PR93](https://github.com/open-telemetry/opentelemetry-log-collection/pull/93)) - -### Fixed -- Issue where `tcp_input` could panic or spam logs ([PR130](https://github.com/open-telemetry/opentelemetry-log-collection/pull/130)) - -## [0.17.0] - 2021-04-07 - -### Added -- Trace fields added to `entry.Entry`, and an accompanying `trace` parser ([PR76](https://github.com/open-telemetry/opentelemetry-log-collection/pull/76)) -- Severity parser can parse whole numbers formatted as `float64` ([PR90](https://github.com/open-telemetry/opentelemetry-log-collection/pull/90)) -- Support for `mapstructure` to most configs - -### Changed -- Rename `entry.Record` to `entry.Body` ([PR88](https://github.com/open-telemetry/opentelemetry-log-collection/pull/88)) -## [0.16.0] - 2021-03-08 - -### Changed -- `syslog_input` config embeds `syslog_parser` at the top level, rather than under a `syslog` key ([PR43](https://github.com/open-telemetry/opentelemetry-log-collection/pull/43)) -- Rename `entry.Label` to `entry.Attribute` ([PR51](https://github.com/open-telemetry/opentelemetry-log-collection/pull/51)) - -### Removed -- Several unused packages, including `flusher`, `buffer`, `k8smetadata`, `hostmetadata`, and `ratelimit` ([PR53](https://github.com/open-telemetry/opentelemetry-log-collection/pull/53)) - -## [0.15.1] - 2021-03-01 - -### Added -- Optional `max_buffer_size` parameter to `tcp_input` operator ([PR35](https://github.com/open-telemetry/opentelemetry-log-collection/pull/35)) -- TLS support to `tcp_input` operator ([PR29](https://github.com/open-telemetry/opentelemetry-log-collection/pull/29)) - -### Fixed -- Data race in syslog parser ([PR32](https://github.com/open-telemetry/opentelemetry-log-collection/pull/32)) - - -## [0.15.0] - 2021-02-25 - -### Added -- `syslog_input` operator, which combines `tcp_input`, `udp_input`, and `syslog_parser` into a single operator. ([PR24](https://github.com/open-telemetry/opentelemetry-log-collection/pull/24)) -- Syslog operator RFC 3164 location parameter ([PR11](https://github.com/open-telemetry/opentelemetry-log-collection/pull/11)) -- `uri_parser` operator ([PR12](https://github.com/open-telemetry/opentelemetry-log-collection/pull/12)) - -### Removed -- `forward_input` and `forward_output`, which were previously intended for use in the standalone agent ([PR27](https://github.com/open-telemetry/opentelemetry-log-collection/pull/27)) - -## [0.14.0] - 2021-02-02 - -### Changed -- Remove standalone agent functionality -- Simplifies modules - - Combines `parser/syslog` and `input/windows` modules into the primary module - - Removes output operators that were previously separate modules - - Leaves `input/k8sevent` and `transformer/k8smetadata` as separate modules for now. These two have extensive dependencies and their usefulness in the collector needs to be discussed before merging or removing. - -## [0.13.12] - 2021-01-26 - -### Changed -- Allow plugin parameters to have a default value even if they are required - -## [0.13.11] - 2021-01-15 - -### Changed -- Updated version of stanza used in several isolated modules - -## [0.13.10] - 2021-01-15 - -### Added -- `timestamp` parser now supports a `location` parameter - -## [0.13.9] - 2021-01-04 - -### Fixed -- `k8s_metadata_decorator` using a proxy causes internal API timeout - -## [0.13.8] - 2020-12-30 -### Fixed -- `file_input` exclude processing could result in extra exclusions - -## [0.13.7] - 2020-12-23 -### Added -- Ability to customize `file_input`'s `fingerprint_size` -## [0.13.6] - 2020-12-18 -### Fixed -- Issue where timestamps ending 'Z' were not treated as UTC -- Issue where recognized timezones may not properly calculate offsets -- Issue where `file_output` would escape html special characters - -## [0.13.5] - 2020-12-09 -### Fixed -- Issue where flushers would retry indefinitely -- Issue where flushers would improperly reuse the same http request multiple times - -## [0.13.4] - 2020-12-07 -### Added -- Recombine operator to combine multiline logs after ingestion and parsing - -### Fixed -- Issue where entries skipped by `if` would be output twice - -## [0.13.3] - 2020-12-01 -### Added -- New operators `forward_output` and `forward_input` to easily send log entries between stanza instances. -- Override default timestamp with `STANZA_DEFAULT_TIMESTAMP` for integration testing -- Add new `bytesize` type for easier configuration of byte sizes -- Automatic severity promotion in the syslog parser -### Fixed -- Open files in chunks so that we don't hit open file limit and cause performance issues - -## [0.13.2] - 2020-11-17 -### Added -- New parameter `if` to parser plugins to allow for easy conditional parsing without routers -- New `default` parameter to the router to explicitly send unmatched entries to a specific operator(s) - -## [0.13.1] - 2020-11-11 -### Fixed -- Missing default configuration of `elastic_output` flusher -### Changed -- A plugin that fails to parse will now log an error, but will not cause stanza to fail to start -### Added -- New `stdin` operator - -## [0.13.0] - 2020-11-09 -### Added -- OTLP severity level recognition -- Severity Text field on Entry -### Changed -- Removed `preserve` in favor of `preserve_to` to make it more clear that it may overwrite parsed fields -- Updated our internal log sampling numbers to more aggressively sample repeated logs -### Added -- Log message whenever a new file is detected - -## [0.12.5] - 2020-10-07 -### Added -- `windows_eventlog_input` can now parse messages from the Security channel. - -## [0.12.4] - 2020-10-07 -### Fixed -- Router outputs were not namespaced correctly - -## [0.12.3] - 2020-10-07 -### Fixed -- (De)serialization of JSON for plugin config structs - -## [0.12.2] - 2020-10-06 -### Added -- New Relic Logs output operator -- Additional resource values with parent object names (service name, replica set name, etc.) in the k8s metadata operator -- Publicly available `version.GetVersion()` for consumers of the `stanza` module - -## [0.12.0] - 2020-09-21 -### Changed -- Most operators are no longer part of dedicated modules - -## [0.11.0] - 2020-09-15 -### Changed -- File input improvements and rotation tests - -## [0.10.0] - 2020-09-11 -### Added -- Disk buffer for output operators ([PR109](https://github.com/observIQ/stanza/pull/109)) -### Changed -- Split buffers into buffers and flushers for better modularity ([PR109](https://github.com/observIQ/stanza/pull/109)) -- New memory buffer design for a uniform interface between disk and memory buffers ([PR109](https://github.com/observIQ/stanza/pull/109)) -- Most operators are now dedicated modules, so that they may be imported individually ([PR108](https://github.com/observIQ/stanza/pull/108)) - -## [0.9.14] - 2020-08-31 -### Fixed -- Rendering issue with the `kubernetes_events` plugin - -## [0.9.13] - 2020-08-31 -### Added -- Support for accessing the resource with fields ([PR105](https://github.com/observIQ/stanza/pull/105)) -- Support for using fields to select keys that contain dots like `$record['field.with.dots']` ([PR105](https://github.com/observIQ/stanza/pull/105)) -- `google_cloud_output` will use resource create a monitored resource for supported resource types (currently only k8s resources) ([PR105](https://github.com/observIQ/stanza/pull/105)) -### Changed -- The operators `host_metadata`, `k8s_event_input`, and `k8s_metadata_decorator` will now use the top-level resource field ([PR105](https://github.com/observIQ/stanza/pull/105)) -- `k8s_metadata_decorator` now generates pod labels that match those generated by GKE ([PR105](https://github.com/observIQ/stanza/pull/105)) -### Fixed -- Issue with `k8s_event_input` generating entries with zero-valued time ([PR105](https://github.com/observIQ/stanza/pull/105)) -- Plugin ID in templates will now correctly default to the plugin type if unset ([PR105](https://github.com/observIQ/stanza/pull/105)) - - -## [0.9.12] - 2020-08-25 -### Changed -- Agent is now embeddable with a default output - -## [0.9.11] - 2020-08-24 -### Added -- The 'filter' operator - -### Changed -- Renamed project to `stanza` -- Move `testutil` package out of `internal` - -## [0.9.10] - 2020-08-20 -### Added -- The `Resource` field was added to Entry ([PR95](https://github.com/observIQ/stanza/pull/95)) -- The `Identifier` helper was created to assist with writing to `Resource` ([PR95](https://github.com/observIQ/stanza/pull/95)) - -### Removed -- The `Tags` field was removed from Entry ([PR95](https://github.com/observIQ/stanza/pull/95)) - -### Changed -- The `host_metadata` operator now writes to an entry's `Resource` field, instead of Labels -- The `host_labeler` helper has been renamed `host_identifier` -- The `metadata` operator embeds the `Identifier` helper and supports writing to `Resource` -- Input operators embed the `Identifier` helper and support writing to `Resource` -- The `k8s_event` operator now supports the `write_to`, `labels`, and `resource` configuration options -- Multiline for `file_input` now supports matching on new lines characters ([PR96](https://github.com/observIQ/stanza/pull/96)) - -## [0.9.9] - 2020-08-14 -### Added -- Kubernetes events input operator ([PR88](https://github.com/observIQ/stanza/pull/88)) -### Fixed -- Small improvements to test stability -- Fallback to reflection to convert entries to Google Cloud log entries ([PR93](https://github.com/observIQ/stanza/pull/93)) - -## [0.9.8] - 2020-08-12 -### Fixed -- Google Cloud Output failure when sent a field of type uint16 ([PR82](https://github.com/observIQ/stanza/pull/82)) -### Added -- Added a default function to plugin templates ([PR84](https://github.com/observIQ/stanza/pull/84)) -- Add a host metadata operator that adds hostname and IP to entries ([PR85](https://github.com/observIQ/stanza/pull/85)) -- Google Cloud Output option to enable gzip compression ([PR86](https://github.com/observIQ/stanza/pull/86)) - -## [0.9.7] - 2020-08-05 -### Changed -- In the file input operator, file name and path fields are now added with `include_file_name` (default `true`) and `include_file_path` (default `false`) -- Input and router operators can define labels on entries using the `labels` field -- Add Event ID to windows event log entries -- Use the `go-syslog` fork directly rather than relying on a `replace` directive so that the agent can be used as a library successfully - -## [0.9.6] - 2020-08-04 -### Changed -- Fork go-syslog to support long sdnames that are not rfc5424-compliant -- Reduce noise in debug messages for TCP and UDP inputs -### Added -- `log_type` label added by default to input operators -### Fixed -- Trim carriage returns from TCP input - -## [0.9.5] - 2020-07-28 -### Added -- Configurable `timeout` parameter for the `k8s_metadata_decorator` ([PR54](https://github.com/observIQ/stanza/pull/54)) -- Journald operator now supports `start_at` parameter ([PR55](https://github.com/observIQ/stanza/pull/55)) - -### Changed -- Enhanced plugin parameter metadata structure, to support required/optional and default values ([PR59](https://github.com/observIQ/stanza/pull/59)) - -### Fixed -- Issue where multiple instances of `syslog_parser` would cause parsing errors ([PR61](https://github.com/observIQ/stanza/pull/61)) -- `short destination buffer` error now is handled by increasing encoding buffer size ([PR58](https://github.com/observIQ/stanza/pull/58)) -- Issue where omitting the output field in a plugin could result in errors ([PR56](https://github.com/observIQ/stanza/pull/56)) - -## [0.9.4] - 2020-07-21 -- Allow omitting `id`, defaulting to plugin type if unique within namespace -- Allow omitting `output`, defaulting to the next operator in the pipeline if valid - -## [0.9.3] - 2020-07-20 -### Added -- Support for multiple encodings in the file input plugin ([PR39](https://github.com/observIQ/stanza/pull/39)) -- Install scripts and docker image now include plugins from `stanza-plugins` repository ([PR45](https://github.com/observIQ/stanza/pull/45)) -- Publish image to dockerhub ([PR42](https://github.com/observIQ/stanza/pull/42)) -- Improved default configuration ([PR41](https://github.com/observIQ/stanza/pull/41)) -- Basic developer documentation ([PR43](https://github.com/observIQ/stanza/pull/43)) -### Fixed -- JournalD emits `map[string]interface{}` ([PR38](https://github.com/observIQ/stanza/pull/38)) - -## [0.9.2] - 2020-07-13 -### Added -- Link `stanza` into `/usr/local/bin` so it's available on most users' `PATH` ([PR28](https://github.com/observIQ/stanza/pull/28)) -- New parameter `file_name_path` to the file input plugin for cases when just the file name is needed -### Changed -- Renamed `path_field` to `file_path_field` in the file input plugin -### Fixed -- Failure in Google Cloud Output to convert some data types to protocol buffers - -## [0.9.1] - 2020-07-13 -### Added -- More specific warning and error messages for common configuration issues ([PR12](https://github.com/observIQ/stanza/pull/12),[PR13](https://github.com/observIQ/stanza/pull/13),[PR14](https://github.com/observIQ/stanza/pull/14)) -### Fixed -- Writing from files being actively written to will sometimes read partial entries ([PR21](https://github.com/observIQ/stanza/pull/21)) -- Minor documentation omissions - -## [0.9.0] - 2020-07-07 -### Added -- Initial open source release. See documentation for full list of supported features in this version. diff --git a/pkg/stanza/Makefile b/pkg/stanza/Makefile deleted file mode 100644 index 1e52085397ce..000000000000 --- a/pkg/stanza/Makefile +++ /dev/null @@ -1,129 +0,0 @@ -GOOS=$(shell go env GOOS) -GOARCH=$(shell go env GOARCH) - -GIT_SHA=$(shell git rev-parse --short HEAD) - -PROJECT_ROOT = $(shell pwd) -ALL_MODULES := $(shell find . -type f -name "go.mod" -exec dirname {} \; | sort ) -ALL_SRC := $(shell find . -name '*.go' -type f | sort) -ADDLICENSE=addlicense -ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | egrep -v '^./internal/tools' | sort) -FIELDALIGNMENT_DIRS := ./pipeline/ - -TOOLS_MOD_DIR := ./internal/tools -.PHONY: install-tools -install-tools: - cd $(TOOLS_MOD_DIR) && go install github.com/securego/gosec/v2/cmd/gosec@v2.9.6 - cd $(TOOLS_MOD_DIR) && go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.43.0 - cd $(TOOLS_MOD_DIR) && go install github.com/vektra/mockery/cmd/mockery - cd $(TOOLS_MOD_DIR) && go install github.com/google/addlicense - cd $(TOOLS_MOD_DIR) && go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment - -.PHONY: test -test: vet test-only - -.PHONY: test-only -test-only: - $(MAKE) for-all CMD="go test -race -coverprofile coverage.txt -coverpkg ./... ./..." - -.PHONY: test-coverage -test-coverage: clean - @set -e; \ - printf "" > coverage.txt; \ - for dir in $(ALL_COVERAGE_MOD_DIRS); do \ - (cd "$${dir}" && \ - go list ./... \ - | grep -v third_party \ - | xargs go test -coverpkg=./... -covermode=atomic -coverprofile=coverage.out && \ - go tool cover -html=coverage.out -o coverage.html); \ - [ -f "$${dir}/coverage.out" ] && cat "$${dir}/coverage.out" >> coverage.txt; \ - done; \ - sed -i.bak -e '2,$$ { /^mode: /d; }' coverage.txt - -.PHONY: bench -bench: - go test -benchmem -run=^$$ -bench ^* ./... - -.PHONY: clean -clean: - $(MAKE) for-all CMD="rm -f coverage.txt.* coverage.html coverage.out" - -.PHONY: tidy -tidy: - $(MAKE) for-all CMD="rm -fr go.sum" - $(MAKE) for-all CMD="go mod tidy -compat=1.17" - -.PHONY: mod-update-only -mod-update-only: - $(MAKE) for-all CMD="go get -u ./..." - -.PHONY: mod-update -mod-update: mod-update-only tidy - -.PHONY: listmod -listmod: - @set -e; for dir in $(ALL_MODULES); do \ - (echo "$${dir}"); \ - done - -.PHONY: lint -lint: - golangci-lint run --allow-parallel-runners ./... - -.PHONY: lint-fix -lint-fix: - golangci-lint run --fix --allow-parallel-runners ./... - -.PHONY: fieldalignment -fieldalignment: - fieldalignment $(FIELDALIGNMENT_DIRS) - -.PHONY: fieldalignment-fix -fieldalignment-fix: - fieldalignment -fix $(FIELDALIGNMENT_DIRS) - -.PHONY: vet -vet: - GOOS=darwin $(MAKE) for-all CMD="go vet ./..." - GOOS=linux $(MAKE) for-all CMD="go vet ./..." - GOOS=windows $(MAKE) for-all CMD="go vet ./..." - -.PHONY: secure -secure: - gosec ./... - -.PHONY: generate -generate: - go generate ./... - -.PHONY: check-license -check-license: - @ADDLICENSEOUT=`$(ADDLICENSE) -check $(ALL_SRC) 2>&1`; \ - if [ "$$ADDLICENSEOUT" ]; then \ - echo "$(ADDLICENSE) FAILED => add License errors:\n"; \ - echo "$$ADDLICENSEOUT\n"; \ - echo "Use 'make add-license' to fix this."; \ - exit 1; \ - else \ - echo "Check License finished successfully"; \ - fi - -.PHONY: add-license -add-license: - @ADDLICENSEOUT=`$(ADDLICENSE) -y "" -c "The OpenTelemetry Authors" $(ALL_SRC) 2>&1`; \ - if [ "$$ADDLICENSEOUT" ]; then \ - echo "$(ADDLICENSE) FAILED => add License errors:\n"; \ - echo "$$ADDLICENSEOUT\n"; \ - exit 1; \ - else \ - echo "Add License finished successfully"; \ - fi - -.PHONY: for-all -for-all: - @set -e; for dir in $(ALL_MODULES); do \ - (cd "$${dir}" && $${CMD} ); \ - done - -.PHONY: ci-check -ci-check: vet lint check-license secure fieldalignment diff --git a/pkg/stanza/check-contrib.sh b/pkg/stanza/check-contrib.sh deleted file mode 100755 index 8548232bbf90..000000000000 --- a/pkg/stanza/check-contrib.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -e - -CURDIR=$(pwd) -CONTRIB_PATH="/tmp/opentelemetry-collector-contrib" -LOG_COLLECTION_MOD_NAME="github.com/open-telemetry/opentelemetry-log-collection" -LOG_COLLECTION_MODULES=$(find ${CONTRIB_PATH} ! -path ${CONTRIB_PATH}/go.mod ! -path ${CONTRIB_PATH}/cmd/configschema/go.mod -type f -name "go.mod" -exec grep -l ${LOG_COLLECTION_MOD_NAME} {} \; | xargs -L 1 dirname | sort) -echo "Log collection modules - ${LOG_COLLECTION_MODULES}" - -for module in ${LOG_COLLECTION_MODULES} -do - pushd ${module} - go mod edit -replace github.com/open-telemetry/opentelemetry-log-collection=${CURDIR} - rm -fr go.sum - go mod tidy -compat=1.17 - go test - go mod edit -dropreplace github.com/open-telemetry/opentelemetry-log-collection - popd -done diff --git a/pkg/stanza/examples/k8s/daemonset.yaml b/pkg/stanza/examples/k8s/daemonset.yaml deleted file mode 100644 index b3fad6c2a84d..000000000000 --- a/pkg/stanza/examples/k8s/daemonset.yaml +++ /dev/null @@ -1,94 +0,0 @@ ---- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: stanza-metadata - namespace: default ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -# kubernetes versions before 1.8.0 should use rbac.authorization.k8s.io/v1beta1 -metadata: - name: stanza-metadata - namespace: default -rules: - - apiGroups: ["", "apps", "batch"] - resources: - - pods - - namespaces - - replicasets - - jobs - verbs: ["get", "list"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: stanza-metadata -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: stanza-metadata -subjects: - - kind: ServiceAccount - name: stanza-metadata - namespace: default ---- -kind: ConfigMap -metadata: - name: stanza-config - namespace: default -apiVersion: v1 -data: - config.yaml: |2- - pipeline: - - type: kubernetes - - - type: file_output - path: /tmp/test.out ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: stanza - namespace: default -spec: - selector: - matchLabels: - name: stanza - template: - metadata: - labels: - name: stanza - spec: - serviceAccountName: stanza-metadata - containers: - - name: stanza - image: observiq/stanza:latest - imagePullPolicy: Always - resources: - limits: - memory: "250Mi" - cpu: 100m - requests: - memory: "250Mi" - cpu: 100m - volumeMounts: - - mountPath: /stanza_home/config.yaml - name: config - subPath: config.yaml - - mountPath: /var/log - name: varlog - - mountPath: /var/lib/docker/containers - name: dockerlogs - restartPolicy: Always - terminationGracePeriodSeconds: 5 - volumes: - - name: varlog - hostPath: - path: /var/log - - name: dockerlogs - hostPath: - path: /var/lib/docker/containers - - name: config - configMap: - name: stanza-config diff --git a/pkg/stanza/examples/k8s/openshift.yaml b/pkg/stanza/examples/k8s/openshift.yaml deleted file mode 100644 index 4848529dcf9a..000000000000 --- a/pkg/stanza/examples/k8s/openshift.yaml +++ /dev/null @@ -1,93 +0,0 @@ ---- -kind: ServiceAccount -apiVersion: v1 -metadata: - name: stanza-metadata - namespace: default ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -# kubernetes versions before 1.8.0 should use rbac.authorization.k8s.io/v1beta1 -metadata: - name: stanza-metadata - namespace: default -rules: - - apiGroups: [""] - resources: - - pods - - namespaces - verbs: ["get", "list"] ---- -kind: ClusterRoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: stanza-metadata -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: stanza-metadata -subjects: - - kind: ServiceAccount - name: stanza-metadata - namespace: default ---- -kind: ConfigMap -metadata: - name: stanza-config - namespace: default -apiVersion: v1 -data: - config.yaml: |2- - pipeline: - - type: aks - container_log_path: /var/log/containers/* - kubelet_journald_log_path: /var/log/journal - start_at: beginning - - type: drop_output ---- -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: stanza - namespace: default -spec: - selector: - matchLabels: - name: stanza - template: - metadata: - labels: - name: stanza - spec: - serviceAccountName: stanza-metadata - containers: - - name: stanza - image: observiq/stanza:dev - imagePullPolicy: Always - resources: - limits: - memory: "250Mi" - cpu: 100m - requests: - memory: "250Mi" - cpu: 100m - volumeMounts: - - mountPath: /stanza_home/config.yaml - name: config - subPath: config.yaml - - mountPath: /var/log - name: varlog - - mountPath: /var/lib/docker/containers - name: dockerlogs - restartPolicy: Always - terminationGracePeriodSeconds: 5 - volumes: - - name: varlog - hostPath: - path: /var/log - - name: dockerlogs - hostPath: - path: /var/lib/docker/containers - - name: config - configMap: - name: stanza-config diff --git a/pkg/stanza/examples/tomcat/access.log b/pkg/stanza/examples/tomcat/access.log deleted file mode 100644 index 687948c39aac..000000000000 --- a/pkg/stanza/examples/tomcat/access.log +++ /dev/null @@ -1,7 +0,0 @@ -10.66.2.46 - - [13/Mar/2019:10:43:00 -0400] "GET / HTTP/1.1" 404 - -10.66.2.46 - - [13/Mar/2019:10:43:01 -0400] "GET /favicon.ico HTTP/1.1" 404 - -10.66.2.46 - - [13/Mar/2019:10:43:08 -0400] "GET /manager HTTP/1.1" 302 - -10.66.2.46 - - [13/Mar/2019:10:43:08 -0400] "GET /manager/ HTTP/1.1" 403 3420 -10.66.2.46 - - [13/Mar/2019:11:00:26 -0400] "GET /manager/html HTTP/1.1" 401 2473 -10.66.2.46 - tomcat [13/Mar/2019:11:00:53 -0400] "GET /manager/html HTTP/1.1" 200 11936 -10.66.2.46 - - [13/Mar/2019:11:00:53 -0400] "GET /manager/images/asf-logo.svg HTTP/1.1" 200 19698 diff --git a/pkg/stanza/examples/tomcat/config.yaml b/pkg/stanza/examples/tomcat/config.yaml deleted file mode 100644 index 11218ee4dc97..000000000000 --- a/pkg/stanza/examples/tomcat/config.yaml +++ /dev/null @@ -1,56 +0,0 @@ ---- -pipeline: - - # Read lines from Apache Tomcat access logs - # Example input line: - # 10.66.2.46 - - [13/Mar/2019:10:43:00 -0400] "GET / HTTP/1.1" 404 - - - type: file_input - start_at: beginning - include: - - ./access.log - attributes: - log_type: tomcat - - # Parse the logs into labeled fields - # Example input: - # { - # "timestamp": "2020-06-13T11:00:53-04:00", - # "body": "10.66.2.46 - - [13/Mar/2019:10:43:00 -0400] "GET / HTTP/1.1" 404 -" - # } - - type: regex_parser - regex: >- - (?P[^\s]+) - - - (?P[^\s]+) - \[(?P[^\]]+)\] - "(?P[A-Z]+) - (?P[^\s]+)[^"]*" - (?P\d+) - (?P[\d-]+) - timestamp: - parse_from: timestamp - layout: '%d/%b/%Y:%H:%M:%S %z' - severity: - parse_from: http_status - mapping: - error: "4xx" - info: - - min: 300 - max: 399 - debug: 200 - - # Write the log to stdout - # Example input: - # { - # "timestamp": "2019-03-13T11:00:53-04:00", - # "severity": 60, - # "body": { - # "bytes_sent": "19698", - # "http_method": "GET", - # "http_status": "200", - # "remote_host": "10.66.2.46", - # "remote_user": "-", - # "url_path": "/manager/images/asf-logo.svg" - # } - # } - - type: stdout