Skip to content

Commit

Permalink
use generic messageinfo type
Browse files Browse the repository at this point in the history
  • Loading branch information
seemk committed Apr 23, 2024
1 parent f4ff11c commit c7fd550
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/node/instrumentation-kafkajs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ export interface KafkajsMessage {
timestamp?: string;
}

export interface MessageInfo {
export interface MessageInfo<T = KafkajsMessage> {
topic: string;
message: KafkajsMessage;
message: T;
}

export interface KafkaProducerCustomAttributeFunction {
(span: Span, info: MessageInfo): void;
export interface KafkaProducerCustomAttributeFunction<T = KafkajsMessage> {
(span: Span, info: MessageInfo<T>): void;
}

export interface KafkaConsumerCustomAttributeFunction {
(span: Span, info: MessageInfo): void;
export interface KafkaConsumerCustomAttributeFunction<T = KafkajsMessage> {
(span: Span, info: MessageInfo<T>): void;
}

export interface KafkaJsInstrumentationConfig extends InstrumentationConfig {
Expand Down

0 comments on commit c7fd550

Please sign in to comment.