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

Add OpenTelemetry Java Agent Extension #165

Merged
merged 7 commits into from
Nov 13, 2023
Merged

Conversation

KarstenSchnitter
Copy link
Contributor

This extension provides auto-configuration for OpenTelemetry for apps bound to SAP Cloud Logging.
The configuration is picked-up from managed or user-provided service bindings.

This extension for the OpenTelemetry Java Agent detects bindings to
SAP logging services with active OpenTelemetry support. If such a binding
is detected the OpenTelemetry Java Agent is configured with the provided
credentials and appropriate resource attributes are configured.

Signed-off-by: Karsten Schnitter <[email protected]>
Signed-off-by: Karsten Schnitter <[email protected]>
Provides documentation for the OpenTelemetry Java Agent Extension
and a sample with the Spring Boot sample app.

Signed-off-by: Karsten Schnitter <[email protected]>
Signed-off-by: Karsten Schnitter <[email protected]>
Adds the missing file content.

Signed-off-by: Karsten Schnitter <[email protected]>
Signed-off-by: Karsten Schnitter <[email protected]>
Copy link
Contributor

@JannikBrand JannikBrand left a comment

Choose a reason for hiding this comment

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

Would be best to get a second pair of eyes from someone who is more familiar with Java.
Mostly minor things in the markdown files.

# OpenTelemetry Java Agent Extension for SAP Cloud Logging

This module provides an extension for the [OpenTelemetry Java Agent](https://opentelemetry.io/docs/instrumentation/java/automatic/).
The extension scans the service bindings of an application for SAP Cloud Logging.
Copy link
Contributor

Choose a reason for hiding this comment

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

Link to SAP Cloud Logging?
(I know the doc as well as sap cloud logging is not GA yet. So is this a precondition for this PR?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is on public link for that yet, except the TechEd News.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A link would not be a prerequisite.

Copy link
Contributor

Choose a reason for hiding this comment

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

synced w/ @KarstenSchnitter: link will be provided soon once available

sample-spring-boot/README.md Outdated Show resolved Hide resolved
@KarstenSchnitter KarstenSchnitter merged commit af9d5c2 into main Nov 13, 2023
2 checks passed
@KarstenSchnitter KarstenSchnitter deleted the otel-agent-extension branch November 13, 2023 20:51
Comment on lines +54 to +58
<dependency>
<groupId>io.pivotal.cfenv</groupId>
<artifactId>java-cfenv</artifactId>
<version>2.5.0</version>
</dependency>

Choose a reason for hiding this comment

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

Instead of using a CF-specific library to retrieve service bindings you might want to take a look at the BTP Service Binding Access lib, that was developed and is used by SAP Cloud SDK, CAP Java and the SAP Security Lib. It allows to retrieve service binding information independent if you are running on CF or Kyma (or any other environment supporting the Open Service Broker API).

If that sounds interesting to you, maybe I can also try a contribution to refactor the existing code based on the library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the pointer. I will look at the library. I went for this specific library, since the extension itself is very specific. It is also very sensitive to the size of the final jar. This is because it is embedded into another extension, that goes into the SAP Java buildpack. I am also unsure, whether there are benefits when running in Kyma.

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.

3 participants