NewRelic functions addCustomAttribute and addCustomAttributes takes strings and numbers (#29767)

* AddCustomAttribute takes a string or a number

* Added Brooks Patton to contributors for New Relic

* Bumped minor version
This commit is contained in:
Brooks Patton
2018-10-16 09:23:01 -07:00
committed by Sheetal Nandi
parent 07562f364d
commit 05acb13921
2 changed files with 6 additions and 3 deletions
+4 -3
View File
@@ -1,6 +1,7 @@
// Type definitions for newrelic 3.3
// Type definitions for newrelic 3.4
// Project: http://github.com/newrelic/node-newrelic
// Definitions by: Matt R. Wilson <https://github.com/mastermatt>
// Brooks Patton <https://github.com/brookspatton>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// https://docs.newrelic.com/docs/agents/nodejs-agent/api-guides/nodejs-agent-api
@@ -64,14 +65,14 @@ export function setControllerName(name: string, action: string): void;
*
* Most recently set value wins.
*/
export function addCustomAttribute(key: string, value: string): void;
export function addCustomAttribute(key: string, value: string|number): void;
/**
* Adds all custom attributes in an object to the current transaction.
*
* See documentation for `addCustomAttribute` for more information on setting custom attributes.
*/
export function addCustomAttributes(atts: { [key: string]: string }): void;
export function addCustomAttributes(atts: { [key: string]: string|number }): void;
/**
* Tell the tracer whether to ignore the current transaction.
+2
View File
@@ -14,7 +14,9 @@ newrelic.setDispatcher("foo", "42"); // $ExpectType void
newrelic.setControllerName("foo", "GET"); // $ExpectType void
newrelic.addCustomAttribute("foo", "bar"); // $ExpectType void
newrelic.addCustomAttribute("foo", 42); // $ExpectType void
newrelic.addCustomAttributes({ foo: "bar", baz: "bang" }); // $ExpectType void
newrelic.addCustomAttributes({ foo: "bar", baz: 42 }); // $ExpectType void
newrelic.setIgnoreTransaction(true); // $ExpectType void