File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
# @elastic/ecs-pino-format Changelog
2
2
3
+ ## v1.2.0
4
+
5
+ - Add an * internal testing-only* option (` opts._elasticApm ` ) to pass in the
6
+ current loaded "elastic-apm-node" module for use in APM tracing integration.
7
+ This option will be used by tests in the APM agent where the current agent
8
+ import name is a local path rather than "elastic-apm-node" that this code
9
+ normally uses.
10
+
3
11
## v1.1.2
4
12
5
13
- Fix a circular-require for code that uses both this package and
Original file line number Diff line number Diff line change @@ -65,7 +65,13 @@ function createEcsPinoOptions (opts) {
65
65
let apm = null
66
66
let apmServiceName = null
67
67
if ( apmIntegration ) {
68
- if ( ! triedElasticApmImport ) {
68
+ // istanbul ignore if
69
+ if ( opts && opts . _elasticApm ) {
70
+ // `opts._elasticApm` is an internal/testing-only option to be used
71
+ // for testing in the APM agent where the import is a local path
72
+ // rather than "elastic-apm-node".
73
+ elasticApm = opts . _elasticApm
74
+ } else if ( ! triedElasticApmImport ) {
69
75
triedElasticApmImport = true
70
76
// We lazily require this module here instead of at the top-level to
71
77
// avoid a possible circular-require if the user code does
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @elastic/ecs-pino-format" ,
3
- "version" : " 1.1.2 " ,
3
+ "version" : " 1.2.0 " ,
4
4
"description" : " A formatter for the pino logger compatible with Elastic Common Schema." ,
5
5
"main" : " index.js" ,
6
6
"files" : [
You can’t perform that action at this time.
0 commit comments