Skip to content

Commit d13a4ed

Browse files
authored
Merge branch 'main' into fix/unittest-defaultloglevel
2 parents 172e6ab + 5ae7b1b commit d13a4ed

File tree

13 files changed

+63
-76
lines changed

13 files changed

+63
-76
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ updates:
33

44
# GitHub actions
55
- package-ecosystem: "github-actions"
6-
directory: "/"
7-
reviewers:
8-
- "elastic/observablt-ci"
6+
directories:
7+
- "/"
8+
- "/.github/workflows/*"
99
schedule:
1010
interval: "weekly"
1111
day: "sunday"
@@ -14,29 +14,3 @@ updates:
1414
github-actions:
1515
patterns:
1616
- "*"
17-
18-
# GitHub composite actions
19-
- package-ecosystem: "github-actions"
20-
directory: "/.github/workflows/bootstrap"
21-
schedule:
22-
interval: "weekly"
23-
day: "sunday"
24-
time: "22:00"
25-
reviewers:
26-
- "elastic/observablt-ci"
27-
groups:
28-
github-actions:
29-
patterns:
30-
- "*"
31-
- package-ecosystem: "github-actions"
32-
directory: "/.github/workflows/install-dependencies"
33-
schedule:
34-
interval: "weekly"
35-
day: "sunday"
36-
time: "22:00"
37-
reviewers:
38-
- "elastic/observablt-ci"
39-
groups:
40-
github-actions:
41-
patterns:
42-
- "*"

.github/workflows/install-dependencies/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
if: "${{ inputs.rust == 'true' && runner.os == 'Linux' }}"
4848
shell: bash
4949
run: cargo install --force cargo-zigbuild
50+
51+
- name: Install terraform
52+
if: "${{ runner.os == 'Linux' }}"
53+
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3
54+
with:
55+
terraform_version: 1.11.2
5056

5157
- uses: Swatinem/rust-cache@v2
5258
if: "${{ inputs.rust == 'true' }}"

.github/workflows/release-main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ jobs:
4747
run: dotnet nuget push 'build/output/_packages/*.nupkg' -k ${{secrets.GITHUB_TOKEN}} -s https://nuget.pkg.github.com/elastic/index.json --skip-duplicate --no-symbols
4848

4949
- name: Set up Docker Buildx
50-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
50+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
5151

5252
- name: Log in to the Elastic Container registry
53-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
53+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
5454
with:
5555
registry: ${{ secrets.ELASTIC_DOCKER_REGISTRY }}
5656
username: ${{ secrets.ELASTIC_DOCKER_USERNAME }}
5757
password: ${{ secrets.ELASTIC_DOCKER_PASSWORD }}
5858

5959
- name: Extract metadata (tags, labels)
6060
id: docker-meta
61-
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
61+
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
6262
with:
6363
images: ${{ env.DOCKER_IMAGE_NAME }}
6464
flavor: |

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ jobs:
4040
run: .ci/deploy.sh ${{ secrets.NUGET_API_KEY }} ${{ secrets.NUGET_API_URL }}
4141

4242
- name: Set up Docker Buildx
43-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
43+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
4444

4545
- name: Log in to the Elastic Container registry
46-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
46+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
4747
with:
4848
registry: ${{ secrets.ELASTIC_DOCKER_REGISTRY }}
4949
username: ${{ secrets.ELASTIC_DOCKER_USERNAME }}
5050
password: ${{ secrets.ELASTIC_DOCKER_PASSWORD }}
5151

5252
- name: Extract metadata (tags, labels)
5353
id: docker-meta
54-
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
54+
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
5555
with:
5656
images: ${{ env.DOCKER_IMAGE_NAME }}
5757
flavor: |

.github/workflows/updatecli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
"pull_requests": "write"
3030
}
3131
32-
- uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
32+
- uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
3333
with:
3434
registry: ghcr.io
3535
username: ${{ github.actor }}

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
updatecli v0.102.0
1+
updatecli v0.105.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# apm-agent-dotnet
22

