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

feat: replace static event name with dynamic based on event id #1029

Merged
merged 29 commits into from
Jun 5, 2024

Conversation

vordimous
Copy link
Contributor

@vordimous vordimous commented May 15, 2024

Description

This will use the defined internal eventId to format an observability-friendly in an all-caps snake case.

Fixes #1013

docs PR:

@vordimous vordimous linked an issue May 15, 2024 that may be closed by this pull request
@vordimous vordimous force-pushed the feature/1013-use-full-event-id-and-the-event-name branch from 81138a5 to fd76938 Compare May 15, 2024 18:38
@vordimous vordimous requested a review from jfallows May 15, 2024 18:47
@attilakreiner
Copy link
Contributor

LGTM apart from the test failures. It looks like there is test code (EchoWorker and TlsWorker) that also implement the interface EngineContext, hence the compile error.

@vordimous vordimous force-pushed the feature/1013-use-full-event-id-and-the-event-name branch from 218b074 to 935a84e Compare May 20, 2024 14:41
@vordimous vordimous force-pushed the feature/1013-use-full-event-id-and-the-event-name branch 2 times, most recently from 720d608 to 016ca37 Compare May 30, 2024 14:29
@vordimous vordimous force-pushed the feature/1013-use-full-event-id-and-the-event-name branch from 405c718 to 1ba8a8e Compare June 3, 2024 12:34
@vordimous vordimous force-pushed the feature/1013-use-full-event-id-and-the-event-name branch from 7a3884b to 4086ca4 Compare June 3, 2024 16:55
@vordimous
Copy link
Contributor Author

vordimous commented Jun 3, 2024

followup changes needed that will require more extensive changes:

  • MqttKafkaResetMqttConnectionExFW should include more properties about why a connection was reset, topic names, etc
  • Remove internal only values from the event messages, ex: identity in the MqttEventContext.onClientConnected event
  • more precisely handle validation exceptions by not passing all exception messages ex: catch (IOException | AvroRuntimeException ex)
  • include the exception message for the TLS binding error events.
  • KafkaEventFormatter needs a map of all ApiKey and ApiVersion codes to render the text version that is relevant to the user. ApiKey enum based on https://kafka.apache.org/protocol.html#protocol_api_keys

@vordimous vordimous marked this pull request as ready for review June 3, 2024 17:33
@vordimous vordimous requested a review from jfallows June 3, 2024 17:33
@@ -23,7 +23,8 @@ telemetry:
events:
- qname: test.net0
id: guard.jwt.authorization.failed
message: AUTHORIZATION_FAILED user
name: GUARD_JWT_AUTHORIZATION_FAILED
message: No active session found for token identity (user).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message seems to imply we are looking for matching state in zilla and couldn't find it.

However, I think this event is logged when an attempt to authorize the user (by validating the token) fails, with no implication of state expected to be found at zilla.

Let's reword to capture the underlying behavior without implying expectation to find server-side state, agree?

Copy link
Contributor Author

@vordimous vordimous Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, please review the new wording with the added reason field.

@@ -23,7 +23,8 @@ telemetry:
events:
- qname: test.net0
id: model.avro.validation.failed
message: VALIDATION_FAILED java.io.EOFException
name: MODEL_AVRO_VALIDATION_FAILED
message: A message payload failed validation. java.io.EOFException.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove exception class name from message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"java.io.EOFException" is one of the exception messages returned from the AvroRuntimeException class. The error string passed in the event is set from various exception messages.

I think this is just a bad example of what kind of errors might come through and I don't know how the tests makes this specific exception happen or how to change it to something else.

origional comment here: #1029 (comment)

Copy link
Contributor Author

@vordimous vordimous Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also added fixing this as a note in some the follow on modifications that are needed: #1029 (comment)

@vordimous vordimous force-pushed the feature/1013-use-full-event-id-and-the-event-name branch from 1216049 to 6377a8a Compare June 3, 2024 19:15
@vordimous vordimous requested a review from jfallows June 3, 2024 20:24
jfallows
jfallows previously approved these changes Jun 4, 2024
@jfallows jfallows merged commit 354a4e1 into develop Jun 5, 2024
8 checks passed
@vordimous vordimous deleted the feature/1013-use-full-event-id-and-the-event-name branch June 11, 2024 16:50
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

Successfully merging this pull request may close these issues.

Use full Event ID and the event name
3 participants