File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
packages/instrumentation-nats/src Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,6 @@ interface SentMessagesAttributes extends Attributes {
6262 [ ATTR_MESSAGING_OPERATION_NAME ] : string ;
6363}
6464
65- /**
66- * Attributes for received messages metric.
67- */
6865interface ReceivedMessagesAttributes extends Attributes {
6966 [ ATTR_MESSAGING_SYSTEM ] : string ;
7067 [ ATTR_MESSAGING_DESTINATION_NAME ] : string ;
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ export const natsHeadersGetter: TextMapGetter<MsgHdrs | undefined> = {
2525 return undefined ;
2626 }
2727
28- // MsgHdrs.get() returns the header value as a string directly
2928 return carrier . get ( key ) ;
3029 } ,
3130
Original file line number Diff line number Diff line change @@ -18,12 +18,12 @@ import { Span } from '@opentelemetry/api';
1818import type { Msg } from 'nats' ;
1919
2020/**
21- * Hook function called after a message is published.
21+ * Hook function called before a message is published.
2222 */
2323export type PublishHook = ( span : Span , info : PublishInfo ) => void ;
2424
2525/**
26- * Hook function called after a message is received/processed.
26+ * Hook function called before a message is received/processed.
2727 */
2828export type ConsumeHook = ( span : Span , info : ConsumeInfo ) => void ;
2929
@@ -37,8 +37,13 @@ export interface ConsumeInfo {
3737}
3838
3939export interface NatsInstrumentationConfig extends InstrumentationConfig {
40+ /**
41+ * Hook function called before a message is published.
42+ */
4043 publishHook ?: PublishHook ;
41-
44+ /**
45+ * Hook function called before a message is received/processed.
46+ */
4247 consumeHook ?: ConsumeHook ;
4348 /**
4449 * Whether to include message body size in span attributes.
You can’t perform that action at this time.
0 commit comments