elastic-apm-http-client
Advanced tools
Comparing version 11.0.4 to 11.1.0
11
index.js
@@ -132,4 +132,9 @@ 'use strict' | ||
if (this._conf.cloudMetadataFetcher && this._conf.expectExtraMetadata) { | ||
throw new Error('it is an error to create a Client with both cloudMetadataFetcher and expectExtraMetadata') | ||
const numExtraMdOpts = [ | ||
this._conf.cloudMetadataFetcher, | ||
this._conf.expectExtraMetadata, | ||
this._conf.extraMetadata | ||
].reduce((accum, curr) => curr ? accum + 1 : accum, 0) | ||
if (numExtraMdOpts > 1) { | ||
throw new Error('it is an error to configure a Client with more than one of "cloudMetadataFetcher", "expectExtraMetadata", or "extraMetadata"') | ||
} else if (this._conf.cloudMetadataFetcher) { | ||
@@ -159,2 +164,4 @@ // Start stream in corked mode, uncork when cloud metadata is fetched and | ||
this.cork() | ||
} else if (this._conf.extraMetadata) { | ||
this.setExtraMetadata(this._conf.extraMetadata) | ||
} else { | ||
@@ -161,0 +168,0 @@ this._resetEncodedMetadata() |
{ | ||
"name": "elastic-apm-http-client", | ||
"version": "11.0.4", | ||
"version": "11.1.0", | ||
"description": "A low-level HTTP client for communicating with the Elastic APM intake API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,3 +59,4 @@ # elastic-apm-http-client | ||
Data sent to the APM Server as part of the [metadata object](https://www.elastic.co/guide/en/apm/server/current/metadata-api.html): | ||
Data sent to the APM Server as part of the [metadata object](https://www.elastic.co/guide/en/apm/server/current/metadata-api.html). | ||
See also the "Cloud & Extra Metadata" section below. | ||
@@ -118,3 +119,4 @@ - `agentName` - (required) The APM agent name | ||
Cloud & Extra Metadata Configuration: | ||
Cloud & Extra Metadata Configuration. Zero or one of the following three | ||
options may be used. | ||
@@ -126,4 +128,3 @@ - `cloudMetadataFetcher` - An object with a `getCloudMetadata(cb)` method | ||
provided, this client will not begin any intake requests until the callback | ||
is called. The `cloudMetadataFetcher` option must not be used with the | ||
`expectExtraMetadata` option. | ||
is called. | ||
- `expectExtraMetadata` - A boolean option to indicate that the client should | ||
@@ -133,4 +134,5 @@ not allow any intake requests to begin until `cloud.setExtraMetadata(...)` | ||
`cloud.setExtraMetadata()`. If not, then the Client will never perform an | ||
intake request. The `expectExtraMetadata` option must not be used with the | ||
`cloudMetadataFetcher` option. | ||
intake request. | ||
- `extraMetadata` - An object with extra metadata to merge into the metadata | ||
object created from the individual fields above. | ||
@@ -137,0 +139,0 @@ APM Agent Configuration via Kibana: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
94406
1966
460