Skip to content

Commit

Permalink
Add otelcol shortcut to elastic-agent otel (#4816)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6a02d8b)

# Conflicts:
#	dev-tools/packaging/packages.yml
  • Loading branch information
nchaulet authored and mergify[bot] committed Jun 25, 2024
1 parent ef96f42 commit e8aed2a
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 0 deletions.
31 changes: 31 additions & 0 deletions changelog/fragments/1717077736-otelcol-shortcut.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Kind can be one of:
# - breaking-change: a change to previously-documented behavior
# - deprecation: functionality that is being removed in a later release
# - bug-fix: fixes a problem in a previous version
# - enhancement: extends functionality but does not break or fix existing behavior
# - feature: new functionality
# - known-issue: problems that we are aware of in a given version
# - security: impacts on the security of a product or a user’s deployment.
# - upgrade: important information for someone upgrading from a prior version
# - other: does not fit into any of the other categories
kind: feature

# Change summary; a 80ish characters long description of the change.
summary: Add otelcol shortuct to elastic-agent otel

# Long description; in case the summary is not enough to describe the change
# this field accommodate a description without length limits.
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
#description:

# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
component: elastic-agent

# PR URL; optional; the PR number that added the changeset.
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
# Please provide it if you are adding a fragment for a different PR.
pr: https://github.com/elastic/elastic-agent/pull/4816
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
# If not present is automatically filled by the tooling with the issue linked to the PR number.
#issue: https://github.com/owner/repo/1234
5 changes: 5 additions & 0 deletions dev-tools/packaging/files/darwin/otelcol.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

BASEDIR=$(dirname "$0")

exec "$BASEDIR/elastic-agent" otel "$@"
5 changes: 5 additions & 0 deletions dev-tools/packaging/files/linux/otelcol.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

BASEDIR=$(dirname "$0")

exec "$BASEDIR/elastic-agent" otel "$@"
2 changes: 2 additions & 0 deletions dev-tools/packaging/files/windows/otelcol.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$workdir = Split-Path $MyInvocation.MyCommand.Path
& "$workdir\elastic-agent" otel $args
79 changes: 79 additions & 0 deletions dev-tools/packaging/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,72 @@ shared:
content: >
{{ manifest }}
<<<<<<< HEAD
=======
# MacOS pkg spec for community beats.
- &macos_agent_pkg_spec
<<: *common
extra_vars:
# OS X 10.11 El Capitan is the oldest supported by Go 1.14.
# https://golang.org/doc/go1.14#ports
min_supported_osx_version: 10.11
identifier: 'co.{{.BeatVendor | tolower}}.beats.{{.BeatName}}'
install_path: /Library/Application Support
pre_install_script: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/scripts/preinstall.tmpl'
post_install_script: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/scripts/postinstall.elastic-agent.tmpl'
files:
/Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/bin/{{.BeatName}}{{.BinaryExt}}:
source: build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}}
mode: 0755
/Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/LICENSE.txt:
source: '{{ repo.RootDir }}/LICENSE.txt'
mode: 0644
/Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/NOTICE.txt:
source: '{{ repo.RootDir }}/NOTICE.txt'
mode: 0644
/Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/README.md:
template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/common/README.md.tmpl'
mode: 0644
/Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/.build_hash.txt:
content: >
{{ commit }}
mode: 0644
/Library/Application Support/{{.BeatVendor}}/{{.BeatName}}/{{.identifier}}.plist:
template: '{{ elastic_beats_dir }}/dev-tools/packaging/templates/darwin/launchd-daemon.plist.tmpl'
mode: 0644
/etc/{{.BeatName}}/elastic-agent.reference.yml:
source: 'elastic-agent.reference.yml'
mode: 0644
/etc/{{.BeatName}}/elastic-agent.yml:
source: 'elastic-agent.yml'
mode: 0600
config: true
/etc/{{.BeatName}}/otel.yml:
source: 'otel.yml'
mode: 0600
config: true
/etc/{{.BeatName}}/.elastic-agent.active.commit:
content: >
{{ commit }}
mode: 0644
/etc/{{.BeatName}}/data/{{.BeatName}}-{{ commit_short }}/{{.BeatName}}{{.BinaryExt}}:
source: build/golang-crossbuild/{{.BeatName}}-{{.GOOS}}-{{.Platform.Arch}}{{.BinaryExt}}
mode: 0755
/etc/{{.BeatName}}/data/{{.BeatName}}-{{ commit_short }}/components:
source: '{{.AgentDropPath}}/{{.GOOS}}-{{.AgentArchName}}.tar.gz/'
mode: 0755
config_mode: 0644
skip_on_missing: true

- &linux_otel_files
'otelcol':
source: '{{ repo.RootDir }}/dev-tools/packaging/files/linux/otelcol.sh'
mode: 0755
'data/{{.BeatName}}-{{ commit_short }}/otelcol':
source: '{{ repo.RootDir }}/dev-tools/packaging/files/linux/otelcol.sh'
mode: 0755

>>>>>>> 6a02d8bdc2 (Add otelcol shortcut to `elastic-agent otel` (#4816))
- &agent_binary_common_files
LICENSE.txt:
source: '{{ repo.RootDir }}/LICENSE.txt'
Expand Down Expand Up @@ -146,6 +212,12 @@ shared:
content: >
{{ agent_package_version }}
mode: 0644
'otelcol':
source: '{{ repo.RootDir }}/dev-tools/packaging/files/darwin/otelcol.sh'
mode: 0755
'data/{{.BeatName}}-{{ commit_short }}/otelcol':
source: '{{ repo.RootDir }}/dev-tools/packaging/files/darwin/otelcol.sh'
mode: 0755
<<: *agent_darwin_app_bundle_files
<<: *agent_binary_common_files

Expand All @@ -162,6 +234,7 @@ shared:
files:
<<: *agent_binary_files
<<: *agent_components
<<: *linux_otel_files


- &agent_darwin_binary_spec
Expand All @@ -180,6 +253,12 @@ shared:
mode: 0755
config_mode: 0644
skip_on_missing: true
'otelcol.ps1':
source: '{{ repo.RootDir }}/dev-tools/packaging/files/windows/otelcol.ps1'
mode: 0755
'data/{{.BeatName}}-{{ commit_short }}/otelcol.ps1':
source: '{{ repo.RootDir }}/dev-tools/packaging/files/windows/otelcol.ps1'
mode: 0755

- &agent_docker_spec
<<: *agent_binary_spec
Expand Down

0 comments on commit e8aed2a

Please sign in to comment.