Skip to content

Commit

Permalink
Add otelcol shortcut to elastic-agent otel (#4816)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet authored Jun 6, 2024
1 parent 6f707b5 commit 6a02d8b
Show file tree
Hide file tree
Showing 5 changed files with 64 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
21 changes: 21 additions & 0 deletions dev-tools/packaging/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ shared:
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

- &agent_binary_common_files
LICENSE.txt:
Expand Down Expand Up @@ -201,6 +209,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 @@ -217,6 +231,7 @@ shared:
files:
<<: *agent_binary_files
<<: *agent_components
<<: *linux_otel_files


- &agent_darwin_binary_spec
Expand All @@ -235,6 +250,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 6a02d8b

Please sign in to comment.