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

New Blog Post: Collecting OpenTelemetry-compliant Java logs from files #5600

Open
wants to merge 52 commits into
base: main
Choose a base branch
from

Conversation

cyrille-leclerc
Copy link
Member

@cyrille-leclerc cyrille-leclerc commented Nov 13, 2024

This post presents how to use the new experimental-otlp/stdout export format introduced by OpenTelemetry Java Instrumentation (open-telemetry/opentelemetry-java#6675) to export application logs to files with full OpenTelemetry contextualization and ingest them with the OTel Collector File Log receiver and OTLP/JSON connector.

In this post, we explain how to configure the OTel Java instrumentation agent and the OTel Collector, including when deploying on K8s, to implement the end to end file based logs ingestion pipeline.

Blog Post Issue: #5606
SIG: java and specifications
Sponsor:

Preview: https://deploy-preview-5600--opentelemetry.netlify.app/blog/2024/collecting-otel-compliant-java-logs-from-files/

@cyrille-leclerc cyrille-leclerc requested a review from a team as a code owner November 13, 2024 10:02
@github-actions github-actions bot added the blog label Nov 13, 2024
@opentelemetrybot opentelemetrybot requested a review from a team November 13, 2024 10:03
@zeitlinger
Copy link
Member

zeitlinger commented Nov 13, 2024

@cyrille-leclerc https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v2.10.0 was just released - I'll update the executable example in grafana/docker-otel-lgtm#145 now

@svrnm
Copy link
Member

svrnm commented Nov 13, 2024

@cyrille-leclerc can you raise an issue for this PR following our guidelines? Thanks

@cyrille-leclerc
Copy link
Member Author

@cyrille-leclerc can you raise an issue for this PR following our guidelines? Thanks

Thanks @svrnm. Please find the blog post issue:

content-modules/opentelemetry-specification Outdated Show resolved Hide resolved

![OTLP/JSON Architecture](otlpjson-architecture.png)

## Configure Java Application to Output OTLP/JSON Logs
Copy link
Member

Choose a reason for hiding this comment

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

the sample application you are using, is this available somewhere? If so, can you point to it? It's always good if people can reproduce your tutorial 1:1 without the need for them to find an application first

Copy link
Member Author

Choose a reason for hiding this comment

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

@zeitlinger do we have a simplified demo or we use https://github.com/cyrille-leclerc/my-shopping-cart/? Note that I reverted my-shopping-cart to the otlp exporter so I would have to spend a few cycles to setup a demo.

Copy link
Member

Choose a reason for hiding this comment

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

yes, the demo app is at https://github.com/grafana/docker-otel-lgtm/tree/main/examples/java/json-logging-otlp - which is already mentioned twice

Comment on lines 90 to 92
![OpenTelemetry Collector OTLP/JSON pipeline](otel-collector-otlpjson-pipeline.png)

Source: [https://www.otelbin.io/s/69739d790cf279c203fc8efc86ad1a876a2fc01a](https://www.otelbin.io/s/69739d790cf279c203fc8efc86ad1a876a2fc01a)
Copy link
Member

Choose a reason for hiding this comment

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

I like that you provide the link to the otelbin source of that image, but let's figure out a way to visualize this better.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
![OpenTelemetry Collector OTLP/JSON pipeline](otel-collector-otlpjson-pipeline.png)
Source: [https://www.otelbin.io/s/69739d790cf279c203fc8efc86ad1a876a2fc01a](https://www.otelbin.io/s/69739d790cf279c203fc8efc86ad1a876a2fc01a)
{{< figure class="figure" src="otel-collector-otlpjson-pipeline.png" attr="View OTel Collector pipeline with OTelBin" attrlink="https://www.otelbin.io/s/69739d790cf279c203fc8efc86ad1a876a2fc01a" >}}

What I meant is to have something that makes it clearer that the Source: (or View ...) belongs to the image, since the spacing is not right, similar to what bootstrap provides for figures. We have a shortcode for that via docsy, it's not exactly what I want, but we can take a look into that separately, cc @chalin

Copy link
Contributor

Choose a reason for hiding this comment

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

@opentelemetrybot opentelemetrybot requested a review from a team November 15, 2024 11:09

![OTLP/JSON Architecture](otlpjson-architecture.png)

## Configure Java Application to Output OTLP/JSON Logs
Copy link
Member Author

Choose a reason for hiding this comment

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

@zeitlinger do we have a simplified demo or we use https://github.com/cyrille-leclerc/my-shopping-cart/? Note that I reverted my-shopping-cart to the otlp exporter so I would have to spend a few cycles to setup a demo.

@opentelemetrybot opentelemetrybot requested a review from a team November 18, 2024 10:35
Copy link
Contributor

@tiffany76 tiffany76 left a comment

Choose a reason for hiding this comment

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

Just a few copyedit suggestions. Thanks!

@opentelemetrybot opentelemetrybot requested a review from a team November 20, 2024 07:35
@opentelemetrybot opentelemetrybot requested a review from a team November 20, 2024 08:50
traces and metrics.
Any feedback or questions? Reach out on
[GitHub](https://github.com/open-telemetry/opentelemetry-specification/pull/4183).
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this linking to a spec PR?
Is this PR really the best place for folks to comment?
If so, that's ok, but then the link text should explain more clearly what the link target is.

Copy link
Member Author

Choose a reason for hiding this comment

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

We have updated referring to the PR of the OTEP and to the Slack channel

@chalin
Copy link
Contributor

chalin commented Nov 20, 2024

/fix:refcache

@opentelemetrybot
Copy link
Collaborator

You triggered fix:refcache action run at https://github.com/open-telemetry/opentelemetry.io/actions/runs/11931927870

@opentelemetrybot
Copy link
Collaborator

fix:refcache was successful.

IMPORTANT: (RE-)RUN /fix:all to ensure that there are no remaining check issues.

@opentelemetrybot opentelemetrybot requested a review from a team November 20, 2024 12:55
Copy link
Contributor

@tiffany76 tiffany76 left a comment

Choose a reason for hiding this comment

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

LGTM, subject to @chalin's comments.

cyrille-leclerc and others added 7 commits November 23, 2024 07:13
Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com>
Co-authored-by: Tiffany Hrabusa <30397949+tiffany76@users.noreply.github.com>
Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com>
…telemetry/index.md

Co-authored-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
zeitlinger and others added 8 commits November 25, 2024 14:34
…files/index.md

Co-authored-by: Cyrille Le Clerc <cyrille.leclerc@grafana.com>
…files/index.md

Co-authored-by: Cyrille Le Clerc <cyrille.leclerc@grafana.com>
…files/index.md

Co-authored-by: Cyrille Le Clerc <cyrille.leclerc@grafana.com>
…files/index.md

Co-authored-by: Cyrille Le Clerc <cyrille.leclerc@grafana.com>
@cyrille-leclerc
Copy link
Member Author

@svrnm FYI @zeitlinger and I think we are good to go. We reviewed and integrated all the feedback.
Can you please tell us what are the next steps?

Thanks again for your thorough review

@cyrille-leclerc cyrille-leclerc changed the title New Blog Post: Collecting file-based Java logs with OpenTelemetry New Blog Post: Collecting OpenTelemetry-compliant Java logs from files Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

6 participants