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

docs: update 4.x branch for v4.10.0 release #4399

Merged
merged 51 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
69e425f
chore(deps): bump actions/attest-build-provenance from 1.4.3 to 1.4.4…
dependabot[bot] Nov 11, 2024
43b862e
chore(deps-dev): bump mysql2 from 3.11.3 to 3.11.4 (#4311)
dependabot[bot] Nov 11, 2024
268008d
chore(deps-dev): bump @types/node from 22.8.1 to 22.9.0 (#4312)
dependabot[bot] Nov 11, 2024
38f9369
chore(deps-dev): bump the eslint group across 1 directory with 2 upda…
dependabot[bot] Nov 11, 2024
f442c34
chore(deps): bump @opentelemetry/exporter-prometheus from 0.54.0 to 0…
dependabot[bot] Nov 14, 2024
6eb6f3b
chore(deps): update docker.elastic.co/wolfi/chainguard-base:latest do…
elastic-renovate-prod[bot] Nov 14, 2024
401cf70
chore(deps-dev): bump azure-functions-core-tools from 4.0.6280 to 4.0…
dependabot[bot] Nov 14, 2024
f5a4a68
chore(deps-dev): bump @elastic/elasticsearch from 8.15.1 to 8.16.0 (#…
dependabot[bot] Nov 18, 2024
c27e2c8
chore(deps-dev): bump undici from 6.20.1 to 6.21.0 (#4317)
dependabot[bot] Nov 18, 2024
b1fe00d
chore(deps-dev): bump the eslint group with 2 updates (#4316)
dependabot[bot] Nov 19, 2024
f6d7da3
chore(deps): update docker.elastic.co/wolfi/chainguard-base:latest do…
elastic-renovate-prod[bot] Nov 21, 2024
895e6de
chore(deps): update docker.elastic.co/wolfi/chainguard-base:latest do…
elastic-renovate-prod[bot] Nov 22, 2024
8ec05bc
chore(deps): bump docker/metadata-action from 5.5.1 to 5.6.1 (#4321)
dependabot[bot] Nov 25, 2024
c177b78
chore(deps-dev): bump mongodb from 6.10.0 to 6.11.0 (#4325)
dependabot[bot] Nov 25, 2024
21d94be
chore(deps-dev): bump typescript from 5.6.3 to 5.7.2 (#4328)
dependabot[bot] Nov 25, 2024
acbee43
chore(deps): bump @opentelemetry/core from 1.27.0 to 1.28.0 (#4326)
dependabot[bot] Nov 25, 2024
a4627a5
chore(deps-dev): bump eslint-plugin-n from 17.13.2 to 17.14.0 (#4324)
dependabot[bot] Nov 25, 2024
974d285
chore(deps-dev): bump @elastic/elasticsearch from 8.16.0 to 8.16.2 (#…
dependabot[bot] Nov 25, 2024
e71581a
chore(deps): bump @opentelemetry/sdk-metrics from 1.27.0 to 1.28.0 (#…
dependabot[bot] Nov 25, 2024
303e41b
chore(deps): bump @opentelemetry/exporter-prometheus from 0.54.2 to 0…
dependabot[bot] Nov 27, 2024
474082a
github-actions: use v1 for the oblt-actions (#4331)
v1v Nov 28, 2024
85d8b3d
chore(deps-dev): bump @types/node from 22.9.0 to 22.10.1 (#4335)
dependabot[bot] Dec 2, 2024
36af76b
chore(deps-dev): bump prettier from 3.3.3 to 3.4.1 (#4337)
dependabot[bot] Dec 2, 2024
37777d1
chore(deps): bump docker/build-push-action from 6.9.0 to 6.10.0 (#4332)
dependabot[bot] Dec 2, 2024
ac245b4
chore(deps-dev): bump the eslint group with 2 updates (#4333)
dependabot[bot] Dec 2, 2024
123a3ac
ci(updatecli): add policies autodiscovery, bump updatecli version and…
v1v Dec 2, 2024
a7f0173
chore(deps): update docker.elastic.co/wolfi/chainguard-base:latest do…
elastic-renovate-prod[bot] Dec 4, 2024
f41de95
chore(deps-dev): bump undici from 6.21.0 to 7.0.0 (#4336)
dependabot[bot] Dec 4, 2024
a207c80
chore: update CHANGELOG (#4341)
david-luna Dec 6, 2024
b5cdc99
chore(deps-dev): bump mysql2 from 3.11.4 to 3.11.5 (#4334)
dependabot[bot] Dec 6, 2024
c4450b2
ci: pin updatecli version using .tool-versions and autobump (#4340)
v1v Dec 7, 2024
e697f65
chore(deps-dev): bump @babel/cli in the babel group (#4345)
dependabot[bot] Dec 9, 2024
90eb999
chore(deps): bump @opentelemetry/* dependencies (#4346)
dependabot[bot] Dec 9, 2024
c17076b
chore(deps-dev): bump express from 4.21.1 to 4.21.2 (#4348)
dependabot[bot] Dec 9, 2024
ad35a68
chore(deps-dev): bump undici from 7.0.0 to 7.1.0 (#4349)
dependabot[bot] Dec 9, 2024
60313da
chore(deps): bump import-in-the-middle from 1.11.2 to 1.11.3 (#4351)
dependabot[bot] Dec 9, 2024
88a3bf9
chore(deps-dev): bump prettier from 3.4.1 to 3.4.2 (#4352)
dependabot[bot] Dec 9, 2024
f6467e9
chore(deps): bump actions/attest-build-provenance from 1.4.4 to 2.0.1…
dependabot[bot] Dec 9, 2024
75172b3
chore(deps): bump @opentelemetry/* deps in root (#4353)
dependabot[bot] Dec 9, 2024
dd7bdb0
github-actions: exclude bot from the triage (#4342)
v1v Dec 9, 2024
93eb736
fix: guard against apm-clients encoding/truncation of trace objects t…
trentm Dec 10, 2024
52e4edb
release 4.9.0 (#4357)
david-luna Dec 10, 2024
1499fdc
chore: deps(updatecli): Bump updatecli version to v0.89.0 (#4362)
elastic-observability-automation[bot] Dec 12, 2024
fcb1c48
chore(deps): update docker.elastic.co/wolfi/chainguard-base:latest do…
elastic-renovate-prod[bot] Dec 12, 2024
9764b37
chore(deps): bump actions/attest-build-provenance from 2.0.1 to 2.1.0…
dependabot[bot] Dec 16, 2024
79915e8
chore(deps-dev): bump mongodb from 6.11.0 to 6.12.0 (#4367)
dependabot[bot] Dec 16, 2024
03ca2bd
chore(deps-dev): bump @elastic/elasticsearch from 8.16.2 to 8.17.0 (#…
dependabot[bot] Dec 16, 2024
a59b758
chore(deps-dev): bump fastify from 5.1.0 to 5.2.0 (#4369)
dependabot[bot] Dec 16, 2024
15fdf62
chore(deps-dev): bump the eslint group with 2 updates (#4366)
dependabot[bot] Dec 16, 2024
824d67d
chore(deps): update docker.elastic.co/wolfi/chainguard-base:latest do…
elastic-renovate-prod[bot] Dec 18, 2024
2fbb0a8
better logging for config state; release 4.10.0 (#4386)
trentm Dec 24, 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
Prev Previous commit
better logging for config state; release 4.10.0 (#4386)
This cherry-picks an improvement from the 3.x branch:

> This adds a periodic (once per minute) dump of effective config changes
> from the default, once per minute at 'trace'-level.
>
> This also fixes an issue where a central-config update of `log_level`
> did not update the *child* logger on the APM client. Only the agent's
> own logger's level was updated.
>
> This adds trans.sampled to some debug logging output.

and prepares for a v4.10.0 release.

Refs: #4291 (equivalent on 3.x branch)
  • Loading branch information
trentm committed Jan 7, 2025
commit 2fbb0a846f868634e9920a2242a1d95b6ffc33ed
12 changes: 10 additions & 2 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ Notes:

See the <<upgrade-to-v4>> guide.

[[release-notes-4.10.0]]
==== 4.10.0 - 2024/12/24

[float]
===== Features

* Improve trace-level logging to better support debugging central config
and transaction sampling issues. ({issues}4291[#4291])


[[release-notes-4.9.0]]
==== 4.9.0 - 2024/12/09

Expand All @@ -50,8 +60,6 @@ See the <<upgrade-to-v4>> guide.
resulting in the APM agent no longer sending tracing data.
({pull}4359[#4359])

[float]
===== Chores


[[release-notes-4.8.1]]
Expand Down
18 changes: 18 additions & 0 deletions lib/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const errors = require('./errors');
const { InflightEventSet } = require('./InflightEventSet');
const { Instrumentation } = require('./instrumentation');
const { elasticApmAwsLambda } = require('./lambda');
const logging = require('./logging');
const Metrics = require('./metrics');
const parsers = require('./parsers');
const symbols = require('./symbols');
Expand Down Expand Up @@ -317,6 +318,23 @@ Agent.prototype.start = function (opts) {

this.logger.info(preambleData, 'Elastic APM Node.js Agent v%s', version);

if (!logging.isLoggerCustom(this.logger)) {
// Periodically dump the current config (delta from defaults) when logging
// at "trace"-level. This allows getting the effective config from a running
// agent by setting trace-level logging and getting 1 minute of logs.
// (Sometimes getting logs from application *start* is no possible.)
setInterval(() => {
if (this.logger.isLevelEnabled('trace')) {
try {
const currConfig = this._conf.getCurrConfig();
this.logger.trace({ currConfig }, 'currConfig');
} catch (err) {
this.logger.trace({ err }, 'error calculating currConfig');
}
}
}, 60 * 1000).unref();
}

if (isPreviewVersion) {
this.logger.warn(
'Version %s is a pre-release and not intended for use in production environments',
Expand Down
2 changes: 2 additions & 0 deletions lib/apm-client/apm-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ function createApmClient(config, agent) {
!logging.isLoggerCustom(agent.logger)
) {
logging.setLogLevel(agent.logger, value);
// Hackily also set the HttpApmClient._log level.
logging.setLogLevel(client._log, value);
agent.logger.info(
`Central config success: updated logger with new logLevel: ${value}`,
);
Expand Down
22 changes: 22 additions & 0 deletions lib/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const {
setStartOptions,
getPreambleData,
readEnvOptions,
CENTRAL_CONFIG_OPTS,
} = require('./schema');

const {
Expand Down Expand Up @@ -244,6 +245,27 @@ class Config {
}
return loggable;
}

// Returns an object showing the current config, excluding default values.
getCurrConfig() {
const currConfig = {};

// Start with the values from the logging preamble. This selected keys
// that were specified, and handles redaction.
for (let [k, v] of Object.entries(this.loggingPreambleData.config)) {
currConfig[k] = v.value;
}

// Then add the current value of any var possibly set by central config.
currConfig.centralConfig = this.centralConfig;
if (this.centralConfig) {
for (let k of Object.values(CENTRAL_CONFIG_OPTS)) {
currConfig[k] = this[k];
}
}

return currConfig;
}
}

function validateServiceName(s) {
Expand Down
4 changes: 4 additions & 0 deletions lib/instrumentation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,10 @@ Instrumentation.prototype.addEndedTransaction = function (transaction) {
!transaction.sampled &&
!agent._apmClient.supportsKeepingUnsampledTransaction()
) {
agent.logger.debug(
{ trans: transaction.id, trace: transaction.traceId },
'dropping unsampled transaction',
);
return;
}

Expand Down
1 change: 1 addition & 0 deletions lib/instrumentation/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function Transaction(agent, name, ...args) {
trans: this.id,
parent: this.parentId,
trace: this.traceId,
sampled: this.sampled,
name: this.name,
type: this.type,
});
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elastic-apm-node",
"version": "4.9.0",
"version": "4.10.0",
"description": "The official Elastic APM agent for Node.js",
"type": "commonjs",
"main": "index.js",
Expand Down
Loading