3-
[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-dotnet/apm-agent-dotnet-mbp/main)](https://apm-ci.elastic.co/job/apm-agent-dotnet/job/apm-agent-dotnet-mbp/job/main/)
3+
[![Build Status](https://github.com/elastic/apm-agent-dotnet/actions/workflows/docs-build.yml/badge.svg)](https://github.com/elastic/apm-agent-dotnet/actions)
44
[![codecov](https://codecov.io/gh/elastic/apm-agent-dotnet/branch/main/graph/badge.svg)](https://codecov.io/gh/elastic/apm-agent-dotnet)
55

66
Please fill out this survey to help us prioritize framework support:

docs/reference/setup-auto-instrumentation.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,13 @@ The following service names are **always** excluded from profiling by default.
378378
379379
The default value is `warn`. More verbose log levels like `trace` and `debug` can affect the runtime performance of profiler auto instrumentation, so are recommended *only* for diagnostics purposes.
380380
381-
This takes precedence over the now deprecated `ELASTIC_APM_PROFILER_LOG`
381+
This takes precedence over the now deprecated `ELASTIC_APM_PROFILER_LOG` environment variable.
382382
383-
`ELASTIC_OTEL_LOG_DIRECTORY` *(optional)*
383+
::::{note}
384+
Although prefixed with `OTEL_` we prefer `OTEL_LOG_LEVEL`, when present as this aligns with the configuration for OpenTelemetry SDKs, simplifying migrations.
385+
::::
386+
387+
`OTEL_DOTNET_AUTO_LOG_DIRECTORY` *(optional)*
384388
: The directory in which to write profiler log files. If unset, defaults to
385389
386390
* `%PROGRAMDATA%\elastic\apm-agent-dotnet\logs` on Windows
@@ -389,13 +393,15 @@ This takes precedence over the now deprecated `ELASTIC_APM_PROFILER_LOG`
389393
390394
If the default directory cannot be written to for some reason, the profiler will try to write log files to a `logs` directory in the home directory specified by `ELASTIC_APM_PROFILER_HOME` environment variable.
391395
392-
This takes precedence over the now deprecated `ELASTIC_APM_PROFILER_LOG_DIR`
396+
This takes precedence over the now deprecated `ELASTIC_APM_PROFILER_LOG_DIR` environment variable.
393397
394398
::::{important}
395399
The user account under which the profiler process runs must have permission to write to the destination log directory. Specifically, ensure that when running on IIS, the [AppPool identity](https://learn.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities) has write permissions in the target directory.
396-
397400
::::
398401
402+
::::{note}
403+
Although prefixed with `OTEL_` we prefer `OTEL_LOG_LEVEL`, when present as this aligns with the configuration for OpenTelemetry SDKs, simplifying migrations.
404+
::::
399405
400406
`ELASTIC_OTEL_LOG_TARGETS` *(optional)*
401407
: A semi-colon separated list of targets for profiler logs. Valid values are

src/Elastic.Apm/Logging/GlobalLogConfiguration.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ public static class LogEnvironmentVariables
120120
public const string ELASTIC_APM_LOG_LEVEL = nameof(ELASTIC_APM_LOG_LEVEL);
121121
public const string ELASTIC_APM_LOG_DIRECTORY = nameof(ELASTIC_APM_LOG_DIRECTORY);
122122

123-
124123
// profiler logs are deprecated in favor of ELASTIC_OTEL_*
125124
public const string ELASTIC_APM_PROFILER_LOG = nameof(ELASTIC_APM_PROFILER_LOG);
126125
public const string ELASTIC_APM_PROFILER_LOG_DIR = nameof(ELASTIC_APM_PROFILER_LOG_DIR);

src/Elastic.Apm/Model/Error.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5-
using System;
65
using System.Collections.Generic;
76
using System.Diagnostics;
87
using System.Linq;
@@ -66,13 +65,16 @@ private void CheckAndCaptureBaggage(Transaction transaction)
6665

6766
//if context was not set prior we set it now to ensure we capture baggage for errors
6867
//occuring during unsampled transactions
69-
Context ??= transaction.Context.DeepCopy();
68+
Context ??= transaction?.Context.DeepCopy();
7069

7170
foreach (var baggage in Activity.Current.Baggage)
7271
{
7372
if (!WildcardMatcher.IsAnyMatch(Configuration.BaggageToAttach, baggage.Key))
7473
continue;
7574

75+
// The context is created only if there is a baggage value to insert.
76+
Context ??= new Context();
77+
7678
var newKey = $"baggage.{baggage.Key}";
7779
var labels = Context.InternalLabels.Value;
7880
labels[newKey] = baggage.Value;

0 commit comments

Comments
 (0)