openobserve icon indicating copy to clipboard operation
openobserve copied to clipboard

Please show how to use vector.dev host_metrics with OpenObserve

Open neilmcguigan opened this issue 1 year ago • 13 comments

Describe the problem that you experienced

Tried sending host metrics from vector to OpenObserve, but got errors

Enter the URL of the topic with the problem

No response

Describe what you were looking for in the documentation

how to configure OpenObserver or vector to send/receive host metrics

Describe the actions that led you to experience the problem

No response

Describe what you want to experience that would fix the problem

No response

Add a screenshot if that helps illustrate the problem

No response

If this problem caused an exception or error, please paste it here

No response

If the problem is browser-specific, please specify the device, OS, browser, and version

No response

Provide any additional information here in as much as detail as you can

No response

neilmcguigan avatar Jul 22 '24 21:07 neilmcguigan

@neilmcguigan Post your Vector config, this should work

gaby avatar Jul 23 '24 11:07 gaby

@gaby


sources:

  host_metrics:
    type: host_metrics
    scrape_interval_secs: 60
    collectors:
      - cpu
      - filesystem
      - load
      - host
      - memory
      - network


sinks:

  openobserve_metrics:
    type: prometheus_remote_write
    inputs: [host_metrics]
    endpoint: http://localhost:5080/api/default/prometheus/api/v1/write
    auth:
      strategy: basic
      user: [email protected]
      password: CHANGE_ME
    compression: gzip
    healthcheck:
      enabled: false

neilmcguigan avatar Jul 24 '24 01:07 neilmcguigan

@neilmcguigan What error are you getting and where? On vector or openobserve?

gaby avatar Jul 24 '24 02:07 gaby

on vector, i get these errors:

Jul 24 02:02:19 ip-10-0-5-166 vector[3034]: 2024-07-24T02:02:19.659676Z ERROR sink{component_kind="sink" component_id=openobserve_metrics component_type=prometheus_remote_write}:request{request_id=1}: vector::sinks::util::retries: Not retriable; dropping the request. reason="Http status: 400 Bad Request" internal_log_rate_limit=true

Jul 24 02:02:19 ip-10-0-5-166 vector[3034]: 2024-07-24T02:02:19.659729Z ERROR sink{component_kind="sink" component_id=openobserve_metrics component_type=prometheus_remote_write}:request{request_id=1}: vector_common::internal_event::service: Service call failed. No retries or retries exhausted. error=None request_id=1 error_type="request_failed" stage="sending" internal_log_rate_limit=true

Jul 24 02:02:19 ip-10-0-5-166 vector[3034]: 2024-07-24T02:02:19.659757Z ERROR sink{component_kind="sink" component_id=openobserve_metrics component_type=prometheus_remote_write}:request{request_id=1}: vector_common::internal_event::component_events_dropped: Events dropped intentional=false count=152 reason="Service call failed. No retries or retries exhausted." internal_log_rate_limit=true

neilmcguigan avatar Jul 24 '24 02:07 neilmcguigan

What does it say in OpenObserve? Are you using the username/token that OpenObserve gives you in the Ingest -> Metrics page?

gaby avatar Jul 24 '24 02:07 gaby

@gaby OpenObserve provides no instructions on using Vector.Dev with Metrics, hence my request...

Please note that logging works fine

neilmcguigan avatar Jul 24 '24 02:07 neilmcguigan

@gaby actually, if i send vector host metrics to the openobserve log endpoint, i can see them (as logs)

i guess i need to know the metric endpoint that works w vector

neilmcguigan avatar Jul 24 '24 02:07 neilmcguigan

@neilmcguigan Copy the vector config that it gives you for logs and change the URL to the one for prometheus remote write.

gaby avatar Jul 24 '24 02:07 gaby

why would that work? (it doesn't)

either way, I'd really like to use Vector (and OpenObserve should encourage its use too, as it's Rust and VRL)

however, I don't see a way to do so for metrics at this time, so I guess I'll use OTEL instead

neilmcguigan avatar Jul 24 '24 02:07 neilmcguigan

I know what your problem is... Remove the compression: gzip

@gaby


sources:

  host_metrics:
    type: host_metrics
    scrape_interval_secs: 60
    collectors:
      - cpu
      - filesystem
      - load
      - host
      - memory
      - network


sinks:

  openobserve_metrics:
    type: prometheus_remote_write
    inputs: [host_metrics]
    endpoint: http://localhost:5080/api/default/prometheus/api/v1/write
    auth:
      strategy: basic
      user: [email protected]
      password: CHANGE_ME
    compression: gzip
    healthcheck:
      enabled: false

gaby avatar Jul 24 '24 02:07 gaby

In reality you should be using compression: snappy. As stated here: https://prometheus.io/docs/specs/remote_write_spec/#protocol

gaby avatar Jul 24 '24 02:07 gaby

nope, same prob. thanks anyways

neilmcguigan avatar Jul 24 '24 02:07 neilmcguigan

The logs in OpenObserve should be telling you why the request is bad http 400.

gaby avatar Jul 24 '24 02:07 gaby

@gaby that was it. What a rabbit hole. That fixed it.

mridang avatar Nov 25 '25 15:11 mridang