-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add support for the custom attributes #225
Conversation
@@ -50,6 +51,17 @@ export class NewRelicTransactionManager implements TransactionObservabilityManag | |||
newrelic.addCustomAttribute(attrName, attrValue) | |||
} | |||
|
|||
public addCustomAttributes( | |||
_uniqueTransactionKey: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signature of the method still includes this parameter because other implementations (Prometheus, OpenTelemetry etc) will need it
const transactionName = this.transactionNameByKey.get(uniqueTransactionKey) | ||
if (!transactionName) return | ||
|
||
// @ts-expect-error We only enforce types lightly here. If this ever causes us problem, we can start doing runtime validation here, but it seems to be an overkill for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we also should extend the interface of TransactionObservabilityManager to have a generic for customAttribute keys, but that could be a future improvement
[ | ||
'# HELP myMetric this is my first metric', | ||
'# TYPE myMetric counter', | ||
'myMetric{status="started",transactionName="myTransaction"} 1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would need to change the signature of the base interface start
method if we want to make it possible to also include custom attributes there. maybe we should do that after we have the first use-case for it
Changes
This implements a new method on the transactionObservabilityManager
Checklist
major
,minor
,patch
orskip-release