Skip to content

Commit f69d05e

Browse files
chore(comments): correct hook comments and remove unnecessary ones
1 parent 4965c82 commit f69d05e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

packages/instrumentation-nats/src/instrumentation.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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-
*/
6865
interface ReceivedMessagesAttributes extends Attributes {
6966
[ATTR_MESSAGING_SYSTEM]: string;
7067
[ATTR_MESSAGING_DESTINATION_NAME]: string;

packages/instrumentation-nats/src/propagator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

packages/instrumentation-nats/src/types.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ import { Span } from '@opentelemetry/api';
1818
import 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
*/
2323
export 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
*/
2828
export type ConsumeHook = (span: Span, info: ConsumeInfo) => void;
2929

@@ -37,8 +37,13 @@ export interface ConsumeInfo {
3737
}
3838

3939
export 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.

0 commit comments

Comments
 (0)