open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.06k stars 2.36k forks source link

httpcheck receiver configuration failed in v112.0 #36205

Open sRAVanI417 opened 17 hours ago

sRAVanI417 commented 17 hours ago

Component(s)

No response

What happened?

Description

Steps to Reproduce

Following the document https://opentelemetry.io/blog/2023/synthetic-testing/. Please let me know if the httpcheck reciever is custom reciever requiring any additional plugins.

  1. In otel collector yaml, add the reciever as below: recievers: httpcheck: targets:

  2. run docker-compose

Expected Result

  1. Otel collector should be up and running

Actual Result

Recieving below error

otel-collector-1 | Error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):
otel-collector-1 | otel-collector-1 | error decoding 'receivers': unknown type: "httpcheck" for id: "httpcheck" (valid values: [zipkin nop otlp hostmetrics jaeger kafka opencensus prometheus])
otel-collector-1 | 2024/11/05 12:04:47 collector server run finished with error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s): otel-collector-1 | otel-collector-1 | error decoding 'receivers': unknown type: "httpcheck" for id: "httpcheck" (valid values: [zipkin nop otlp hostmetrics jaeger kafka opencensus prometheus]) otel-collector-1 exited with code 1

Collector version

v112.0

Environment information

No response

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: x.y.z.aaaa
      http:
        endpoint: x.y.z.aaaa
  httpcheck:
    targets:
      - endpoint: https://example.com/api-endpoint
        method: GET 
    collection_interval: 10s
# Processors
processors:
  batch:

# Exporters
exporters:
  debug: 
    verbosity: detailed
  otlphttp/logs:
    endpoint: "http://loki:xxxx/otlp"
    tls:
      insecure: true
  otlphttp/traces:
    endpoint: "http://tempo:xxxx"
    tls:
      insecure: true
  prometheus:
    endpoint: otel-collector:8889
service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug,otlphttp/logs]
    metrics:
      receivers: [otlp, httpcheck]
      exporters: [debug,prometheus]
    traces:
      receivers: [otlp]
      exporters: [debug,otlphttp/traces]

Log output

otel-collector-1  | Error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):                                                       
otel-collector-1  | 
otel-collector-1  | error decoding 'receivers': unknown type: "httpcheck" for id: "httpcheck" (valid values: [zipkin nop otlp hostmetrics jaeger kafka opencensus prometheus])            
otel-collector-1  | 2024/11/05 12:04:47 collector server run finished with error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):
otel-collector-1  | 
otel-collector-1  | error decoding 'receivers': unknown type: "httpcheck" for id: "httpcheck" (valid values: [zipkin nop otlp hostmetrics jaeger kafka opencensus prometheus])
otel-collector-1 exited with code 1

Additional context

No response

codeboten commented 15 hours ago

Which distribution of the collector are you using? The httpcheck receiver is only included in the collector-contrib distro today https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib