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

Extension logging-gelf: Adding missing GELF MDC Config #37943

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

donkon
Copy link

@donkon donkon commented Dec 27, 2023

Adding additional MDC Config :

  • mdcFields
  • dynamicMdcFields
  • dynamicMdcFieldTypes

Example application.properties:
quarkus.log.handler.gelf.dynamic-mdc-field-types=jobId=String

Is there a reason why this config is not included in the quarkus logging-gelf extension?

Copy link

quarkus-bot bot commented Dec 27, 2023

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@donkon donkon changed the title logging-gelf: Adding missing GELF MDC Config Extension logging-gelf: Adding missing GELF MDC Config Dec 27, 2023
@geoand geoand requested a review from loicmathieu January 3, 2024 13:11
@geoand
Copy link
Contributor

geoand commented Jan 3, 2024

Thanks for this!

Can you please squash the commit?

@loicmathieu
Copy link
Contributor

@donkon

Is there a reason why this config is not included in the quarkus logging-gelf extension?

For simplicity, we never include all possible configuration knots when integrating a library.

Also, note that the underlying library is no longer maintained, I have a plan to offer a replacement for centralized logging, certainly via opentelemetry logging as I already have a prototype.

@geoand
Copy link
Contributor

geoand commented Jan 3, 2024

I have a plan to offer a replacement for centralized logging, certainly via opentelemetry logging as I already have a prototype.

Nice! You should probably talk to @brunobat about this

Copy link
Contributor

@loicmathieu loicmathieu left a comment

Choose a reason for hiding this comment

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

Did you test that the MDC implementation used by the library is compatible with the Quarkus one?

You should idealy enhance the existing test with a message using the MDC and verify that it's correctly rendered.

You should also check in reactive as it should have special MDC handling, I'm not sure it's OOTB.

@loicmathieu
Copy link
Contributor

@geoand yes, I planned to open a discussion on Zulip ... then forgot ... Will start a discussion on Zulip with my prototype as we need a replacement for this library.

Copy link
Contributor

@brunobat brunobat left a comment

Choose a reason for hiding this comment

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

@donkon can you please add a test?

@donkon
Copy link
Author

donkon commented Jan 4, 2024

@brunobat I see no (JUnit)Tests at all (extensions/logging-gelf/). Can you point me to the right direction what Tests you expect?

Please note that I'm just delegating additional config to the underlying library (like the actual code does) without any special logic

@loicmathieu
Copy link
Contributor

@donkon tests are inside the integration test directory, see https://github.com/quarkusio/quarkus/tree/main/integration-tests/logging-gelf.

You should add a log with a dynamic MDC here: https://github.com/quarkusio/quarkus/blob/main/integration-tests/logging-gelf/src/main/java/io/quarkus/logging/gelf/it/GelfLogHandlerResource.java

Then assert in the test that the log has been set and the MDC parameters resolved here: https://github.com/quarkusio/quarkus/blob/main/integration-tests/logging-gelf/src/test/java/io/quarkus/logging/gelf/it/GelfLogHandlerTest.java

@donkon
Copy link
Author

donkon commented Jan 12, 2024

@brunobat done! I extended the existing testcase. Can you please check!

Copy link
Contributor

@loicmathieu loicmathieu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@loicmathieu
Copy link
Contributor

Can you rebase on main and squash your commit please?

@donkon donkon force-pushed the gelf-missing-mdc-config branch from 16a64dc to badc901 Compare January 12, 2024 16:45
@donkon
Copy link
Author

donkon commented Jan 12, 2024

@loicmathieu done

@gastaldi gastaldi requested a review from brunobat January 12, 2024 20:02
Copy link

quarkus-bot bot commented Jan 12, 2024

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@loicmathieu loicmathieu merged commit 15bf7c1 into quarkusio:main Jan 15, 2024
19 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants