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

Introduce Cloud Logging Exporter #169

Merged
merged 6 commits into from
Jan 12, 2024

Conversation

KarstenSchnitter
Copy link
Contributor

Add custom exporter cloud-logging that is fully auto-configured with all available bindings to SAP Cloud Logging.
Avoid generation of any local files containing secrets.

This allows to utilize the default otlp exporter for different data sinks.

Register signal exporters for logs, metrics and traces,
that forward signals to SAP Cloud Logging, if an appropriate
service binding is found or do a non operation otherwise.
This allows developers to explicitly configure the export, e.g.
by `otel.logs.exporter=cloud-logging`. Additional exporters
can be added with comma-separated labels.

Signed-off-by: Karsten Schnitter <[email protected]>
Adds unit tests for all main parts of the new instrumentation.
Checking cases of missing bindings and other configuration issues.

Signed-off-by: Karsten Schnitter <[email protected]>
Fixes source id and adds process attributes.

Signed-off-by: Karsten Schnitter <[email protected]>
Use the same service binding scanning in old and new
exporter configuration.

Signed-off-by: Karsten Schnitter <[email protected]>
Add references to the `cloud-logging`exporter to the documentation.
Describe the new config properties to control the extension.

Signed-off-by: Karsten Schnitter <[email protected]>
return invocation.getArguments()[1];
}
});

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

return invocation.getArguments()[1];
}
});

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

return invocation.getArguments()[1];
}
});

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

Copy link
Member

@juergen-walter juergen-walter left a comment

Choose a reason for hiding this comment

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

LGTM

@juergen-walter
Copy link
Member

Delete unnecessary files from key and certificate creation.

Signed-off-by: Karsten Schnitter <[email protected]>
@KarstenSchnitter KarstenSchnitter merged commit 3784873 into SAP:main Jan 12, 2024
2 checks passed
@KarstenSchnitter KarstenSchnitter deleted the otel-cloud-logging branch January 12, 2024 15:33
@@ -37,27 +38,76 @@ java -javaagent:BOOT-INF/lib/opentelemetry-javaagent-<version>.jar \

See the [example manifest](../sample-spring-boot/manifest-otel-javaagent.yml), how this translates into a deployment description.

For the instrumentation to send observability data to SAP Cloud Logging, the application needs to be bound to a corresponding service instance.
The service instance can be either managed or [user-provided](#using-user-provided-service-instances).
Once the agent is attached to the JVM with the ectension in place, there are two ways, which can be used to send data to [SAP Cloud Logging](https://discovery-center.cloud.sap/serviceCatalog/cloud-logging):
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
Once the agent is attached to the JVM with the ectension in place, there are two ways, which can be used to send data to [SAP Cloud Logging](https://discovery-center.cloud.sap/serviceCatalog/cloud-logging):
Once the agent is attached to the JVM with the extension in place, there are two ways, which can be used to send data to [SAP Cloud Logging](https://discovery-center.cloud.sap/serviceCatalog/cloud-logging):


Note, that the OpenTelemetry Java Agent currently sends traces and metrics by default using the `otlp` exporter.
That means, without any configuration the agent with the extension will forward metrics and traces to [SAP Cloud Logging](https://discovery-center.cloud.sap/serviceCatalog/cloud-logging).
See TODO for the difference between `cloud-logging` and `otlp` exporters.
Copy link
Member

Choose a reason for hiding this comment

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

leftover TODO

return defaultAggregationSelector.getDefaultAggregation(instrumentType);
}

}
Copy link
Member

Choose a reason for hiding this comment

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

missing new line, also check files below

KarstenSchnitter added a commit that referenced this pull request Jan 15, 2024
Take over suggestions from #169.

Signed-off-by: Karsten Schnitter <[email protected]>
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