Skip to content

Commit a7838a4

Browse files
authored
Add Logz.io exporter and automated release workflow for OpenTelemetry Lambda Collector (#5)
* add exporter logzio * update message for release
1 parent 074cbf3 commit a7838a4

7 files changed

Lines changed: 137 additions & 33 deletions

File tree

.github/workflows/layer-publish.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ on:
44
workflow_call:
55
inputs:
66
artifact-name:
7-
description: 'This should correspond to a actions/upload-artifact name earlier in the build. The file name and the name of the artifact containing it must be equal.'
7+
description: "This should correspond to a actions/upload-artifact name earlier in the build. The file name and the name of the artifact containing it must be equal."
88
required: true
99
type: string
1010
layer-name:
11-
description: 'Layer name not including other parts like arch or version.'
11+
description: "Layer name not including other parts like arch or version."
1212
required: true
1313
type: string
1414
component-version:
15-
description: 'Version of the component included in this release. Not the same as the layer/tagged version.'
15+
description: "Version of the component included in this release. Not the same as the layer/tagged version."
1616
required: true
1717
type: string
1818
architecture:
19-
description: '(optional) amd64 or arm64'
19+
description: "(optional) amd64 or arm64"
2020
required: false
2121
type: string
2222
runtimes:
23-
description: '(optional) a space delimited list of compatible runtimes (from https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)'
23+
description: "(optional) a space delimited list of compatible runtimes (from https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)"
2424
required: false
2525
type: string
2626
release-group:
@@ -29,49 +29,45 @@ on:
2929
default: dev
3030
type: string
3131
aws_region:
32-
description: 'Publish to which AWS region?'
32+
description: "Publish to which AWS region?"
3333
required: true
3434
type: string
3535

36-
3736
permissions:
3837
id-token: write
3938
contents: read
4039

4140
jobs:
4241
publish_layer:
4342
runs-on: ubuntu-latest
44-
4543
steps:
46-
4744
- name: Construct Layer Name
4845
shell: bash
4946
run: |
5047
LAYER_NAME=${{ inputs.layer-name }}
51-
48+
5249
if [[ -n "${{ inputs.architecture }}" ]]; then
5350
LAYER_NAME=$LAYER_NAME-${{ inputs.architecture }}
5451
ARCH=$(echo "${{ inputs.architecture }}" | sed -r 's/amd64/x86_64/g')
5552
else
5653
ARCH="x86_64 arm64"
5754
fi
5855
echo "ARCH=$ARCH" >> $GITHUB_ENV
59-
56+
6057
if [[ -n "${{ inputs.runtimes }}" ]]; then
6158
RUNTIMES="--compatible-runtimes ${{ inputs.runtimes }}"
6259
fi
6360
echo "RUNTIMES=$RUNTIMES" >> $GITHUB_ENV
64-
61+
6562
if [[ "${{ inputs.release-group }}" != "prod" ]]; then
6663
LAYER_NAME=$LAYER_NAME-${{ inputs.release-group }}
6764
fi
68-
69-
LAYER_VERSION=$(echo "$GITHUB_REF_NAME" | sed -r 's/.*\/[^0-9\.]*//g')
70-
LAYER_VERSION_CLEANED=$(echo "$LAYER_VERSION" | sed -r 's/\./_/g')
71-
72-
LAYER_NAME=$LAYER_NAME-$LAYER_VERSION_CLEANED
65+
66+
CLEAN_VERSION=$(echo "${{ inputs.component-version }}" | sed -r 's/\./_/g')
67+
68+
LAYER_NAME=$LAYER_NAME-$CLEAN_VERSION
7369
echo "LAYER_NAME=$LAYER_NAME" >> $GITHUB_ENV
74-
70+
7571
echo GITHUB_ENV:
7672
cat $GITHUB_ENV
7773

.github/workflows/release-layer-collector.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- uses: actions/checkout@v4
3434
- uses: actions/setup-go@v5
3535
with:
36-
go-version: '^1.23.1'
36+
go-version: "^1.23.1"
3737
- name: build
3838
run: make -C collector package GOARCH=${{ matrix.architecture }}
3939
- uses: actions/upload-artifact@v4
@@ -87,3 +87,33 @@ jobs:
8787
release-group: prod
8888
aws_region: ${{ matrix.aws_region }}
8989
secrets: inherit
90+
91+
update-release:
92+
runs-on: ubuntu-latest
93+
needs:
94+
- publish-layer
95+
- build-layer
96+
steps:
97+
- uses: actions/checkout@v4
98+
99+
- name: Append Layer ARNs to Release Body
100+
run: |
101+
COLLECTOR_VERSION=${{ needs.build-layer.outputs.COLLECTOR_VERSION }}
102+
103+
MESSAGE="### Lambda Layers for OpenTelemetry Collector (${COLLECTOR_VERSION})\n\n"
104+
MESSAGE+="The following Lambda layers are available for this release. Use the appropriate ARN for your Lambda architecture:\n\n"
105+
MESSAGE+="#### 🖥️ **amd64 (x86_64)**\n"
106+
MESSAGE+="\`\`\`\n"
107+
MESSAGE+="arn:aws:lambda:<region>:486140753397:layer:logzio-opentelemetry-collector-amd64-${COLLECTOR_VERSION//./_}:1\n"
108+
MESSAGE+="\`\`\`\n\n"
109+
MESSAGE+="#### 📱 **arm64**\n"
110+
MESSAGE+="\`\`\`\n"
111+
MESSAGE+="arn:aws:lambda:<region>:486140753397:layer:logzio-opentelemetry-collector-arm64-${COLLECTOR_VERSION//./_}:1\n"
112+
MESSAGE+="\`\`\`\n\n"
113+
114+
# Append the message to the release notes
115+
gh release view ${{ github.ref_name }} --json body -q .body > release_body.md
116+
echo -e "\n$MESSAGE" >> release_body.md
117+
gh release edit ${{ github.ref_name }} --notes-file release_body.md
118+
env:
119+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

collector/go.mod

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ require (
4242
github.com/alecthomas/participle/v2 v2.1.1 // indirect
4343
github.com/antchfx/xmlquery v1.4.2 // indirect
4444
github.com/antchfx/xpath v1.3.2 // indirect
45+
github.com/apache/thrift v0.21.0 // indirect
4546
github.com/aws/aws-sdk-go-v2 v1.32.3 // indirect
4647
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect
4748
github.com/aws/aws-sdk-go-v2/config v1.28.1 // indirect
@@ -69,6 +70,7 @@ require (
6970
github.com/elastic/go-grok v0.3.1 // indirect
7071
github.com/elastic/lunes v0.1.0 // indirect
7172
github.com/expr-lang/expr v1.16.9 // indirect
73+
github.com/fatih/color v1.16.0 // indirect
7274
github.com/felixge/httpsnoop v1.0.4 // indirect
7375
github.com/fsnotify/fsnotify v1.8.0 // indirect
7476
github.com/go-logr/logr v1.4.2 // indirect
@@ -83,27 +85,32 @@ require (
8385
github.com/google/uuid v1.6.0 // indirect
8486
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect
8587
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
88+
github.com/hashicorp/go-hclog v1.6.3 // indirect
8689
github.com/hashicorp/go-version v1.7.0 // indirect
8790
github.com/hashicorp/golang-lru v1.0.2 // indirect
8891
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
8992
github.com/iancoleman/strcase v0.3.0 // indirect
9093
github.com/inconshreveable/mousetrap v1.1.0 // indirect
94+
github.com/jaegertracing/jaeger v1.62.0 // indirect
9195
github.com/jonboulle/clockwork v0.4.0 // indirect
9296
github.com/json-iterator/go v1.1.12 // indirect
9397
github.com/klauspost/compress v1.17.11 // indirect
9498
github.com/knadh/koanf/maps v0.1.1 // indirect
9599
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
96100
github.com/knadh/koanf/v2 v2.1.1 // indirect
97101
github.com/lightstep/go-expohisto v1.0.0 // indirect
98-
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
102+
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect
99103
github.com/magefile/mage v1.15.0 // indirect
104+
github.com/mattn/go-colorable v0.1.13 // indirect
105+
github.com/mattn/go-isatty v0.0.20 // indirect
100106
github.com/mitchellh/copystructure v1.2.0 // indirect
101107
github.com/mitchellh/reflectwalk v1.0.2 // indirect
102108
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
103109
github.com/modern-go/reflect2 v1.0.2 // indirect
104110
github.com/mostynb/go-grpc-compression v1.2.3 // indirect
105111
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
106112
github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.113.0 // indirect
113+
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/logzioexporter v0.113.0 // indirect
107114
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.113.0 // indirect
108115
github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.113.0 // indirect
109116
github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.113.0 // indirect
@@ -114,6 +121,7 @@ require (
114121
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.113.0 // indirect
115122
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.113.0 // indirect
116123
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.113.0 // indirect
124+
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.113.0 // indirect
117125
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.113.0 // indirect
118126
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.113.0 // indirect
119127
github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.113.0 // indirect
@@ -126,7 +134,7 @@ require (
126134
github.com/open-telemetry/opentelemetry-lambda/collector/receiver/telemetryapireceiver v0.98.0 // indirect
127135
github.com/pierrec/lz4/v4 v4.1.21 // indirect
128136
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
129-
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
137+
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
130138
github.com/prometheus/client_golang v1.20.5 // indirect
131139
github.com/prometheus/client_model v0.6.1 // indirect
132140
github.com/prometheus/common v0.60.1 // indirect

0 commit comments

Comments
 (0)