Skip to content

Commit

Permalink
Merge pull request #612 from newrelic/dev
Browse files Browse the repository at this point in the history
Release 10.6
  • Loading branch information
bduranleau-nr authored Feb 6, 2023
2 parents f21ec1e + 10bbaa2 commit 1d17141
Show file tree
Hide file tree
Showing 96 changed files with 7,853 additions and 78 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.5.0
10.6.0
4 changes: 2 additions & 2 deletions agent/php_nrini.c
Original file line number Diff line number Diff line change
Expand Up @@ -2922,10 +2922,10 @@ STD_PHP_INI_ENTRY_EX(
0)

/*
* Code Level Metrics, initially off by default
* Code Level Metrics
*/
STD_PHP_INI_ENTRY_EX("newrelic.code_level_metrics.enabled",
"0",
"1",
NR_PHP_REQUEST,
nr_boolean_mh,
code_level_metrics_enabled,
Expand Down
22 changes: 20 additions & 2 deletions agent/scripts/newrelic.ini.template
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,15 @@ newrelic.daemon.logfile = "/var/log/newrelic/newrelic-daemon.log"
; per transaction. A value of 0 will use the agent default. The max
; setting is 10000.
;
; !IMPORTANT: If you have Code Level Metrics enabled & long absolute
; pathnames to your PHP files/functions, you may exceed the max message
; size limit set by the Daemon if your max_samples_stored setting is
; too high. To fix this, you can either:
; a) enable infinite tracing (newrelic.infinite_tracing.trace_observer.host)
; b) set newrelic.code_level_metrics.enabled=false, disabling it
; entirely
; c) lower the value for newrelic.span_events.max_samples_stored
;
;newrelic.span_events.max_samples_stored = 0


Expand Down Expand Up @@ -1221,10 +1230,19 @@ newrelic.daemon.logfile = "/var/log/newrelic/newrelic-daemon.log"
; Setting: newrelic.code_level_metrics.enabled
; Type : boolean
; Scope : per-directory
; Default: false
; Default: true
; Info : Toggles whether the agent provides function name, function
; filepath, function namespace, and function lineno as
; attributes on reported spans
;
;newrelic.code_level_metrics.enabled = false
; !IMPORTANT: If you have Code Level Metrics enabled & long absolute
; pathnames to your PHP files/functions, you may exceed the max message
; size limit set by the Daemon if your max_samples_stored setting is
; too high. To fix this, you can either:
; a) enable infinite tracing (newrelic.infinite_tracing.trace_observer.host)
; b) set newrelic.code_level_metrics.enabled=false, disabling it
; entirely
; c) lower the value for newrelic.span_events.max_samples_stored
;
;newrelic.code_level_metrics.enabled = true

4 changes: 2 additions & 2 deletions axiom/nr_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
/*
* Current version naming scheme is flowers
*
* vanilla 07Dec2020 (9.15)
* watermelon 25Jan2021 (9.16)
* xigua 21Apr2021 (9.17)
* yam 23Aug2021 (9.18)
Expand All @@ -35,8 +34,9 @@
* echinacea 03Oct2022 (10.2)
* freesia 03Nov2022 (10.3)
* goldenrod 12Dec2022 (10.4)
* hydrangea 18Jan2023 (10.5)
*/
#define NR_CODENAME "hydrangea"
#define NR_CODENAME "impatiens"

const char* nr_version(void) {
return NR_STR2(NR_VERSION);
Expand Down
13 changes: 12 additions & 1 deletion tests/integration/api/add_custom_parameter/test_span_event.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
Test that custom transaction attributes are added to span events.
*/

/*SKIPIF
<?php
if (version_compare(PHP_VERSION, "7.0", "<")) {
die("skip: CLM for PHP 5 not supported\n");
}
*/

/*INI
newrelic.distributed_tracing_enabled=1
newrelic.transaction_tracer.threshold = 0
Expand Down Expand Up @@ -100,7 +107,11 @@
"int": 7,
"string": "str"
},
{}
{
"code.lineno": 124,
"code.filepath": "__FILE__",
"code.function": "a"
}
]
]
]
Expand Down
121 changes: 121 additions & 0 deletions tests/integration/api/add_custom_parameter/test_span_event.php5.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?php
/*
* Copyright 2020 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

/*DESCRIPTION
Test that custom transaction attributes are added to span events.
*/

/*INI
newrelic.distributed_tracing_enabled=1
newrelic.transaction_tracer.threshold = 0
newrelic.transaction_tracer.detail = false
newrelic.span_events_enabled=1
newrelic.cross_application_tracer.enabled = false
newrelic.code_level_metrics.enabled=false
*/

/*EXPECT
ok - string attribute added
ok - int attribute added
ok - bool attribute added
ok - double attribute added
*/

/*EXPECT_ANALYTICS_EVENTS
[
"?? agent run id",
"?? sampling information",
[
[
{
"type": "Transaction",
"name": "OtherTransaction/php__FILE__",
"timestamp": "??",
"duration": "??",
"totalTime": "??",
"guid": "??",
"sampled": true,
"priority": "??",
"traceId": "??",
"error": false
},
{
"double": 1.50000,
"bool": false,
"int": 7,
"string": "str"
},
{
}
]
]
]
*/

/*EXPECT_SPAN_EVENTS
[
"?? agent run id",
{
"reservoir_size": 10000,
"events_seen": 2
},
[
[
{
"traceId": "??",
"duration": "??",
"transactionId": "??",
"name": "OtherTransaction\/php__FILE__",
"guid": "??",
"type": "Span",
"category": "generic",
"priority": "??",
"sampled": true,
"nr.entryPoint": true,
"timestamp": "??",
"transaction.name": "OtherTransaction/php__FILE__"
},
{},
{}
],
[
{
"type": "Span",
"traceId": "??",
"transactionId": "??",
"sampled": true,
"priority": "??",
"name": "Custom\/a",
"guid": "??",
"timestamp": "??",
"duration": "??",
"category": "generic",
"parentId": "??"
},
{
"double": 1.50000,
"bool": false,
"int": 7,
"string": "str"
},
{}
]
]
]
*/

require_once(realpath(dirname(__FILE__)) . '/../../../include/tap.php');

newrelic_add_custom_tracer("a");

function a() {
tap_assert(newrelic_add_custom_parameter("string", "str"), "string attribute added");
tap_assert(newrelic_add_custom_parameter("int", 7), "int attribute added");
tap_assert(newrelic_add_custom_parameter("bool", false), "bool attribute added");
tap_assert(newrelic_add_custom_parameter("double", 1.5), "double attribute added");
}

a();
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
from the span MUST be kept.
*/

/*SKIPIF
<?php
if (version_compare(PHP_VERSION, "7.0", "<")) {
die("skip: CLM for PHP 5 not supported\n");
}
*/

/*INI
newrelic.distributed_tracing_enabled=1
newrelic.transaction_tracer.threshold = 0
Expand Down Expand Up @@ -106,7 +113,11 @@
"int": 1,
"string": "span str"
},
{}
{
"code.lineno": 155,
"code.filepath": "__FILE__",
"code.function": "a"
}
]
]
]
Expand Down
Loading

0 comments on commit 1d17141

Please sign in to comment.