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

Main to 0.x #315

Merged
merged 41 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7e1dcad
Bump the github-actions group with 1 update (#250)
dependabot[bot] Dec 18, 2023
0d78519
Add sample app (#249)
LikeTheSalad Dec 19, 2023
f2264ed
ci(release): use new set of credentials for GPG and Maven Central (#255)
v1v Jan 16, 2024
5c9059a
ci(buildkite): vault context switch (#256)
v1v Jan 16, 2024
c00c4a3
Revert "Bump the github-actions group with 1 update" (#257)
v1v Jan 16, 2024
75a38a8
ci(release): use the new vault secret path (#258)
v1v Jan 17, 2024
ed1a6dc
ci(release): fetch field in plain format (#259)
v1v Jan 17, 2024
dbd3b99
Sim operator fix (#261)
LikeTheSalad Jan 18, 2024
b8ad9ba
Using short key id (#262)
LikeTheSalad Jan 18, 2024
6ff031f
Release 0.13.1 (#263)
apmmachine Jan 18, 2024
152a295
backstage: add tags for the obltmachine/apmmachine and other things (…
v1v Jan 26, 2024
3761997
Release/0.14.0 (#267)
LikeTheSalad Feb 2, 2024
947da73
Preparing for the next release (#268)
apmmachine Feb 2, 2024
2f9cf82
Updated the changelog (#269)
LikeTheSalad Feb 2, 2024
beeb312
Make resources configurable (#276)
LikeTheSalad Mar 11, 2024
d839f8e
ci: use VM with the installed tools and fallback otherwise (#274)
v1v Mar 11, 2024
ced2449
Preparing for the next release (#277)
apmmachine Mar 12, 2024
28d4cf9
github-action: listen for all the github workflows (#279)
v1v Mar 13, 2024
74cda37
security: add permissions block to workflows (#272)
reakaleek Mar 13, 2024
16eee2d
Documentation update (#281)
LikeTheSalad Mar 14, 2024
bf755f0
Cicd version validation (#282)
LikeTheSalad Mar 14, 2024
77ea42a
Updating setup doc versions in post deploy process (#283)
LikeTheSalad Mar 14, 2024
f33bb63
Cicd release messages update (#284)
LikeTheSalad Mar 14, 2024
561606a
Github action to automatically update version branch after a release …
LikeTheSalad Mar 14, 2024
05abcf8
Remove compilesdk validation (#292)
LikeTheSalad Apr 3, 2024
a24c350
Preparing for the next release (#294)
apmmachine Apr 3, 2024
39f0e3d
Resolving main to release-branch conflicts before creating PR from ma…
LikeTheSalad Apr 8, 2024
7ef9a1d
Upgrade gradle version (#300)
LikeTheSalad Apr 22, 2024
02cf1df
github-action: enable provenance for jar/aar files (#288)
v1v Apr 23, 2024
2bdb360
Documentation changes (#302)
LikeTheSalad Apr 25, 2024
7ede106
github-action: add attestations scope (#305)
v1v Apr 26, 2024
f0e735e
Bump upstream version (#304)
LikeTheSalad Apr 29, 2024
b7d76f4
Bump actions/download-artifact from 3 to 4 in the github-actions grou…
dependabot[bot] Apr 29, 2024
abd2da0
Revert "Bump actions/download-artifact from 3 to 4 in the github-acti…
v1v Apr 29, 2024
76aac2b
github-action: use setup composite action for jdk conf (#311)
v1v May 8, 2024
d14eff2
Addressing r8 issues (#309)
LikeTheSalad May 8, 2024
a489a64
github-action: delete opentelemetry workflow (#312)
v1v May 14, 2024
7838098
github-action: use actions/attest-build-provenance (#313)
v1v May 15, 2024
3087a50
Adding faq on SSL/TLS config (#310)
LikeTheSalad May 17, 2024
884fce6
Preparing for the next release (#314)
apmmachine May 17, 2024
bebd06b
Merge branch 'main' into main-to-0.x
LikeTheSalad May 17, 2024
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
7 changes: 6 additions & 1 deletion .buildkite/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ agents:
provider: "gcp"
image: "family/apm-agent-android-ubuntu-2204"

env:
TARBALL_FILE: ${TARBALL_FILE:-dist.tar}

steps:
- label: "Run the release"
key: "release"
commands: .ci/release-wrapper.sh
artifact_paths: "release.out"
artifact_paths:
- "release.out"
- "${TARBALL_FILE}"

notify:
- slack:
Expand Down
8 changes: 6 additions & 2 deletions .ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [[ "$target_specifier" == "all" || "$target_specifier" == "mavenCentral" ]];
./gradlew publishElasticPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository $COMMON_GRADLE_DEPLOY_PARAMS
else
echo "--- Release the binaries to Maven Central :package: (dry-run)"
./gradlew tasks
./gradlew assemble
fi
fi

Expand All @@ -35,7 +35,11 @@ if [[ "$target_specifier" == "all" || "$target_specifier" == "pluginPortal" ]];
./gradlew publishPlugins -Pgradle.publish.key=$PLUGIN_PORTAL_KEY -Pgradle.publish.secret=$PLUGIN_PORTAL_SECRET $COMMON_GRADLE_DEPLOY_PARAMS
else
echo "--- Release the binaries to Gradle Plugin portal :package: (dry-run)"
./gradlew tasks
./gradlew assemble
fi
fi

echo "--- Archive the build folders with jar/aar files"
find . -type d -name build -exec find {} \( -name '*.jar' -o -name '*.aar' \) -print0 \; | xargs -0 tar -cvf "${TARBALL_FILE:-dist.tar}"

set -x
27 changes: 27 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---

name: common build tasks
description: Install specific JDK

inputs:
java-version:
description: 'Testing Java version'
required: true
default: '17'
java-distribution:
description: 'Testing Java distribution'
required: true
default: 'temurin'
shell:
description: 'Default shell'
default: 'bash'
required: false

runs:
using: "composite"
steps:
- name: Set up testing JDK
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.java-distribution }}
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
version: 2
updates:

Expand All @@ -14,3 +15,17 @@ updates:
github-actions:
patterns:
- "*"

# GitHub composite actions
- package-ecosystem: "github-actions"
directory: "/.github/actions/setup"
schedule:
interval: "weekly"
day: "sunday"
time: "22:00"
reviewers:
- "elastic/observablt-ci"
groups:
github-actions:
patterns:
- "*"
31 changes: 30 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: lint
run: ./gradlew lint
- name: Verify OSS compliance
Expand All @@ -31,6 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Build
run: ./gradlew assemble
- name: Test
Expand Down Expand Up @@ -62,6 +64,12 @@ jobs:
test-release:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
permissions:
attestations: write
contents: write
id-token: write
env:
TARBALL_FILE: dist.tar
steps:
- id: buildkite
name: Run Release dry-run
Expand All @@ -71,9 +79,30 @@ jobs:
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: apm-agent-android-release
pipelineBranch: ${{ github.ref_name }}
waitFor: true
printBuildLogs: false
artifactName: signed-artifacts
artifactPath: ${{ env.TARBALL_FILE }}
buildEnvVars: |
branch_specifier=main
branch_specifier=${{ github.ref_name }}
target_specifier=all
dry_run=true
TARBALL_FILE=${{ env.TARBALL_FILE }}

- uses: actions/download-artifact@v3
with:
name: signed-artifacts

- name: untar the buildkite tarball
run: tar xvf ${{ env.TARBALL_FILE }}

- name: generate build provenance (jar files)
uses: actions/attest-build-provenance@951c0c5f8e375ad4efad33405ab77f7ded2358e4 # v1.1.1
with:
subject-path: "${{ github.workspace }}/**/build/libs/*.jar"

- name: generate build provenance (aar files)
uses: actions/attest-build-provenance@951c0c5f8e375ad4efad33405ab77f7ded2358e4 # v1.1.1
with:
subject-path: "${{ github.workspace }}/**/build/outputs/aar/*.aar"
22 changes: 0 additions & 22 deletions .github/workflows/opentelemetry.yml

This file was deleted.

30 changes: 28 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest

env:
TARBALL_FILE: dist.tar
permissions:
attestations: write
contents: write
id-token: write
steps:
- id: notification
name: Notify that a release will start
Expand All @@ -60,13 +65,34 @@ jobs:
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: apm-agent-android-release
pipelineBranch: ${{ github.ref_name }}
waitFor: true
printBuildLogs: false
artifactName: signed-artifacts
artifactPath: ${{ env.TARBALL_FILE }}
buildEnvVars: |
branch_specifier=${{ inputs.branch_specifier || 'main' }}
target_specifier=${{ inputs.target_specifier || 'all' }}
version_override_specifier=${{ inputs.version_override_specifier || '' }}
dry_run=${{ inputs.dry_run || 'false' }}
TARBALL_FILE=${{ env.TARBALL_FILE }}

- uses: actions/download-artifact@v3
with:
name: signed-artifacts

- name: untar the buildkite tarball
run: tar xvf ${{ env.TARBALL_FILE }}

- name: generate build provenance (jar files)
uses: actions/attest-build-provenance@951c0c5f8e375ad4efad33405ab77f7ded2358e4 # v1.1.1
with:
subject-path: "${{ github.workspace }}/**/build/libs/*.jar"

- name: generate build provenance (aar files)
uses: actions/attest-build-provenance@951c0c5f8e375ad4efad33405ab77f7ded2358e4 # v1.1.1
with:
subject-path: "${{ github.workspace }}/**/build/outputs/aar/*.aar"

- if: ${{ success() }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
Expand Down Expand Up @@ -109,6 +135,6 @@ jobs:
with:
ref: ${{ inputs.branch_specifier || 'main' }}
token: ${{ env.GITHUB_TOKEN }}

- uses: ./.github/actions/setup
- if: ${{ ! inputs.dry_run }}
run: ./gradlew postDeploy -Prelease=true -Pversion_override=${{ inputs.version_override_specifier || '' }}
1 change: 1 addition & 0 deletions .github/workflows/snapshoty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Assemble
run: ./gradlew assemble
- name: Publish snaphosts
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/updateVersionBranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ jobs:
text: ${{ github.event.pull_request.head.ref }}
regex: 'post-release/(\d+).+'

- run: gh pr create --base ${{ env.BASE_BRANCH }} --title 'Merge main into version branch' --body 'Created by Github action' --reviewer elastic/apm-agent-android
- run: |
CONFLICT_RESOLUTION_BRANCH="post-release/main-to-${{ env.BASE_BRANCH }}"
git switch ${{ env.BASE_BRANCH }}
git checkout -b $CONFLICT_RESOLUTION_BRANCH
git merge main --strategy-option theirs
git push -u origin $CONFLICT_RESOLUTION_BRANCH
gh pr create --base ${{ env.BASE_BRANCH }} --title 'Merge main into version branch' --body 'Created by Github action :robot:' --reviewer elastic/apm-agent-android
env:
GH_TOKEN: ${{ env.GITHUB_TOKEN }}
BASE_BRANCH: "${{ steps.major-version.outputs.group1 }}.x"
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11
17
8 changes: 8 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ ${next_release_notes}
* New feature: {pull}000[#000]
////

[[release-notes-0.17.0]]
==== 0.17.0 - 2024/05/17

[float]
===== Features

* Adding consumer R8 rules to address R8 full mode: {pull}309[#309]

[[release-notes-0.16.0]]
==== 0.16.0 - 2024/04/03

Expand Down
2 changes: 1 addition & 1 deletion android-sdk-ktx/metadata/notice.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dependencies.hash=AFDBF157F73953F0B7829B5B718072E7
dependencies.hash=4335DC6BB998D19BBBD590A9B2803A50
4 changes: 3 additions & 1 deletion android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ shadowJar {
dependencies {
api libs.opentelemetry.sdk
api libs.opentelemetry.android
api libs.opentelemetry.events
api libs.opentelemetry.api.incubator
api libs.stagemonitor.configuration
api libs.okhttp
implementation project(':android-common')
implementation libs.opentelemetry.android.instrumentation.api
implementation libs.opentelemetry.android.instrumentation.lifecycle
implementation libs.androidx.lifecycle
implementation libs.weaklockfree
implementation libs.opentelemetry.exporter.otlp
Expand Down
2 changes: 1 addition & 1 deletion android-sdk/metadata/notice.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dependencies.hash=77B4570CA3D2C0BA9C3541561D0679C0
dependencies.hash=A0177AAB7C169836786E530C6453B8A1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.app.Application;
import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.lifecycle.ProcessLifecycleOwner;

Expand All @@ -42,7 +43,7 @@
import co.elastic.apm.android.sdk.connectivity.Connectivity;
import co.elastic.apm.android.sdk.connectivity.opentelemetry.SignalConfiguration;
import co.elastic.apm.android.sdk.connectivity.opentelemetry.exporters.VisitableExporters;
import co.elastic.apm.android.sdk.features.persistence.SignalDiskExporter;
import co.elastic.apm.android.sdk.features.persistence.SignalFromDiskExporter;
import co.elastic.apm.android.sdk.instrumentation.Instrumentations;
import co.elastic.apm.android.sdk.internal.api.filter.ComposableFilter;
import co.elastic.apm.android.sdk.internal.configuration.Configurations;
Expand All @@ -67,17 +68,18 @@
import co.elastic.apm.android.sdk.session.SessionManager;
import io.opentelemetry.android.OpenTelemetryRum;
import io.opentelemetry.android.config.OtelRumConfig;
import io.opentelemetry.android.features.diskbuffering.DiskBufferingConfiguration;
import io.opentelemetry.android.instrumentation.activity.VisibleScreenTracker;
import io.opentelemetry.android.instrumentation.lifecycle.AndroidLifecycleInstrumentationBuilder;
import io.opentelemetry.android.instrumentation.startup.AppStartupTimer;
import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.events.GlobalEventEmitterProvider;
import io.opentelemetry.api.incubator.events.GlobalEventLoggerProvider;
import io.opentelemetry.sdk.logs.LogRecordProcessor;
import io.opentelemetry.sdk.logs.SdkLoggerProviderBuilder;
import io.opentelemetry.sdk.logs.data.LogRecordData;
import io.opentelemetry.sdk.logs.internal.SdkEventEmitterProvider;
import io.opentelemetry.sdk.logs.internal.SdkEventLoggerProvider;
import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder;
import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.resources.Resource;
Expand Down Expand Up @@ -205,7 +207,7 @@ public static void resetForTest() {
ConnectionHttpAttributesVisitor.resetForTest();
ServiceManager.resetForTest();
GlobalOpenTelemetry.resetForTest();
GlobalEventEmitterProvider.resetForTest();
GlobalEventLoggerProvider.resetForTest();
instance = null;
}

Expand Down Expand Up @@ -281,9 +283,8 @@ private void initializeOpentelemetry(Application app, AgentDependenciesInjector
Resource resource = configuration.resource
.merge(Resource.create(resourceAttrs));

OtelRumConfig rumConfig = new OtelRumConfig();
rumConfig.disableNetworkAttributes();
rumConfig.disableNetworkChangeMonitoring();
OtelRumConfig rumConfig = getOtelRumConfig();

OpenTelemetryRum rum = OpenTelemetryRum.builder(app, rumConfig)
.addTracerProviderCustomizer((sdkTracerProviderBuilder, application) -> configureTracerProviderBuilder(sdkTracerProviderBuilder, signalConfiguration, resource, globalAttributesVisitor, sampleRateManager))
.addMeterProviderCustomizer((sdkMeterProviderBuilder, application) -> configureMeterProviderBuilder(sdkMeterProviderBuilder, signalConfiguration, resource, sampleRateManager))
Expand All @@ -302,16 +303,28 @@ private void initializeOpentelemetry(Application app, AgentDependenciesInjector

OpenTelemetry openTelemetry = rum.getOpenTelemetry();
GlobalOpenTelemetry.set(openTelemetry);
GlobalEventEmitterProvider.set(SdkEventEmitterProvider.create(openTelemetry.getLogsBridge(), ntpManager.getClock()));
GlobalEventLoggerProvider.set(SdkEventLoggerProvider.create(openTelemetry.getLogsBridge(), ntpManager.getClock()));

if (persistenceInitializer != null) {
SignalDiskExporter.set(persistenceInitializer.createSignalDiskExporter());
SignalFromDiskExporter.set(persistenceInitializer.createSignalDiskExporter());
configuration.persistenceConfiguration.exportScheduler.onPersistenceEnabled();
} else {
configuration.persistenceConfiguration.exportScheduler.onPersistenceDisabled();
}
}

@NonNull
private static OtelRumConfig getOtelRumConfig() {
OtelRumConfig rumConfig = new OtelRumConfig();
rumConfig.disableNetworkAttributes();
rumConfig.disableNetworkChangeMonitoring();
rumConfig.disableAnrDetection();
rumConfig.disableCrashReporting();
rumConfig.disableSlowRenderingDetection();
rumConfig.setDiskBufferingConfiguration(DiskBufferingConfiguration.builder().setEnabled(false).build());
return rumConfig;
}

private PersistenceInitializer tryInitializePersistence(SignalConfiguration signalConfiguration, AgentDependenciesInjector injector) {
if (configuration.persistenceConfiguration.enabled && signalConfiguration instanceof VisitableExporters) {
Elog.getLogger().debug("Initializing the persistence feature");
Expand Down
Loading
Loading