elastic / elastic/ecs-logging-java

Adding ECS formatting to Quarkus

オープン
#146 コメント 1 件 リアクション 13 件 担当者 0 名 GitHub で見る
agent-java community
主要言語
Java
スター
148
フォーク
82
平均マージ
2日 17時間
マージ済み PR(30日)
3

説明

Hi there,

I wanted to start a discussion about adding ECS formatting to the [Quarkus](https://quarkus.io/) framework. This issue describes what I was trying to achieve: https://github.com/quarkiverse/quarkus-logging-json/issues/132.

Now I have a working solution and was wondering how I can contribute to his library.

The solution consist of the following code which is based on your classes:
- Serializer: https://gist.github.com/nadworny/5fc96555c5f5d24c919fcacc482e820c
- Formatter: https://gist.github.com/nadworny/a80d405b4b4fc50f6e078ca14f451ab4

My EcsFormatter doesn't extend the Formatter class as it requires a slightly different approach namely it writes directly into the generator.

The final JsonProvider, which uses the [quarkus-logging-json](https://github.com/quarkiverse/quarkus-logging-json) framework, looks like this:
```java
@ApplicationScoped
public class EcsJsonProvider implements JsonProvider {

private final EcsQuarkusFormatter ecsFormatter;

@Inject
public EcsJsonProvider(EcsConfiguration ecsConfiguration) {
ecsFormatter = new EcsQuarkusFormatter(ecsConfiguration.service().name(), ecsConfiguration.service()
.nodeName().orElse(null), Boolean.TRUE.equals(ecsConfiguration.logOrigin().orElse(null)),
Boolean.TRUE.equals(ecsConfiguration.errorStackTraceAsArray().orElse(null)));
}

@Override
public void writeTo(JsonGenerator generator, ExtLogRecord event) throws IOException {
ecsFormatter.format(generator, event);
}
}
```

Any suggestions/contributions how we could re-use my code and make it into this library would be greatly appreciated.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、リンクされている quarkiverse の issue と、ECS serializer および formatter に関する 2 つの gist を確認し、次にこのライブラリに既存の Formatter と JsonProvider の拡張ポイントを調べます。プロジェクトが統合方法に合意し、適切なテストとともに ECS のフォーマットがライブラリでサポートされた時点で、コントリビューションは完了です。ここではリポジトリのファイルやテストは指定されていません。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
observability-sre
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。