Download page Configure the OpenTelemetry Java Agent.
Configure the OpenTelemetry Java Agent
If you're already using the OpenTelemetry™ Java Agent to instrument a Java application, you can configure the agent's log exporter to harvest logs from the path you specify. This option is best for Java applications that are already using an OpenTelemetry SDK and generating logs in log4j, logback, or JUL/SLF4J format. This option does not work for Python or Node.js applications because they can't use the OpenTelemetry Java Agent's auto-instrumentation and export; they require their logs to be written to a physical file, from which a Filelog Receiver in an OpenTelemetry collector can harvest and export them.
Configure your Java Agent's log appender.
Configure your Java Agent's log exporter to harvest logs from the path you specify.
Configure your Java Agent's log exporter to export logs to an OpenTelemetry Collector (either Cisco AppDynamics Distribution of OpenTelemetry Collector or an open-source distribution) in native OTLP format by settings its OTEL_LOGS_EXPORTER environment variable to otlp.
In your OpenTelemetry collector's configuration file, in the processor, receivers, and pipelines sections, add mandatory resource attributes to the log packets. Without this step Cisco Cloud Observability will drop the log packets during ingestion:
In the resource processor, add service.namespace, service.name, and service.instance.id. To use different values for each service, create different resource/<service-name> sections. For example:
In pipelines, create as many logs/<service-name> sections as you have resource/<service-name> sections. In each logs/<service-name> section, point to the receivers and processors section that corresponds to that <service-name>. For example: