Skip to content
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

[Spike] Trigger for messaging systems #2983

Open
danielbdias opened this issue Jul 25, 2023 · 7 comments
Open

[Spike] Trigger for messaging systems #2983

danielbdias opened this issue Jul 25, 2023 · 7 comments
Assignees

Comments

@danielbdias
Copy link
Contributor

danielbdias commented Jul 25, 2023

We need to research how we can add a trigger for messaging systems (message queues / streams) on Tracetest (Kafka, RabbitMQ, etc) and plan how to include this feature on Tracetest

@danielbdias danielbdias self-assigned this Jul 25, 2023
@danielbdias
Copy link
Contributor Author

Some common open-source message systems:

Some common proprietary message systems:

  • Amazon Kinesis
  • Amazon SQS
  • Google Cloud Pub/Sub

Protocols:

Conventions for Message systems: https://opentelemetry.io/docs/specs/otel/trace/semantic_conventions/messaging/

@danielbdias
Copy link
Contributor Author

Team, giving a heads up about this issue:

I believe that we can focus on implementing the trigger using the AMQP protocol first and later on MQTT since most of the open-source message brokers support them. There are discussions on Trace-Context standardization on both protocols (here and here).
I'm building a PoC of that using Kafka on poc/quick-start-go-and-kafka branch to validate this hypothesis and see if we can go through this way.

In case of failure, I think that Plan B could implement direct messaging to the following platforms (in order of priority):

@kdhamric @olha23, as soon as I get an answer, I will get the required fields that we need to configure the trigger to work on the design of the CLI and FE.

@danielbdias
Copy link
Contributor Author

danielbdias commented Jul 30, 2023

Team, for the first version, we'll focus on two messaging systems:

  • Kafka (that has its protocol) and
  • AMQP-based systems, like Rabbit and ActiveMQ).

Kafka Specs: #2983 (comment)
Kafka Proof-of-Concept: #3004

@danielbdias
Copy link
Contributor Author

danielbdias commented Jul 30, 2023

Kafka

To use Kafka, the trigger will need the following data:

Kafka connection:

Field Description
Broker urls Array containing the host addresses that we can send a message
Topic Name that categorizes a message. Usually, messages are consumed by topics.
Authentication Can be "None" or "Plain"

A "Plain" authentication has a plain user and password.

Message fields (based on Kafka Record format):

Field Description
Headers Set of key/value pairs telling something about this message. OTel uses these headers to propagate a context.
Key Value that identify a message
Value Content of a message

Some examples of UI to publish messages to Kafka can be seen here:

A Test trigger YAML for Kafka could be something like this:

type: Test
spec:
  id: jFpHiL34R
  name: Test Kafka Message Publishing
  trigger:
    type: kafka
    kafka:
      brokerUrls: 
      - kafka-1:9092
      - kafka-2:9092
      topic: ExampleMessage
      headers:
      - key: my-header
        value: my-value
      messageKey: "message-key"
      messageValue: "{\n  \"hello\": \"kafka!\"\n}"
  specs:
  - selector: span[tracetest.span.type="messaging" name="messaging receive" messaging.system="kafka" messaging.operation="receive"]
    name: It processed a message from Kafka
    assertions:
    - attr:tracetest.selected_spans.count = 1

@olha23
Copy link

olha23 commented Jul 31, 2023

@danielbdias can you please check the mockups and left comment if something wrong? https://www.figma.com/file/nXy4eBvpiQ3P4Jer0ogJOw/v0.11-release?type=design&node-id=859%3A3988&mode=design&t=90tw4FnqB8asvk7n-1

@danielbdias
Copy link
Contributor Author

Folks, about Kafka authentication: looking deeper into the documentation, I've found the documentation for SASL on Kafka:

On this first version, I plan to support only "Plain / SCRAM" authentication that uses just a User/Password. In the future, we can add more options to it.

@kdhamric
Copy link
Collaborator

kdhamric commented Aug 2, 2023

Sounds good Daniel. As we get users with other auth needs we can add them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants