×

The OpenTelemetry Collector offers multiple ways to measure its health as well as investigate data ingestion issues.

Getting the OpenTelemetry Collector logs

You can get the logs for the OpenTelemetry Collector as follows.

Procedure
  1. Set the relevant log level in the OpenTelemetry Collector custom resource (CR):

      config: |
        service:
          telemetry:
            logs:
              level: debug (1)
    1 Collector’s log level. Select one of the following values: info, warn, error, or debug. Defaults to info.
  2. Use the oc logs command or the OpenShift console to retrieve the logs.

Exposing the metrics

The OpenTelemetry Collector exposes the metrics about the data volumes it has processed. The following metrics are for spans, although similar metrics are exposed for metrics and logs signals:

otelcol_receiver_accepted_spans

The number of spans successfully pushed into the pipeline.

otelcol_receiver_refused_spans

The number of spans that could not be pushed into the pipeline.

otelcol_exporter_sent_spans

The number of spans successfully sent to destination.

otelcol_exporter_enqueue_failed_spans

The number of spans failed to be added to the sending queue.

The operator creates a <cr-name>-collector-monitoring telemetry service that you can use to scrape the metrics endpoint.

Procedure
  1. Enable the telemetry service by adding the following lines in the OpenTelemetry Collector custom resource:

      config: |
        service:
          telemetry:
            metrics:
              address: ":8888" (1)
    1 The address on which internal collector metrics are exposed. Defaults to :8888.
  2. Retrieve the metrics by running the following command, which uses the port forwarding collector pod:

    $ oc port-forward <collector-pod>
  3. Access the metrics endpoint at http://localhost:8888/metrics.

Logging exporter

You can configure the logging exporter to export the collected data to the standard output.

Procedure
  1. Configure the OpenTelemetry Collector custom resource as follows:

      config: |
        exporters:
          logging:
            verbosity: detailed
        service:
          pipelines:
            traces:
              exporters: [logging]
            metrics:
              exporters: [logging]
            logs:
              exporters: [logging]
  2. Use the oc logs command or the OpenShift console to export the logs to the standard output.