Public documentation

Documentation indexRead as Markdown

Other services

Use a service's supported client instrumentation, a supported Collector receiver, an existing Prometheus endpoint, or an approved log file. Choose each signal separately: scraping server metrics does not add spans to application requests.

Start with application calls

Follow the language guide for the calling application. Enable instrumentation for its exact library/version, or add a manual span around the operation using the SDK. Keep its service identity and propagate context where the protocol supports an agreed carrier.

Verify one real operation and inspect its parent request before enabling broad statement, payload, or argument capture. A server that accepts OTLP may be a telemetry destination rather than a source; check the integration's direction.

Collect an existing endpoint or log file

The example below assumes a service already exposes Prometheus text metrics on a private endpoint and writes an approved line-oriented log file. It does not enable either feature in the service. Replace both paths with documented service settings. You can use just the metrics or just the logs receiver and pipeline.

Give the Collector network access only to the required endpoint and read access only to the selected log file/directory. Mount logs read-only in a container. Use a dedicated read-only monitoring credential if the endpoint requires one. For traffic crossing an untrusted network, configure HTTPS and certificate validation plus the endpoint's supported authentication before scraping.

Merge this partial fragment into common setup, preserving the existing OTLP pipelines. It requires Contrib 0.160.0's prometheus, filelog, and resource components. The private HTTP example has no authentication; it is not an internet-facing endpoint configuration.

receivers:
  prometheus/custom:
    config:
      scrape_configs:
        - job_name: example-service
          scrape_interval: 30s
          metrics_path: /metrics
          static_configs:
            - targets: [example.internal:9464]
  filelog/custom:
    include: [/var/log/example/service.log]
    start_at: end
    include_file_path: true

processors:
  resource/custom:
    attributes:
      - key: service.name
        value: example-service
        action: upsert
      - key: deployment.environment.name
        value: production
        action: upsert

service:
  pipelines:
    metrics/custom:
      receivers: [prometheus/custom]
      processors: [memory_limiter, resource/custom, batch]
      exporters: [otlp_http/corridora]
    logs/custom:
      receivers: [filelog/custom]
      processors: [memory_limiter, resource/custom, batch]
      exporters: [otlp_http/corridora]

Apply these resource attributes only to these service-specific pipelines. If one Collector observes several services, give each source the right resource identity instead of labeling all sources example-service.

start_at: end reads new log content, not the existing backlog. This minimal example has no persistent offset storage. Plan file rotation, checkpoint storage, and restart behavior before production rollout. Add parsers only after checking the real format; a stack trace or multiline record needs explicit handling. Do not collect both SDK-exported and file-exported copies of the same logs without a deliberate deduplication strategy.

Verify each signal

From the Collector's network, check the actual endpoint:

curl --fail http://example.internal:9464/metrics

Choose a metric name present in the response. Validate the merged Collector configuration, then allow at least two scrape intervals. In Corridora, select example-service and find that metric. An up metric alone does not prove that all intended application metrics were collected.

Have the application generate a fresh, harmless log message such as otel-smoke-service-ready after the file receiver starts. Find that exact body and the service resource in Logs. This fragment preserves each line as a body; it does not extract embedded trace IDs, timestamps, or severity into structured OTel fields without suitable parser configuration.

Finally, exercise the separately instrumented client and inspect its trace. If metrics arrive but spans or logs do not, troubleshoot their own pipeline instead of changing the scraper. Continue with verification.

Source basis: Prometheus and File Log receiver documentation and Collector Contrib distribution manifest 0.160.0; OpenTelemetry SDK instrumentation patterns. Reviewed 2026-09-28.